@functionalui/functionalui 0.2.1 → 0.2.3
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/dist/Avatar-BK9MFMsZ.cjs +1 -0
- package/dist/Avatar-CQA0mEVW.js +118 -0
- package/dist/Button-CpTXDsI7.js +215 -0
- package/dist/Button-rg5gSHcQ.cjs +1 -0
- package/dist/Checkbox-BHpT6PHl.cjs +1 -0
- package/dist/Checkbox-C29jP71p.js +96 -0
- package/dist/GlobalEventContext-D9ug9s1O.cjs +1 -0
- package/dist/GlobalEventContext-DUmT3Vay.js +49 -0
- package/dist/GlobalEventPortal-BIdCGd-m.cjs +1 -0
- package/dist/GlobalEventPortal-GjfUDr2B.js +17 -0
- package/dist/LabelText-BUslE9cx.cjs +1 -0
- package/dist/LabelText-D7QIWtWj.js +35 -0
- package/dist/Modal-BRIYhcOg.cjs +3 -0
- package/dist/Modal-DXLyt-j4.js +1290 -0
- package/dist/SpringEnterOffsetBy-BVN6rm57.cjs +1 -0
- package/dist/SpringEnterOffsetBy-DMSIQgV3.js +56 -0
- package/dist/TableHeader-BAdYoCbb.cjs +1 -0
- package/dist/TableHeader-Da0XxILB.js +103 -0
- package/dist/TableRow-BlJSvake.js +90 -0
- package/dist/TableRow-Bq58CTbU.cjs +1 -0
- package/dist/TagColor-BYKxfOU6.js +957 -0
- package/dist/TagColor-QGINp77p.cjs +1 -0
- package/dist/UIcon-B5rpDmHC.cjs +1 -0
- package/dist/UIcon-BHzbeYWw.js +245 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/admonition/index.cjs +1 -0
- package/dist/admonition/index.d.ts +27 -0
- package/dist/admonition/index.mjs +88 -0
- package/dist/avatar/index.cjs +1 -0
- package/dist/avatar/index.d.ts +115 -0
- package/dist/avatar/index.mjs +4 -0
- package/dist/avatar-group/index.cjs +1 -0
- package/dist/avatar-group/index.d.ts +120 -0
- package/dist/avatar-group/index.mjs +52 -0
- package/dist/button/index.cjs +1 -0
- package/dist/button/index.d.ts +249 -0
- package/dist/button/index.mjs +4 -0
- package/dist/checkbox/index.cjs +1 -0
- package/dist/checkbox/index.d.ts +32 -0
- package/dist/checkbox/index.mjs +4 -0
- package/dist/checkboxes/index.cjs +1 -0
- package/dist/checkboxes/index.d.ts +38 -0
- package/dist/checkboxes/index.mjs +80 -0
- package/dist/chip/index.cjs +1 -0
- package/dist/chip/index.d.ts +159 -0
- package/dist/chip/index.mjs +132 -0
- package/dist/classes-CBD1K4L1.js +779 -0
- package/dist/classes-CVxy1f4M.js +137 -0
- package/dist/classes-CtwIjJdw.cjs +1 -0
- package/dist/classes-HsjFV5aN.cjs +1 -0
- package/dist/color-picker/index.cjs +1 -0
- package/dist/color-picker/index.d.ts +14 -0
- package/dist/color-picker/index.mjs +234 -0
- package/dist/component-B1mkowwk.cjs +1 -0
- package/dist/component-B6F6g6i4.cjs +1 -0
- package/dist/component-BbvCmqLI.cjs +1 -0
- package/dist/component-Bh3EPTN0.cjs +1 -0
- package/dist/component-BvHdlcdE.js +9 -0
- package/dist/component-C1Gs4nVu.js +55 -0
- package/dist/component-CBIQe7z5.js +29 -0
- package/dist/component-CW2JPBAq.js +59 -0
- package/dist/component-D-EEi7NI.cjs +1 -0
- package/dist/component-D0wwK4KY.js +9 -0
- package/dist/component-D5nxKQnT.js +55 -0
- package/dist/component-D92LT0Mq.cjs +1 -0
- package/dist/component-DCHO9d6d.js +55 -0
- package/dist/component-DRXQXr2G.js +36 -0
- package/dist/component-D_igOAz3.cjs +1 -0
- package/dist/component-DdQu0mLI.js +31 -0
- package/dist/component-FS_2VwVz.cjs +1 -0
- package/dist/component-JigdcRMd.cjs +1 -0
- package/dist/container/index.cjs +1 -0
- package/dist/container/index.d.ts +238 -0
- package/dist/container/index.mjs +4 -0
- package/dist/contexts/notifications/index.cjs +1 -0
- package/dist/contexts/notifications/index.d.ts +2 -0
- package/dist/contexts/notifications/index.mjs +6 -0
- package/dist/contexts/ui/index.cjs +1 -0
- package/dist/contexts/ui/index.d.ts +2 -0
- package/dist/contexts/ui/index.mjs +35 -0
- package/dist/createTextElement-Cgrvdwvh.js +32 -0
- package/dist/createTextElement-DITFvK9p.cjs +1 -0
- package/dist/css/index.cjs +1 -0
- package/dist/css/index.css +1 -0
- package/dist/css/index.d.ts +1 -0
- package/dist/css/index.mjs +1 -0
- package/dist/div-measure/index.cjs +1 -0
- package/dist/div-measure/index.d.ts +13 -0
- package/dist/div-measure/index.mjs +26 -0
- package/dist/feather-sprite.svg +1 -0
- package/dist/gallery-modal/index.cjs +1 -0
- package/dist/gallery-modal/index.d.ts +11 -0
- package/dist/gallery-modal/index.mjs +464 -0
- package/dist/generics-9F1CmKPb.cjs +1 -0
- package/dist/generics-BrMr2-Gs.js +5 -0
- package/dist/generics-C-WSPclF.js +19 -0
- package/dist/generics-D33J7ILI.js +5 -0
- package/dist/generics-DE1oV0MV.cjs +1 -0
- package/dist/generics-nyvJhwQE.cjs +1 -0
- package/dist/global-event-portal/index.cjs +1 -0
- package/dist/global-event-portal/index.d.ts +8 -0
- package/dist/global-event-portal/index.mjs +4 -0
- package/dist/icons/index.cjs +1 -0
- package/dist/icons/index.d.ts +457 -0
- package/dist/icons/index.mjs +5 -0
- package/dist/icons-B8R1UT86.js +147 -0
- package/dist/icons-DSpaHhtT.cjs +1 -0
- package/dist/input-image/index.cjs +1 -0
- package/dist/input-image/index.d.ts +18 -0
- package/dist/input-image/index.mjs +106 -0
- package/dist/input-text/index.cjs +1 -0
- package/dist/input-text/index.d.ts +199 -0
- package/dist/input-text/index.mjs +246 -0
- package/dist/inset-group/index.cjs +1 -0
- package/dist/inset-group/index.d.ts +33 -0
- package/dist/inset-group/index.mjs +105 -0
- package/dist/label-text/index.cjs +1 -0
- package/dist/label-text/index.d.ts +11 -0
- package/dist/label-text/index.mjs +4 -0
- package/dist/layout/index.cjs +1 -0
- package/dist/layout/index.d.ts +163 -0
- package/dist/layout/index.mjs +4 -0
- package/dist/loading-spinner/index.cjs +1 -0
- package/dist/loading-spinner/index.d.ts +33 -0
- package/dist/loading-spinner/index.mjs +101 -0
- package/dist/modal/index.cjs +1 -0
- package/dist/modal/index.d.ts +105 -0
- package/dist/modal/index.mjs +4 -0
- package/dist/notification-system/index.cjs +1 -0
- package/dist/notification-system/index.d.ts +5 -0
- package/dist/notification-system/index.mjs +158 -0
- package/dist/portals/index.cjs +1 -0
- package/dist/portals/index.d.ts +10 -0
- package/dist/portals/index.mjs +4 -0
- package/dist/radio/index.cjs +1 -0
- package/dist/radio/index.d.ts +36 -0
- package/dist/radio/index.mjs +121 -0
- package/dist/react-spring_web.modern-DgQDaJ06.js +2304 -0
- package/dist/react-spring_web.modern-W3Nkoq_6.cjs +1 -0
- package/dist/select-spring/index.cjs +1 -0
- package/dist/select-spring/index.d.ts +70 -0
- package/dist/select-spring/index.mjs +471 -0
- package/dist/spring-enter/index.cjs +1 -0
- package/dist/spring-enter/index.d.ts +16 -0
- package/dist/spring-enter/index.mjs +45 -0
- package/dist/spring-enter-offset-by/index.cjs +1 -0
- package/dist/spring-enter-offset-by/index.d.ts +17 -0
- package/dist/spring-enter-offset-by/index.mjs +5 -0
- package/dist/spring-menu-transition/index.cjs +1 -0
- package/dist/spring-menu-transition/index.d.ts +15 -0
- package/dist/spring-menu-transition/index.mjs +43 -0
- package/dist/spring-open-close-height/index.cjs +1 -0
- package/dist/spring-open-close-height/index.d.ts +9 -0
- package/dist/spring-open-close-height/index.mjs +19 -0
- package/dist/styled/button/index.cjs +1 -0
- package/dist/styled/button/index.d.ts +2 -0
- package/dist/styled/button/index.mjs +4 -0
- package/dist/styled/inputs/text/index.cjs +1 -0
- package/dist/styled/inputs/text/index.d.ts +2 -0
- package/dist/styled/inputs/text/index.mjs +4 -0
- package/dist/styled/inputs/text-area/index.cjs +1 -0
- package/dist/styled/inputs/text-area/index.d.ts +2 -0
- package/dist/styled/inputs/text-area/index.mjs +4 -0
- package/dist/styled/li/index.cjs +1 -0
- package/dist/styled/li/index.d.ts +2 -0
- package/dist/styled/li/index.mjs +4 -0
- package/dist/styled/ul/index.cjs +1 -0
- package/dist/styled/ul/index.d.ts +2 -0
- package/dist/styled/ul/index.mjs +4 -0
- package/dist/table-grid/index.cjs +1 -0
- package/dist/table-grid/index.d.ts +70 -0
- package/dist/table-grid/index.mjs +49 -0
- package/dist/table-header/index.cjs +1 -0
- package/dist/table-header/index.d.ts +53 -0
- package/dist/table-header/index.mjs +4 -0
- package/dist/table-row/index.cjs +1 -0
- package/dist/table-row/index.d.ts +54 -0
- package/dist/table-row/index.mjs +4 -0
- package/dist/tabs/index.cjs +1 -0
- package/dist/tabs/index.d.ts +21 -0
- package/dist/tabs/index.mjs +134 -0
- package/dist/tag-color/index.cjs +1 -0
- package/dist/tag-color/index.d.ts +104 -0
- package/dist/tag-color/index.mjs +4 -0
- package/dist/text-area/index.cjs +1 -0
- package/dist/text-area/index.d.ts +212 -0
- package/dist/text-area/index.mjs +160 -0
- package/dist/texts/header/index.cjs +1 -0
- package/dist/texts/header/index.d.ts +2 -0
- package/dist/texts/header/index.mjs +28 -0
- package/dist/texts/p/index.cjs +1 -0
- package/dist/texts/p/index.d.ts +2 -0
- package/dist/texts/p/index.mjs +4 -0
- package/dist/texts/span/index.cjs +1 -0
- package/dist/texts/span/index.d.ts +2 -0
- package/dist/texts/span/index.mjs +4 -0
- package/dist/toggle-switch/index.cjs +1 -0
- package/dist/toggle-switch/index.d.ts +35 -0
- package/dist/toggle-switch/index.mjs +100 -0
- package/dist/types-34thzuQ5.js +134 -0
- package/dist/types-B3Ew5Ber.cjs +1 -0
- package/dist/types-B6XaG3V2.js +65 -0
- package/dist/types-BL1gBa8J.cjs +1 -0
- package/dist/types-BNUi2DUD.js +234 -0
- package/dist/types-BWsKfOhf.js +76 -0
- package/dist/types-BXyuQRbv.js +52 -0
- package/dist/types-BciByhvn.cjs +1 -0
- package/dist/types-BhBb436R.cjs +1 -0
- package/dist/types-Bh_j-nXM.js +168 -0
- package/dist/types-BnEsY_pc.cjs +1 -0
- package/dist/types-BuixDDod.js +12 -0
- package/dist/types-BzOxElrp.cjs +1 -0
- package/dist/types-CQP0_A_u.cjs +1 -0
- package/dist/types-Cev70RJC.cjs +1 -0
- package/dist/types-Cj8dOa0j.cjs +1 -0
- package/dist/types-CyVpnRmY.cjs +1 -0
- package/dist/types-DDcRx4Wz.cjs +1 -0
- package/dist/types-DNLw5jE2.js +151 -0
- package/dist/types-DZ_qlO_d.cjs +1 -0
- package/dist/types-DamZRbFt.js +4 -0
- package/dist/types-DevrYOgX.cjs +1 -0
- package/dist/types-DgSz2H9f.js +14 -0
- package/dist/types-DmnAtXuW.js +17 -0
- package/dist/types-Dyu7oUOO.js +4 -0
- package/dist/types-OOX58qQg.js +17 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +2062 -0
- package/dist/types.mjs +177 -0
- package/dist/useClickOutsideDOM-CBmttEFU.js +16 -0
- package/dist/useClickOutsideDOM-Dd6ewH8B.cjs +1 -0
- package/dist/useCombinedRef-COuiqHjO.js +14 -0
- package/dist/useCombinedRef-DZxHQ7PL.cjs +1 -0
- package/dist/values-B5r2bYNJ.js +75 -0
- package/dist/values-C40_Fyfk.cjs +1 -0
- package/dist/values-CSE3dLnv.js +200 -0
- package/dist/values-D-Y_dNaF.cjs +1 -0
- package/dist/web-B_p0FWHf.js +132 -0
- package/dist/web-yC_cLoAC.cjs +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { C as n } from "../component-C1Gs4nVu.js";
|
|
4
|
+
import { L as d } from "../component-DRXQXr2G.js";
|
|
5
|
+
import { T as L } from "../component-BvHdlcdE.js";
|
|
6
|
+
import { U as g } from "../UIcon-BHzbeYWw.js";
|
|
7
|
+
import { S as _ } from "../generics-C-WSPclF.js";
|
|
8
|
+
import { h as w, b as R } from "../classes-CVxy1f4M.js";
|
|
9
|
+
import { useState as v, useEffect as S } from "react";
|
|
10
|
+
const F = "_iconContainerDesktop_1wxn3_25", M = "_iconContainerMobile_1wxn3_34", U = {
|
|
11
|
+
iconContainerDesktop: F,
|
|
12
|
+
iconContainerMobile: M
|
|
13
|
+
}, z = ({
|
|
14
|
+
id: s,
|
|
15
|
+
name: p,
|
|
16
|
+
handleImageChange: i,
|
|
17
|
+
labelname: f,
|
|
18
|
+
defaultValue: o,
|
|
19
|
+
width: h = "100%",
|
|
20
|
+
height: x,
|
|
21
|
+
ref: y,
|
|
22
|
+
...C
|
|
23
|
+
}) => {
|
|
24
|
+
const [c, b] = v(), [a, l] = v(o);
|
|
25
|
+
S(() => {
|
|
26
|
+
if (o && o !== "") {
|
|
27
|
+
l(o);
|
|
28
|
+
return;
|
|
29
|
+
} else if (!c) return;
|
|
30
|
+
const t = URL.createObjectURL(c);
|
|
31
|
+
return l(t), () => {
|
|
32
|
+
var r;
|
|
33
|
+
if (t !== "")
|
|
34
|
+
r = t;
|
|
35
|
+
else if (c && a)
|
|
36
|
+
r = a;
|
|
37
|
+
else return;
|
|
38
|
+
try {
|
|
39
|
+
URL.revokeObjectURL(r);
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [o, c]);
|
|
44
|
+
const j = async (t) => {
|
|
45
|
+
if (!t.target.files || t.target.files.length === 0) return;
|
|
46
|
+
b(t.target.files[0]);
|
|
47
|
+
const r = URL.createObjectURL(t.target.files[0]);
|
|
48
|
+
l(r), i && i(t.target.files[0]);
|
|
49
|
+
}, u = () => {
|
|
50
|
+
b(void 0), l(void 0), i && i(void 0);
|
|
51
|
+
};
|
|
52
|
+
return /* @__PURE__ */ m(n, { children: [
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
"input",
|
|
55
|
+
{
|
|
56
|
+
id: s,
|
|
57
|
+
ref: y,
|
|
58
|
+
type: "file",
|
|
59
|
+
name: p,
|
|
60
|
+
onChange: j,
|
|
61
|
+
accept: "image/png, image/jpeg, image/webp, image/jpg",
|
|
62
|
+
style: {
|
|
63
|
+
opacity: 0,
|
|
64
|
+
pointerEvents: "none",
|
|
65
|
+
width: 0,
|
|
66
|
+
height: 0,
|
|
67
|
+
position: "absolute"
|
|
68
|
+
},
|
|
69
|
+
...C
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ e(
|
|
73
|
+
"label",
|
|
74
|
+
{
|
|
75
|
+
htmlFor: s,
|
|
76
|
+
onMouseEnter: () => {
|
|
77
|
+
},
|
|
78
|
+
onMouseLeave: () => {
|
|
79
|
+
},
|
|
80
|
+
style: { width: h, height: x, cursor: "pointer" },
|
|
81
|
+
children: a ? /* @__PURE__ */ e(
|
|
82
|
+
k,
|
|
83
|
+
{
|
|
84
|
+
src: a,
|
|
85
|
+
width: h,
|
|
86
|
+
handleCancel: u
|
|
87
|
+
}
|
|
88
|
+
) : /* @__PURE__ */ m(d, { display: R.Flex, flexAlignItem: w.Center, children: [
|
|
89
|
+
/* @__PURE__ */ e(n, { marginRight: _.Size1, children: /* @__PURE__ */ e(L, { children: f || "Upload image" }) }),
|
|
90
|
+
/* @__PURE__ */ e(n, { className: `${U.iconContainerDesktop}`, children: /* @__PURE__ */ e(g, { name: "image" }) }),
|
|
91
|
+
/* @__PURE__ */ e(n, { className: `${U.iconContainerMobile}`, children: /* @__PURE__ */ e(g, { name: "camera" }) })
|
|
92
|
+
] })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
}, k = ({
|
|
97
|
+
src: s,
|
|
98
|
+
width: p,
|
|
99
|
+
handleCancel: i
|
|
100
|
+
}) => /* @__PURE__ */ m(d, { children: [
|
|
101
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("img", { alt: "preview", src: s, width: p }) }),
|
|
102
|
+
/* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(g, { name: "x", iconAction: () => i() }) })
|
|
103
|
+
] });
|
|
104
|
+
export {
|
|
105
|
+
z as InputImage
|
|
106
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("../component-D-EEi7NI.cjs"),$=require("../component-B6F6g6i4.cjs"),c=require("../generics-DE1oV0MV.cjs"),w=require("../generics-9F1CmKPb.cjs"),F=require("../values-D-Y_dNaF.cjs"),e=require("../icons-DSpaHhtT.cjs"),T=require("react"),A=require("../useCombinedRef-DZxHQ7PL.cjs"),G=require("../LabelText-BUslE9cx.cjs"),L=require("../UIcon-B5rpDmHC.cjs"),H=require("../generics-nyvJhwQE.cjs"),V=require("../component-Bh3EPTN0.cjs"),J=({inputHelper:o})=>{const[s,r]=T.useState(!1);return t.jsxs(d.Container,{style:{position:"absolute",top:"50%",right:-10,transform:"translateY(-25%)"},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[t.jsx(L.UIcon,{name:"info",size:H.Sizings.Size2,colorLight:c.ColorPalettes.Primary5,colorDark:c.ColorPalettes.Primary5}),t.jsx(d.Container,{style:{position:"relative",pointerEvents:"none"},children:t.jsx(G.LabelText,{labelName:o,hover:s,x:0,y:0})})]})},K="_inputtext_rg89u_1",Q="_showHidePassword_rg89u_41",q={inputtext:K,showHidePassword:Q},ee=({isShow:o,handleShowHideText:s})=>t.jsx(d.Container,{className:q.showHidePassword,style:{position:"absolute",bottom:".75rem",left:"88%",zIndex:4,cursor:"pointer"},onClick:()=>s(),children:t.jsx(L.UIcon,{name:o?e.Icons.EyeOff:e.Icons.Eye,size:H.Sizings.Size3,colorLight:c.ColorPalettes.Primary5,colorDark:c.ColorPalettes.Primary5,cursor:w.Cursors.Pointer})}),te=({id:o,label:s,size:r,labelTextColor:i,inputColor:n})=>t.jsx(d.Container,{paddingLeft:e.INPUT_TEXT_SIZE[r].paddings.left,paddingBottom:e.INPUT_TEXT_SIZE[r].paddings.bottom,children:t.jsx("label",{htmlFor:o,children:t.jsx(V.Text_Span,{fontWeight:w.FontWeights.Size3,paletteColor:i&&typeof i=="boolean"?e.INPUT_TEXT_COLOR[n].labelColor:c.ColorPalettes.Grey10,fontSize:e.INPUT_TEXT_SIZE[r].font.size,children:s})})}),oe=({id:o,name:s,type:r=e.InputTextTypes.Text,value:i,modes:n=e.InputTextModes.Default,label:f,focus:p,required:_,width:I,fullWidth:S,helperText:x,placeholder:E="Insert text",step:v,min:O,handleChange:b,handleFocus:g,handleBlur:y,handleCheck:m,size:u=e.InputTextSizes.Default,inputStyle:P=e.InputTextStyles.Default,inputColor:h=c.ColorSets.Primarys,labelTextColor:R=!0,transparent:N,ref:Z,...D})=>{const a=T.useRef(null),B=A.useCombinedRef(a,Z);T.useEffect(()=>{if(n!==e.InputTextModes.Disabled){if(p){a.current&&a.current.focus();return}i!==""&&a.current&&a.current.value}},[p,n,i]);const[M,U]=T.useState(r),[C,z]=T.useState(!1),k=()=>{z(l=>!l)};T.useEffect(()=>{r===e.InputTextTypes.Password&&U(C?e.InputTextTypes.Text:e.InputTextTypes.Password)},[C]);const W=l=>{b&&b(l)},Y=T.useCallback(async l=>{l.preventDefault();const X=l.target.value.trim();if(!(!X||X!=="")){y&&y(),m&&await m();return}},[y,m]),j=T.useCallback(()=>{if(n!==e.InputTextModes.Disabled)return a.current&&a.current.focus(),g&&g(),!0},[g,n]);return t.jsxs(d.Container,{style:{width:S?"100%":I||350,position:"relative"},children:[!N&&t.jsx(te,{id:o,label:f,inputColor:h,size:u,labelTextColor:R}),t.jsxs(d.Container,{boxSizing:w.BoxSizings.BorderBox,...re(P,N),borderColor:e.INPUT_TEXT_COLOR[h].borderColor,paddingLeft:e.INPUT_TEXT_SIZE[u].paddings.left,paddingRight:e.INPUT_TEXT_SIZE[u].paddings.right,paddingTop:e.INPUT_TEXT_SIZE[u].paddings.top,paddingBottom:e.INPUT_TEXT_SIZE[u].paddings.bottom,style:{paddingTop:P!==e.InputTextStyles.Outlined?1:"",paddingBottom:P!==e.InputTextStyles.Outlined?F.SPACING_VALUES[e.INPUT_TEXT_SIZE[u].paddings.bottom]:"",display:P!==e.InputTextStyles.Outlined?"flex":"block",cursor:"text"},onClick:()=>j(),children:[t.jsx($.F__TextInput,{ref:B,type:M,required:_,disabled:n!==e.InputTextModes.Disabled?void 0:!0,fontSize:e.INPUT_TEXT_SIZE[u].font.size,fontWeight:e.INPUT_TEXT_SIZE[u].font.weight,color:e.INPUT_TEXT_COLOR[h].fontColor,placeholder:E,id:o,name:s,value:i,min:O,step:v,onChange:b?W:void 0,onFocus:j,onBlur:Y,className:q.inputtext,...D}),r===e.InputTextTypes.Password&&t.jsx(ee,{isShow:C,handleShowHideText:k}),x&&t.jsx(J,{inputHelper:x})]})]})},re=(o,s=!1)=>{var r,i,n,f,p,_,I,S,x,E;return s?{}:{borderBottomStyle:(n=(i=(r=e.INPUT_TEXT_STYLE[o])==null?void 0:r.borders)==null?void 0:i.bottom)==null?void 0:n.style,borderWidth:(p=(f=e.INPUT_TEXT_STYLE[o])==null?void 0:f.borders)==null?void 0:p.width,borderRadius:(I=(_=e.INPUT_TEXT_STYLE[o])==null?void 0:_.borders)==null?void 0:I.radius,borderStyle:(E=(x=(S=e.INPUT_TEXT_STYLE[o])==null?void 0:S.borders)==null?void 0:x.borders)==null?void 0:E.style}};exports.InputText=oe;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { RefObject } from 'react';
|
|
5
|
+
|
|
6
|
+
declare enum ColorPalettes {
|
|
7
|
+
Transparent = 1,// (0, 1)
|
|
8
|
+
Grey1 = 2,
|
|
9
|
+
Grey2 = 3,
|
|
10
|
+
Grey3 = 4,
|
|
11
|
+
Grey4 = 5,
|
|
12
|
+
Grey5 = 6,
|
|
13
|
+
Grey6 = 7,
|
|
14
|
+
Grey7 = 8,
|
|
15
|
+
Grey8 = 9,
|
|
16
|
+
Grey9 = 10,
|
|
17
|
+
Grey10 = 11,// (2, 11)
|
|
18
|
+
Primary1 = 12,
|
|
19
|
+
Primary2 = 13,
|
|
20
|
+
Primary3 = 14,
|
|
21
|
+
Primary4 = 15,
|
|
22
|
+
Primary5 = 16,
|
|
23
|
+
Primary6 = 17,
|
|
24
|
+
Primary7 = 18,
|
|
25
|
+
Primary8 = 19,
|
|
26
|
+
Primary9 = 20,// (12, 20)
|
|
27
|
+
Secondary1 = 21,
|
|
28
|
+
Secondary2 = 22,
|
|
29
|
+
Secondary3 = 23,
|
|
30
|
+
Secondary4 = 24,
|
|
31
|
+
Secondary5 = 25,
|
|
32
|
+
Secondary6 = 26,
|
|
33
|
+
Secondary7 = 27,
|
|
34
|
+
Secondary8 = 28,
|
|
35
|
+
Secondary9 = 29,// (21, 29)
|
|
36
|
+
Red1 = 30,
|
|
37
|
+
Red2 = 31,
|
|
38
|
+
Red3 = 32,
|
|
39
|
+
Red4 = 33,
|
|
40
|
+
Red5 = 34,
|
|
41
|
+
Red6 = 35,
|
|
42
|
+
Red7 = 36,
|
|
43
|
+
Red8 = 37,
|
|
44
|
+
Red9 = 38,// (30, 38)
|
|
45
|
+
Green1 = 39,
|
|
46
|
+
Green2 = 40,
|
|
47
|
+
Green3 = 41,
|
|
48
|
+
Green4 = 42,
|
|
49
|
+
Green5 = 43,
|
|
50
|
+
Green6 = 44,
|
|
51
|
+
Green7 = 45,
|
|
52
|
+
Green8 = 46,
|
|
53
|
+
Green9 = 47,// (39, 47)
|
|
54
|
+
Blue1 = 48,
|
|
55
|
+
Blue2 = 49,
|
|
56
|
+
Blue3 = 50,
|
|
57
|
+
Blue4 = 51,
|
|
58
|
+
Blue5 = 52,
|
|
59
|
+
Blue6 = 53,
|
|
60
|
+
Blue7 = 54,
|
|
61
|
+
Blue8 = 55,
|
|
62
|
+
Blue9 = 56,// (48, 56)
|
|
63
|
+
Yellow1 = 57,
|
|
64
|
+
Yellow2 = 58,
|
|
65
|
+
Yellow3 = 59,
|
|
66
|
+
Yellow4 = 60,
|
|
67
|
+
Yellow5 = 61,
|
|
68
|
+
Yellow6 = 62,
|
|
69
|
+
Yellow7 = 63,
|
|
70
|
+
Yellow8 = 64,
|
|
71
|
+
Yellow9 = 65,// (57, 65)
|
|
72
|
+
Accent1_1 = 66,
|
|
73
|
+
Accent1_2 = 67,
|
|
74
|
+
Accent1_3 = 68,
|
|
75
|
+
Accent1_4 = 69,
|
|
76
|
+
Accent1_5 = 70,
|
|
77
|
+
Accent1_6 = 71,
|
|
78
|
+
Accent1_7 = 72,
|
|
79
|
+
Accent1_8 = 73,
|
|
80
|
+
Accent1_9 = 74,// (57, 65)
|
|
81
|
+
Accent2_1 = 75,
|
|
82
|
+
Accent2_2 = 76,
|
|
83
|
+
Accent2_3 = 77,
|
|
84
|
+
Accent2_4 = 78,
|
|
85
|
+
Accent2_5 = 79,
|
|
86
|
+
Accent2_6 = 80,
|
|
87
|
+
Accent2_7 = 81,
|
|
88
|
+
Accent2_8 = 82,
|
|
89
|
+
Accent2_9 = 83
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare enum ColorSets {
|
|
93
|
+
Transparents = 1,
|
|
94
|
+
Greys = 2,
|
|
95
|
+
Primarys = 3,
|
|
96
|
+
Secondarys = 4,
|
|
97
|
+
Reds = 5,
|
|
98
|
+
Greens = 6,
|
|
99
|
+
Blues = 7,
|
|
100
|
+
Yellows = 8,
|
|
101
|
+
Accents1 = 9,
|
|
102
|
+
Accents2 = 10
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare enum FontSizes {
|
|
106
|
+
Size1 = 1,
|
|
107
|
+
Size2 = 2,
|
|
108
|
+
Size3 = 3,
|
|
109
|
+
Size4 = 4,
|
|
110
|
+
Size5 = 5,
|
|
111
|
+
Size6 = 6,
|
|
112
|
+
Size7 = 7,
|
|
113
|
+
Size8 = 8,
|
|
114
|
+
Size9 = 9,
|
|
115
|
+
Size10 = 10
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare enum FontWeights {
|
|
119
|
+
Size1 = 1,
|
|
120
|
+
Size2 = 2,
|
|
121
|
+
Size3 = 3,
|
|
122
|
+
Size4 = 4,
|
|
123
|
+
Size5 = 5,
|
|
124
|
+
Size6 = 6
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare const InputText: ({ id, name, type, value, modes, label, focus, required, width, fullWidth, helperText, placeholder, step, min, handleChange, handleFocus, handleBlur, handleCheck, size, inputStyle, inputColor, labelTextColor, transparent, ref, ...props }: P) => JSX.Element;
|
|
128
|
+
|
|
129
|
+
declare enum InputTextModes {
|
|
130
|
+
Default = 1,
|
|
131
|
+
Error = 2,
|
|
132
|
+
Disabled = 3,
|
|
133
|
+
ReadOnly = 4
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* text size
|
|
138
|
+
* label size
|
|
139
|
+
* padding left right
|
|
140
|
+
* padding top bottom
|
|
141
|
+
* border width
|
|
142
|
+
*/
|
|
143
|
+
declare enum InputTextSizes {
|
|
144
|
+
Small = 1,
|
|
145
|
+
Default = 2,// medium
|
|
146
|
+
Big = 3,
|
|
147
|
+
Huge = 4
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare enum InputTextStyles {
|
|
151
|
+
Default = 1,// border bottom
|
|
152
|
+
Outlined = 2,// outline overall
|
|
153
|
+
Filled = 3
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
declare enum InputTextTypes {
|
|
157
|
+
Text = "text",
|
|
158
|
+
Number = "number",
|
|
159
|
+
Password = "password"
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* icon on left or right side
|
|
164
|
+
*/
|
|
165
|
+
declare interface P extends HTMLAttributes<HTMLInputElement> {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
type?: InputTextTypes;
|
|
169
|
+
value?: any;
|
|
170
|
+
modes?: InputTextModes;
|
|
171
|
+
label: string;
|
|
172
|
+
focus?: boolean;
|
|
173
|
+
width?: number | string;
|
|
174
|
+
required?: boolean;
|
|
175
|
+
fullWidth?: boolean;
|
|
176
|
+
placeholder?: string;
|
|
177
|
+
helperText?: string;
|
|
178
|
+
step?: number;
|
|
179
|
+
min?: number;
|
|
180
|
+
handleChange?: (v: ChangeEvent<HTMLInputElement>) => void;
|
|
181
|
+
handleFocus?: (v?: any) => void;
|
|
182
|
+
handleBlur?: (v?: any) => void;
|
|
183
|
+
handleCheck?: (v?: any) => Promise<any> | void;
|
|
184
|
+
fontColor?: ColorPalettes;
|
|
185
|
+
fontWeight?: FontWeights;
|
|
186
|
+
fontSize?: FontSizes;
|
|
187
|
+
size?: InputTextSizes;
|
|
188
|
+
inputStyle?: InputTextStyles;
|
|
189
|
+
inputColor?: ColorSets;
|
|
190
|
+
/**
|
|
191
|
+
* colors
|
|
192
|
+
* - border color, input text color, label color, icon color
|
|
193
|
+
*/
|
|
194
|
+
labelTextColor?: boolean | ColorPalettes;
|
|
195
|
+
transparent?: boolean;
|
|
196
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { }
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as L, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { C as f } from "../component-C1Gs4nVu.js";
|
|
4
|
+
import { F as tt } from "../component-CBIQe7z5.js";
|
|
5
|
+
import { C as b, a as ot } from "../generics-D33J7ILI.js";
|
|
6
|
+
import { C as et, f as rt, c as st } from "../generics-C-WSPclF.js";
|
|
7
|
+
import { S as nt } from "../values-B5r2bYNJ.js";
|
|
8
|
+
import { c as z, a as s, I as D, e as S, h as m, f as it, g as y, b as I } from "../icons-B8R1UT86.js";
|
|
9
|
+
import { useState as B, useRef as at, useEffect as W, useCallback as k } from "react";
|
|
10
|
+
import { u as dt } from "../useCombinedRef-COuiqHjO.js";
|
|
11
|
+
import { L as lt } from "../LabelText-D7QIWtWj.js";
|
|
12
|
+
import { U as F } from "../UIcon-BHzbeYWw.js";
|
|
13
|
+
import { S as M } from "../generics-BrMr2-Gs.js";
|
|
14
|
+
import { T as ft } from "../component-BvHdlcdE.js";
|
|
15
|
+
const ut = ({ inputHelper: t }) => {
|
|
16
|
+
const [n, o] = B(!1);
|
|
17
|
+
return /* @__PURE__ */ L(
|
|
18
|
+
f,
|
|
19
|
+
{
|
|
20
|
+
style: {
|
|
21
|
+
position: "absolute",
|
|
22
|
+
top: "50%",
|
|
23
|
+
right: -10,
|
|
24
|
+
transform: "translateY(-25%)"
|
|
25
|
+
},
|
|
26
|
+
onMouseEnter: () => o(!0),
|
|
27
|
+
onMouseLeave: () => o(!1),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
F,
|
|
31
|
+
{
|
|
32
|
+
name: "info",
|
|
33
|
+
size: M.Size2,
|
|
34
|
+
colorLight: b.Primary5,
|
|
35
|
+
colorDark: b.Primary5
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ e(f, { style: { position: "relative", pointerEvents: "none" }, children: /* @__PURE__ */ e(lt, { labelName: t, hover: n, x: 0, y: 0 }) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}, pt = "_inputtext_rg89u_1", ct = "_showHidePassword_rg89u_41", X = {
|
|
43
|
+
inputtext: pt,
|
|
44
|
+
showHidePassword: ct
|
|
45
|
+
}, mt = ({ isShow: t, handleShowHideText: n }) => /* @__PURE__ */ e(
|
|
46
|
+
f,
|
|
47
|
+
{
|
|
48
|
+
className: X.showHidePassword,
|
|
49
|
+
style: {
|
|
50
|
+
position: "absolute",
|
|
51
|
+
bottom: ".75rem",
|
|
52
|
+
left: "88%",
|
|
53
|
+
zIndex: 4,
|
|
54
|
+
cursor: "pointer"
|
|
55
|
+
},
|
|
56
|
+
onClick: () => n(),
|
|
57
|
+
children: /* @__PURE__ */ e(
|
|
58
|
+
F,
|
|
59
|
+
{
|
|
60
|
+
name: t ? z.EyeOff : z.Eye,
|
|
61
|
+
size: M.Size3,
|
|
62
|
+
colorLight: b.Primary5,
|
|
63
|
+
colorDark: b.Primary5,
|
|
64
|
+
cursor: et.Pointer
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
), bt = ({
|
|
69
|
+
id: t,
|
|
70
|
+
label: n,
|
|
71
|
+
size: o,
|
|
72
|
+
labelTextColor: i,
|
|
73
|
+
inputColor: r
|
|
74
|
+
}) => /* @__PURE__ */ e(
|
|
75
|
+
f,
|
|
76
|
+
{
|
|
77
|
+
paddingLeft: s[o].paddings.left,
|
|
78
|
+
paddingBottom: s[o].paddings.bottom,
|
|
79
|
+
children: /* @__PURE__ */ e("label", { htmlFor: t, children: /* @__PURE__ */ e(
|
|
80
|
+
ft,
|
|
81
|
+
{
|
|
82
|
+
fontWeight: rt.Size3,
|
|
83
|
+
paletteColor: i && typeof i == "boolean" ? D[r].labelColor : b.Grey10,
|
|
84
|
+
fontSize: s[o].font.size,
|
|
85
|
+
children: n
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
}
|
|
89
|
+
), Lt = ({
|
|
90
|
+
// required
|
|
91
|
+
id: t,
|
|
92
|
+
name: n,
|
|
93
|
+
type: o = m.Text,
|
|
94
|
+
value: i,
|
|
95
|
+
modes: r = S.Default,
|
|
96
|
+
label: g,
|
|
97
|
+
// optional properties
|
|
98
|
+
focus: u,
|
|
99
|
+
required: T,
|
|
100
|
+
width: p,
|
|
101
|
+
fullWidth: x,
|
|
102
|
+
helperText: c,
|
|
103
|
+
placeholder: h = "Insert text",
|
|
104
|
+
// other types property
|
|
105
|
+
step: j,
|
|
106
|
+
min: A,
|
|
107
|
+
// methods
|
|
108
|
+
handleChange: P,
|
|
109
|
+
handleFocus: _,
|
|
110
|
+
handleBlur: H,
|
|
111
|
+
handleCheck: C,
|
|
112
|
+
// styling
|
|
113
|
+
size: a = it.Default,
|
|
114
|
+
inputStyle: w = y.Default,
|
|
115
|
+
inputColor: v = ot.Primarys,
|
|
116
|
+
// customizations
|
|
117
|
+
labelTextColor: G = !0,
|
|
118
|
+
transparent: N,
|
|
119
|
+
ref: Y,
|
|
120
|
+
...V
|
|
121
|
+
}) => {
|
|
122
|
+
const d = at(null), Z = dt(d, Y);
|
|
123
|
+
W(() => {
|
|
124
|
+
if (r !== S.Disabled) {
|
|
125
|
+
if (u) {
|
|
126
|
+
d.current && d.current.focus();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
i !== "" && d.current && d.current.value;
|
|
130
|
+
}
|
|
131
|
+
}, [u, r, i]);
|
|
132
|
+
const [q, R] = B(o), [E, J] = B(!1), K = () => {
|
|
133
|
+
J((l) => !l);
|
|
134
|
+
};
|
|
135
|
+
W(() => {
|
|
136
|
+
o === m.Password && R(E ? m.Text : m.Password);
|
|
137
|
+
}, [E]);
|
|
138
|
+
const Q = (l) => {
|
|
139
|
+
P && P(l);
|
|
140
|
+
}, $ = k(
|
|
141
|
+
async (l) => {
|
|
142
|
+
l.preventDefault();
|
|
143
|
+
const U = l.target.value.trim();
|
|
144
|
+
if (!(!U || U !== "")) {
|
|
145
|
+
H && H(), C && await C();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
[H, C]
|
|
150
|
+
), O = k(() => {
|
|
151
|
+
if (r !== S.Disabled)
|
|
152
|
+
return d.current && d.current.focus(), _ && _(), !0;
|
|
153
|
+
}, [_, r]);
|
|
154
|
+
return /* @__PURE__ */ L(
|
|
155
|
+
f,
|
|
156
|
+
{
|
|
157
|
+
style: {
|
|
158
|
+
width: x ? "100%" : p || 350,
|
|
159
|
+
position: "relative"
|
|
160
|
+
// to label
|
|
161
|
+
},
|
|
162
|
+
children: [
|
|
163
|
+
!N && /* @__PURE__ */ e(
|
|
164
|
+
bt,
|
|
165
|
+
{
|
|
166
|
+
id: t,
|
|
167
|
+
label: g,
|
|
168
|
+
inputColor: v,
|
|
169
|
+
size: a,
|
|
170
|
+
labelTextColor: G
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ L(
|
|
174
|
+
f,
|
|
175
|
+
{
|
|
176
|
+
boxSizing: st.BorderBox,
|
|
177
|
+
...gt(w, N),
|
|
178
|
+
borderColor: D[v].borderColor,
|
|
179
|
+
paddingLeft: s[a].paddings.left,
|
|
180
|
+
paddingRight: s[a].paddings.right,
|
|
181
|
+
paddingTop: s[a].paddings.top,
|
|
182
|
+
paddingBottom: s[a].paddings.bottom,
|
|
183
|
+
style: {
|
|
184
|
+
// position: "relative",
|
|
185
|
+
// width: fullWidth ? "100%" : width ? width : 350,
|
|
186
|
+
paddingTop: w !== y.Outlined ? 1 : "",
|
|
187
|
+
paddingBottom: w !== y.Outlined ? nt[s[a].paddings.bottom] : "",
|
|
188
|
+
// display: size === InputTextSizes.Small ? "flex" : "block",
|
|
189
|
+
display: w !== y.Outlined ? "flex" : "block",
|
|
190
|
+
cursor: "text"
|
|
191
|
+
},
|
|
192
|
+
onClick: () => O(),
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ e(
|
|
195
|
+
tt,
|
|
196
|
+
{
|
|
197
|
+
ref: Z,
|
|
198
|
+
type: q,
|
|
199
|
+
required: T,
|
|
200
|
+
disabled: r !== S.Disabled ? void 0 : !0,
|
|
201
|
+
fontSize: s[a].font.size,
|
|
202
|
+
fontWeight: s[a].font.weight,
|
|
203
|
+
color: D[v].fontColor,
|
|
204
|
+
placeholder: h,
|
|
205
|
+
id: t,
|
|
206
|
+
name: n,
|
|
207
|
+
value: i,
|
|
208
|
+
min: A,
|
|
209
|
+
step: j,
|
|
210
|
+
onChange: P ? Q : void 0,
|
|
211
|
+
onFocus: O,
|
|
212
|
+
onBlur: $,
|
|
213
|
+
className: X.inputtext,
|
|
214
|
+
...V
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
o === m.Password && /* @__PURE__ */ e(
|
|
218
|
+
mt,
|
|
219
|
+
{
|
|
220
|
+
isShow: E,
|
|
221
|
+
handleShowHideText: K
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
c && /* @__PURE__ */ e(ut, { inputHelper: c })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}, gt = (t, n = !1) => {
|
|
232
|
+
var o, i, r, g, u, T, p, x, c, h;
|
|
233
|
+
return n ? {} : {
|
|
234
|
+
// default
|
|
235
|
+
borderBottomStyle: (r = (i = (o = I[t]) == null ? void 0 : o.borders) == null ? void 0 : i.bottom) == null ? void 0 : r.style,
|
|
236
|
+
borderWidth: (u = (g = I[t]) == null ? void 0 : g.borders) == null ? void 0 : u.width,
|
|
237
|
+
// outline
|
|
238
|
+
borderRadius: (p = (T = I[t]) == null ? void 0 : T.borders) == null ? void 0 : p.radius,
|
|
239
|
+
borderStyle: (h = (c = (x = I[t]) == null ? void 0 : x.borders) == null ? void 0 : c.borders) == null ? void 0 : h.style
|
|
240
|
+
// filled
|
|
241
|
+
// borderRadius: undefined,
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
export {
|
|
245
|
+
Lt as InputText
|
|
246
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("../component-B1mkowwk.cjs"),r=require("../generics-9F1CmKPb.cjs"),R=require("../classes-HsjFV5aN.cjs"),h=require("react"),C=require("../react-spring_web.modern-W3Nkoq_6.cjs"),y=require("../component-D-EEi7NI.cjs"),f=require("../component-Bh3EPTN0.cjs"),u=require("../generics-DE1oV0MV.cjs"),t=require("../values-C40_Fyfk.cjs"),x=({text:o,idx:i,handleSelectInset:d,isSelected:n,insetColor:l=u.ColorSets.Primarys,borderTopLeftRadius:p,borderTopRightRadius:S,borderBottomLeftRadius:c,borderBottomRightRadius:g})=>{const s=C.useSpring({backgroundColor:n?t.COLOR_VALUES[t.ColorRanges[l][0]+3]:t.COLOR_VALUES[t.ColorRanges[u.ColorSets.Greys][0]+2],color:n?t.COLOR_VALUES[t.ColorRanges[u.ColorSets.Greys][1]-1]:t.COLOR_VALUES[t.ColorRanges[u.ColorSets.Greys][1]-4],boxShadow:n?"inset 0 0px 0 hsla(0, 0%, 0%, 0), inset 0 0px 0px hsla(0, 0%, 0%, 0)":"inset 0 -2px 0 hsla(0, 0%, 100%, .055), inset 0 2px 2px hsla(0, 0%, 0%, 0.1)"}),e=C.useSpring({fontWeight:n?500:300});return a.jsx(y.Container,{style:{...s,cursor:"pointer"},paddingTop:r.Spacings.Size1,paddingBottom:r.Spacings.Size1,paddingLeft:r.Spacings.Size2,paddingRight:r.Spacings.Size2,borderTopLeftRadius:p,borderTopRightRadius:S,borderBottomLeftRadius:c,borderBottomRightRadius:g,onClick:()=>d(i),children:a.jsx(y.Container,{style:e,children:a.jsx(f.Text_Span,{style:{color:"inherit",transform:"translateY(-1px)",display:"inline-block"},children:o})})})},L=({options:o=[],valueIndex:i=0,id:d,setInput:n,setSelect:l,insetColor:p})=>{const[S,c]=h.useState(i);h.useEffect(()=>{typeof i=="number"&&c(i)},[i]);const g=s=>{c(s),n&&n(e=>({...e,[d]:o[s]})),l&&l(o[s])};return a.jsx(m.Layout,{display:R.Displays.Flex,flexAlignItem:R.FlexAlignItems.Center,children:o.map((s,e)=>a.jsx(x,{text:s.text,value:s.value,idx:e,id:s.id,handleSelectInset:g,isSelected:e===S,insetColor:p,borderTopLeftRadius:e===0?r.Radiuses.Size4:void 0,borderTopRightRadius:e===o.length-1?r.Radiuses.Size4:void 0,borderBottomLeftRadius:e===0?r.Radiuses.Size4:void 0,borderBottomRightRadius:e===o.length-1?r.Radiuses.Size4:void 0},e))})};exports.InsetGroup=L;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ColorSets {
|
|
4
|
+
Transparents = 1,
|
|
5
|
+
Greys = 2,
|
|
6
|
+
Primarys = 3,
|
|
7
|
+
Secondarys = 4,
|
|
8
|
+
Reds = 5,
|
|
9
|
+
Greens = 6,
|
|
10
|
+
Blues = 7,
|
|
11
|
+
Yellows = 8,
|
|
12
|
+
Accents1 = 9,
|
|
13
|
+
Accents2 = 10
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const InsetGroup: FC<P>;
|
|
17
|
+
|
|
18
|
+
declare interface InsetGroupOption {
|
|
19
|
+
id: string | number;
|
|
20
|
+
text: string;
|
|
21
|
+
value?: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare interface P {
|
|
25
|
+
id: any;
|
|
26
|
+
options: InsetGroupOption[];
|
|
27
|
+
valueIndex?: any;
|
|
28
|
+
setInput?: any;
|
|
29
|
+
setSelect?: (v: InsetGroupOption) => void;
|
|
30
|
+
insetColor?: ColorSets;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { }
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { L as R } from "../component-DRXQXr2G.js";
|
|
4
|
+
import { S as l, R as p } from "../generics-C-WSPclF.js";
|
|
5
|
+
import { h as b, b as x } from "../classes-CVxy1f4M.js";
|
|
6
|
+
import { useState as z, useEffect as C } from "react";
|
|
7
|
+
import { u } from "../react-spring_web.modern-DgQDaJ06.js";
|
|
8
|
+
import { C as y } from "../component-C1Gs4nVu.js";
|
|
9
|
+
import { T as L } from "../component-BvHdlcdE.js";
|
|
10
|
+
import { a as m } from "../generics-D33J7ILI.js";
|
|
11
|
+
import { a as d, c as f } from "../values-CSE3dLnv.js";
|
|
12
|
+
const I = ({
|
|
13
|
+
text: e,
|
|
14
|
+
// value,
|
|
15
|
+
idx: s,
|
|
16
|
+
// id,
|
|
17
|
+
handleSelectInset: c,
|
|
18
|
+
isSelected: o,
|
|
19
|
+
// rgbBg,
|
|
20
|
+
insetColor: a = m.Primarys,
|
|
21
|
+
borderTopLeftRadius: h,
|
|
22
|
+
borderTopRightRadius: S,
|
|
23
|
+
borderBottomLeftRadius: n,
|
|
24
|
+
borderBottomRightRadius: g
|
|
25
|
+
}) => {
|
|
26
|
+
const r = u({
|
|
27
|
+
// backgroundColor: isSelected ? rgbBg ? rgbBg : "rgb(255,255,255)" : "rgb(222,226,230)",
|
|
28
|
+
backgroundColor: o ? d[f[a][0] + 3] : d[f[m.Greys][0] + 2],
|
|
29
|
+
// color: isSelected ? "rgb(25,25,25)" : "rgb(134,142,150)",
|
|
30
|
+
color: o ? d[f[m.Greys][1] - 1] : d[f[m.Greys][1] - 4],
|
|
31
|
+
boxShadow: o ? "inset 0 0px 0 hsla(0, 0%, 0%, 0), inset 0 0px 0px hsla(0, 0%, 0%, 0)" : "inset 0 -2px 0 hsla(0, 0%, 100%, .055), inset 0 2px 2px hsla(0, 0%, 0%, 0.1)"
|
|
32
|
+
// boxShadow: isSelected ? "inset 0 0px 0 hsla(0, 0%, 0%, 0)" : "inset 0 -2px 0 hsla(0, 0%, 100%, .15)",
|
|
33
|
+
// config: {
|
|
34
|
+
// ...config.molasses,
|
|
35
|
+
// }
|
|
36
|
+
}), t = u({
|
|
37
|
+
// scale: isSelected ? 1 : 0.9,
|
|
38
|
+
fontWeight: o ? 500 : 300
|
|
39
|
+
});
|
|
40
|
+
return /* @__PURE__ */ i(
|
|
41
|
+
y,
|
|
42
|
+
{
|
|
43
|
+
style: { ...r, cursor: "pointer" },
|
|
44
|
+
paddingTop: l.Size1,
|
|
45
|
+
paddingBottom: l.Size1,
|
|
46
|
+
paddingLeft: l.Size2,
|
|
47
|
+
paddingRight: l.Size2,
|
|
48
|
+
borderTopLeftRadius: h,
|
|
49
|
+
borderTopRightRadius: S,
|
|
50
|
+
borderBottomLeftRadius: n,
|
|
51
|
+
borderBottomRightRadius: g,
|
|
52
|
+
onClick: () => c(s),
|
|
53
|
+
children: /* @__PURE__ */ i(y, { style: t, children: /* @__PURE__ */ i(
|
|
54
|
+
L,
|
|
55
|
+
{
|
|
56
|
+
style: {
|
|
57
|
+
color: "inherit",
|
|
58
|
+
transform: "translateY(-1px)",
|
|
59
|
+
display: "inline-block"
|
|
60
|
+
},
|
|
61
|
+
children: e
|
|
62
|
+
}
|
|
63
|
+
) })
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}, j = ({
|
|
67
|
+
options: e = [],
|
|
68
|
+
// id, value, text
|
|
69
|
+
valueIndex: s = 0,
|
|
70
|
+
id: c,
|
|
71
|
+
setInput: o,
|
|
72
|
+
setSelect: a,
|
|
73
|
+
insetColor: h
|
|
74
|
+
}) => {
|
|
75
|
+
const [S, n] = z(s);
|
|
76
|
+
C(() => {
|
|
77
|
+
typeof s == "number" && n(s);
|
|
78
|
+
}, [s]);
|
|
79
|
+
const g = (r) => {
|
|
80
|
+
n(r), o && o((t) => ({
|
|
81
|
+
...t,
|
|
82
|
+
[c]: e[r]
|
|
83
|
+
})), a && a(e[r]);
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ i(R, { display: x.Flex, flexAlignItem: b.Center, children: e.map((r, t) => /* @__PURE__ */ i(
|
|
86
|
+
I,
|
|
87
|
+
{
|
|
88
|
+
text: r.text,
|
|
89
|
+
value: r.value,
|
|
90
|
+
idx: t,
|
|
91
|
+
id: r.id,
|
|
92
|
+
handleSelectInset: g,
|
|
93
|
+
isSelected: t === S,
|
|
94
|
+
insetColor: h,
|
|
95
|
+
borderTopLeftRadius: t === 0 ? p.Size4 : void 0,
|
|
96
|
+
borderTopRightRadius: t === e.length - 1 ? p.Size4 : void 0,
|
|
97
|
+
borderBottomLeftRadius: t === 0 ? p.Size4 : void 0,
|
|
98
|
+
borderBottomRightRadius: t === e.length - 1 ? p.Size4 : void 0
|
|
99
|
+
},
|
|
100
|
+
t
|
|
101
|
+
)) });
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
j as InsetGroup
|
|
105
|
+
};
|