@devup-ui/components 0.1.2 → 0.1.5
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/components/Input/index.cjs +1 -1
- package/dist/components/Input/index.d.ts +3 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +59 -57
- package/dist/components/Select/IconArrow.d.ts +3 -0
- package/dist/components/Select/IconArrow.d.ts.map +1 -0
- package/dist/components/Select/IconCheck.d.ts +3 -0
- package/dist/components/Select/IconCheck.d.ts.map +1 -0
- package/dist/components/Select/Select.stories.d.ts +9 -0
- package/dist/components/Select/Select.stories.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +51 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Stepper/IconMinus.d.ts +3 -0
- package/dist/components/Stepper/IconMinus.d.ts.map +1 -0
- package/dist/components/Stepper/IconPlus.d.ts +3 -0
- package/dist/components/Stepper/IconPlus.d.ts.map +1 -0
- package/dist/components/Stepper/Stepper.stories.d.ts +7 -0
- package/dist/components/Stepper/Stepper.stories.d.ts.map +1 -0
- package/dist/components/Stepper/index.cjs +2 -0
- package/dist/components/Stepper/index.d.ts +28 -0
- package/dist/components/Stepper/index.d.ts.map +1 -0
- package/dist/components/Stepper/index.js +33 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@devup-ui/react"),C=require("react");function S({defaultValue:n,value:k,onChange:a,typography:F,error:o=!1,errorMessage:b,allowClear:x=!0,icon:d,colors:t,disabled:u,className:B,classNames:r,ref:y,onClear:p,...D}){const[g,h]=C.useState(n||""),E=l=>{h(l.target.value),a==null||a(l)},j=()=>{h(""),p==null||p()},f=g&&!u&&x;return e.jsxs(i.Box,{className:r==null?void 0:r.container,display:"inline-block",pos:"relative",selectors:{"&, & *":{boxSizing:"border-box"}},children:[d&&e.jsx(i.Center,{"aria-label":"icon",boxSize:"24px",className:r==null?void 0:r.icon,color:u?"var(--inputDisabledText, light-dark(#D6D7DE, #373737))":"var(--iconBold, light-dark(#8D8C9A, #666577))",left:"12px",pos:"absolute",styleOrder:1,top:"50%",transform:"translateY(-50%)",children:d}),e.jsx(i.Input,{ref:y,_disabled:{_placeholder:{color:"var(--inputDisabledText, light-dark(#D6D7DE, #373737))"},bg:"var(--inputDisabledBg, light-dark(#F0F0F3, #414244))",border:"1px solid var(--border, light-dark(#E4E4E4, #434343))",color:"var(--inputDisabledText, light-dark(#D6D7DE, #373737))"},_focus:{bg:"var(--primaryBg, light-dark(#F4F3FA, #F4F3FA0D))",border:"1px solid var(--primary, light-dark(#674DC7, #8163E1))",outline:"none"},_hover:{border:"1px solid var(--primary, light-dark(#674DC7, #8163E1))"},_placeholder:{color:"var(--inputPlaceholder, light-dark(#A9A8AB, #CBCBCB))"},"aria-label":"input",bg:"var(--inputBg, light-dark(#FFFFFF, #2E2E2E))",borderColor:o?"var(--error, light-dark(#D52B2E, #FF5B5E))":"var(--border, light-dark(#E4E4E4, #434343))",borderRadius:"8px",borderStyle:"solid",borderWidth:"1px",className:`${B||""} ${(r==null?void 0:r.input)||""}`.trim(),disabled:u,onChange:E,pl:d?"36px":"12px",pr:x?"36px":"12px",py:"12px",styleOrder:1,styleVars:{primary:t==null?void 0:t.primary,error:t==null?void 0:t.error,text:t==null?void 0:t.text,base:t==null?void 0:t.base,iconBold:t==null?void 0:t.iconBold,border:t==null?void 0:t.border,inputBackground:t==null?void 0:t.inputBackground,primaryFocus:t==null?void 0:t.primaryFocus,negative20:t==null?void 0:t.negative20},transition:"all 0.1s ease-in-out",typography:F,value:k??g,...D}),f&&e.jsx(v,{onClick:j}),b&&e.jsx(i.Text,{"aria-label":"error-message",bottom:"-8px",className:r==null?void 0:r.errorMessage,color:"var(--error, light-dark(#D52B2E, #FF5B5E))",left:"0",pos:"absolute",styleOrder:1,transform:"translateY(100%)",typography:"inputPlaceholder",children:b})]})}function v(n){return e.jsx(i.Button,{alignItems:"center","aria-label":"clear-button",bg:"var(--negative20, light-dark(#0003, #FFF6))",border:"none",borderRadius:"50%",boxSize:"20px",color:"var(--base, light-dark(#FFF, #000))",cursor:"pointer",display:"flex",justifyContent:"center",p:"2px",pos:"absolute",right:"12px",styleOrder:1,top:"50%",transform:"translateY(-50%)",...n,children:e.jsxs("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),e.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})})}exports.ClearButton=v;exports.Input=S;
|
|
@@ -7,10 +7,12 @@ interface InputProps extends Omit<ComponentProps<'input'>, 'type'> {
|
|
|
7
7
|
errorMessage?: string;
|
|
8
8
|
allowClear?: boolean;
|
|
9
9
|
classNames?: {
|
|
10
|
+
container?: string;
|
|
10
11
|
input?: string;
|
|
11
12
|
icon?: string;
|
|
12
13
|
errorMessage?: string;
|
|
13
14
|
};
|
|
15
|
+
onClear?: () => void;
|
|
14
16
|
colors?: {
|
|
15
17
|
primary?: string;
|
|
16
18
|
error?: string;
|
|
@@ -24,7 +26,7 @@ interface InputProps extends Omit<ComponentProps<'input'>, 'type'> {
|
|
|
24
26
|
};
|
|
25
27
|
icon?: React.ReactNode;
|
|
26
28
|
}
|
|
27
|
-
export declare function Input({ defaultValue, value: valueProp, onChange: onChangeProp, typography, error, errorMessage, allowClear, icon, colors, disabled, className, classNames, ref, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function Input({ defaultValue, value: valueProp, onChange: onChangeProp, typography, error, errorMessage, allowClear, icon, colors, disabled, className, classNames, ref, onClear, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
28
30
|
export declare function ClearButton(props: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
29
31
|
export {};
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,EAGrB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAY,MAAM,OAAO,CAAA;AAEhD,UAAU,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,MAAM,oBAAoB,CAAA;IACvC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,YAAY,CAAC,EAAE,MAAM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E,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,wBAAgB,KAAK,CAAC,EACpB,YAAY,EACZ,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,UAAU,EACV,KAAa,EACb,YAAY,EACZ,UAAiB,EACjB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,EACV,GAAG,EACH,OAAO,EACP,GAAG,KAAK,EACT,EAAE,UAAU,2CA8GZ;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CA6C1D"}
|
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useState as
|
|
5
|
-
function
|
|
2
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Box as C, Center as m, Input as A, Text as L, Button as j } from "@devup-ui/react";
|
|
4
|
+
import { useState as w } from "react";
|
|
5
|
+
function T({
|
|
6
6
|
defaultValue: i,
|
|
7
|
-
value:
|
|
8
|
-
onChange:
|
|
9
|
-
typography:
|
|
10
|
-
error:
|
|
11
|
-
errorMessage:
|
|
12
|
-
allowClear:
|
|
13
|
-
icon:
|
|
14
|
-
colors:
|
|
7
|
+
value: k,
|
|
8
|
+
onChange: n,
|
|
9
|
+
typography: v,
|
|
10
|
+
error: F = !1,
|
|
11
|
+
errorMessage: u,
|
|
12
|
+
allowClear: b = !0,
|
|
13
|
+
icon: a,
|
|
14
|
+
colors: t,
|
|
15
15
|
disabled: d,
|
|
16
16
|
className: o,
|
|
17
|
-
classNames:
|
|
18
|
-
ref:
|
|
19
|
-
|
|
17
|
+
classNames: r,
|
|
18
|
+
ref: B,
|
|
19
|
+
onClear: p,
|
|
20
|
+
...y
|
|
20
21
|
}) {
|
|
21
|
-
const [
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
22
|
+
const [h, g] = w(i || ""), D = (l) => {
|
|
23
|
+
g(l.target.value), n == null || n(l);
|
|
24
|
+
}, E = () => {
|
|
25
|
+
g(""), p == null || p();
|
|
26
|
+
}, f = h && !d && b;
|
|
27
|
+
return /* @__PURE__ */ x(
|
|
28
|
+
C,
|
|
28
29
|
{
|
|
30
|
+
className: r == null ? void 0 : r.container,
|
|
29
31
|
display: "inline-block",
|
|
30
32
|
pos: "relative",
|
|
31
|
-
selectors: { "
|
|
33
|
+
selectors: { "&, & *": { boxSizing: "border-box" } },
|
|
32
34
|
children: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
a && /* @__PURE__ */ e(
|
|
36
|
+
m,
|
|
35
37
|
{
|
|
36
38
|
"aria-label": "icon",
|
|
37
39
|
boxSize: "24px",
|
|
38
|
-
className:
|
|
40
|
+
className: r == null ? void 0 : r.icon,
|
|
39
41
|
color: d ? "var(--inputDisabledText, light-dark(#D6D7DE, #373737))" : "var(--iconBold, light-dark(#8D8C9A, #666577))",
|
|
40
42
|
left: "12px",
|
|
41
43
|
pos: "absolute",
|
|
42
44
|
styleOrder: 1,
|
|
43
45
|
top: "50%",
|
|
44
46
|
transform: "translateY(-50%)",
|
|
45
|
-
children:
|
|
47
|
+
children: a
|
|
46
48
|
}
|
|
47
49
|
),
|
|
48
50
|
/* @__PURE__ */ e(
|
|
49
|
-
|
|
51
|
+
A,
|
|
50
52
|
{
|
|
51
|
-
ref:
|
|
53
|
+
ref: B,
|
|
52
54
|
_disabled: {
|
|
53
55
|
_placeholder: {
|
|
54
56
|
color: "var(--inputDisabledText, light-dark(#D6D7DE, #373737))"
|
|
@@ -63,64 +65,64 @@ function O({
|
|
|
63
65
|
outline: "none"
|
|
64
66
|
},
|
|
65
67
|
_hover: {
|
|
66
|
-
border: "1px solid var(--primary, light-dark(
|
|
68
|
+
border: "1px solid var(--primary, light-dark(#674DC7, #8163E1))"
|
|
67
69
|
},
|
|
68
70
|
_placeholder: {
|
|
69
71
|
color: "var(--inputPlaceholder, light-dark(#A9A8AB, #CBCBCB))"
|
|
70
72
|
},
|
|
71
73
|
"aria-label": "input",
|
|
72
74
|
bg: "var(--inputBg, light-dark(#FFFFFF, #2E2E2E))",
|
|
73
|
-
borderColor:
|
|
75
|
+
borderColor: F ? "var(--error, light-dark(#D52B2E, #FF5B5E))" : "var(--border, light-dark(#E4E4E4, #434343))",
|
|
74
76
|
borderRadius: "8px",
|
|
75
77
|
borderStyle: "solid",
|
|
76
78
|
borderWidth: "1px",
|
|
77
|
-
className: `${o || ""} ${(
|
|
79
|
+
className: `${o || ""} ${(r == null ? void 0 : r.input) || ""}`.trim(),
|
|
78
80
|
disabled: d,
|
|
79
|
-
onChange:
|
|
80
|
-
pl:
|
|
81
|
-
pr:
|
|
81
|
+
onChange: D,
|
|
82
|
+
pl: a ? "36px" : "12px",
|
|
83
|
+
pr: b ? "36px" : "12px",
|
|
82
84
|
py: "12px",
|
|
83
85
|
styleOrder: 1,
|
|
84
86
|
styleVars: {
|
|
85
|
-
primary:
|
|
86
|
-
error:
|
|
87
|
-
text:
|
|
88
|
-
base:
|
|
89
|
-
iconBold:
|
|
90
|
-
border:
|
|
91
|
-
inputBackground:
|
|
92
|
-
primaryFocus:
|
|
93
|
-
negative20:
|
|
87
|
+
primary: t == null ? void 0 : t.primary,
|
|
88
|
+
error: t == null ? void 0 : t.error,
|
|
89
|
+
text: t == null ? void 0 : t.text,
|
|
90
|
+
base: t == null ? void 0 : t.base,
|
|
91
|
+
iconBold: t == null ? void 0 : t.iconBold,
|
|
92
|
+
border: t == null ? void 0 : t.border,
|
|
93
|
+
inputBackground: t == null ? void 0 : t.inputBackground,
|
|
94
|
+
primaryFocus: t == null ? void 0 : t.primaryFocus,
|
|
95
|
+
negative20: t == null ? void 0 : t.negative20
|
|
94
96
|
},
|
|
95
97
|
transition: "all 0.1s ease-in-out",
|
|
96
|
-
typography:
|
|
97
|
-
value:
|
|
98
|
-
...
|
|
98
|
+
typography: v,
|
|
99
|
+
value: k ?? h,
|
|
100
|
+
...y
|
|
99
101
|
}
|
|
100
102
|
),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
f && /* @__PURE__ */ e(S, { onClick: E }),
|
|
104
|
+
u && /* @__PURE__ */ e(
|
|
105
|
+
L,
|
|
104
106
|
{
|
|
105
107
|
"aria-label": "error-message",
|
|
106
108
|
bottom: "-8px",
|
|
107
|
-
className:
|
|
109
|
+
className: r == null ? void 0 : r.errorMessage,
|
|
108
110
|
color: "var(--error, light-dark(#D52B2E, #FF5B5E))",
|
|
109
111
|
left: "0",
|
|
110
112
|
pos: "absolute",
|
|
111
113
|
styleOrder: 1,
|
|
112
114
|
transform: "translateY(100%)",
|
|
113
115
|
typography: "inputPlaceholder",
|
|
114
|
-
children:
|
|
116
|
+
children: u
|
|
115
117
|
}
|
|
116
118
|
)
|
|
117
119
|
]
|
|
118
120
|
}
|
|
119
121
|
);
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function S(i) {
|
|
122
124
|
return /* @__PURE__ */ e(
|
|
123
|
-
|
|
125
|
+
j,
|
|
124
126
|
{
|
|
125
127
|
alignItems: "center",
|
|
126
128
|
"aria-label": "clear-button",
|
|
@@ -139,7 +141,7 @@ function w(i) {
|
|
|
139
141
|
top: "50%",
|
|
140
142
|
transform: "translateY(-50%)",
|
|
141
143
|
...i,
|
|
142
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ x(
|
|
143
145
|
"svg",
|
|
144
146
|
{
|
|
145
147
|
fill: "none",
|
|
@@ -175,6 +177,6 @@ function w(i) {
|
|
|
175
177
|
);
|
|
176
178
|
}
|
|
177
179
|
export {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
S as ClearButton,
|
|
181
|
+
T as Input
|
|
180
182
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconArrow.d.ts","sourceRoot":"","sources":["../../../src/components/Select/IconArrow.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAmBvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconCheck.d.ts","sourceRoot":"","sources":["../../../src/components/Select/IconCheck.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtC,wBAAgB,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAmB5D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Select } from '.';
|
|
3
|
+
export type Story = StoryObj<typeof meta>;
|
|
4
|
+
declare const meta: Meta<typeof Select>;
|
|
5
|
+
export declare const DefaultStory: Story;
|
|
6
|
+
export declare const ControlledRadioStory: Story;
|
|
7
|
+
export declare const ControlledCheckboxStory: Story;
|
|
8
|
+
export default meta;
|
|
9
|
+
//# sourceMappingURL=Select.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGtD,OAAO,EACL,MAAM,EAKP,MAAM,GAAG,CAAA;AAGV,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAGzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAU7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAGlC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAGrC,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DevupThemeTypography } from '@devup-ui/react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
type SelectType = 'default' | 'radio' | 'checkbox';
|
|
5
|
+
type SelectValue<T extends SelectType> = T extends 'radio' ? string : string[];
|
|
6
|
+
export declare const useSelect: () => {
|
|
7
|
+
open: boolean;
|
|
8
|
+
setOpen: (open: boolean) => void;
|
|
9
|
+
value: SelectValue<SelectType>;
|
|
10
|
+
setValue: (value: string) => void;
|
|
11
|
+
type: SelectType;
|
|
12
|
+
};
|
|
13
|
+
interface SelectProps extends ComponentProps<'div'> {
|
|
14
|
+
defaultValue?: SelectValue<SelectType>;
|
|
15
|
+
value?: SelectValue<SelectType>;
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
onOpenChange?: (open: boolean) => void;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
type?: SelectType;
|
|
22
|
+
colors?: {
|
|
23
|
+
primary?: string;
|
|
24
|
+
border?: string;
|
|
25
|
+
inputBackground?: string;
|
|
26
|
+
base10?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
selectDisabled?: string;
|
|
29
|
+
primaryBg?: string;
|
|
30
|
+
};
|
|
31
|
+
typography?: keyof DevupThemeTypography;
|
|
32
|
+
}
|
|
33
|
+
export declare function Select({ type, children, defaultValue, value: valueProp, onValueChange, defaultOpen, open: openProp, onOpenChange, colors, typography, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
interface SelectTriggerProps extends ComponentProps<typeof Button> {
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function SelectTrigger({ className, children, asChild, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
interface SelectContainerProps extends ComponentProps<'div'> {
|
|
39
|
+
showConfirmButton?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function SelectContainer({ children, showConfirmButton, ...props }: SelectContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
42
|
+
interface SelectOptionProps extends Omit<ComponentProps<'div'>, 'onClick'> {
|
|
43
|
+
onClick?: (value: string | undefined, e?: React.MouseEvent<HTMLDivElement>) => void;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
value?: string;
|
|
46
|
+
showCheck?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare function SelectOption({ disabled, onClick, children, value, showCheck, ...props }: SelectOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function SelectDivider({ ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,oBAAoB,EAAgB,MAAM,iBAAiB,CAAA;AAE9E,OAAO,EAEL,cAAc,EASf,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAGlC,KAAK,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAA;AAClD,KAAK,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAU9E,eAAO,MAAM,SAAS;U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AACD,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAqCpB;AAED,UAAU,oBAAqB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AACD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,oBAAoB,kDA8CtB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IACxE,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KACjC,IAAI,CAAA;IACT,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAmHnB;AAED,wBAAgB,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAUhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconMinus.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/IconMinus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,wBAAgB,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,2CAkB9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconPlus.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/IconPlus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,wBAAgB,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,2CAgB7D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Stepper } from './index';
|
|
3
|
+
type Story = StoryObj<typeof meta>;
|
|
4
|
+
declare const meta: Meta<typeof Stepper>;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export default meta;
|
|
7
|
+
//# sourceMappingURL=Stepper.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Stepper.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EACL,OAAO,EAKR,MAAM,SAAS,CAAA;AAEhB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAGlC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAU9B,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime");require("@devup-ui/react");require("clsx");const n=require("react"),S=n.createContext(null);function d({children:a,defaultValue:s,value:i,onValueChange:e,min:t=0,max:r=100}){const[o,c]=n.useState(s??0),l=p=>{const u=Math.min(Math.max(p,t),r);if(e){e(u);return}c(u)};return v.jsx(S.Provider,{value:{value:i??o,setValue:l,min:t,max:r},children:a})}exports.Stepper=d;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '../Button';
|
|
3
|
+
import { Input } from '../Input';
|
|
4
|
+
type StepperContextType = {
|
|
5
|
+
value: number;
|
|
6
|
+
setValue: (value: number) => void;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const useStepper: () => StepperContextType;
|
|
11
|
+
type StepperProps = {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
defaultValue?: number;
|
|
14
|
+
value?: number;
|
|
15
|
+
onValueChange?: (value: number) => void;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
};
|
|
19
|
+
declare function Stepper({ children, defaultValue, value: valueProp, onValueChange, min, max, }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function StepperContainer(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function StepperDecreaseButton({ ...props }: ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function StepperIncreaseButton({ ...props }: ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface StepperInputProps extends ComponentProps<typeof Input> {
|
|
24
|
+
editable?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare function StepperInput({ editable, className, ...props }: StepperInputProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { Stepper, StepperContainer, StepperDecreaseButton, StepperIncreaseButton, StepperInput, };
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAuC,MAAM,OAAO,CAAA;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAIhC,KAAK,kBAAkB,GAAG;IACxB,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jsx-runtime";
|
|
3
|
+
import "@devup-ui/react";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import { useState as m, createContext as v } from "react";
|
|
6
|
+
const f = v(null);
|
|
7
|
+
function C({
|
|
8
|
+
children: n,
|
|
9
|
+
defaultValue: a,
|
|
10
|
+
value: u,
|
|
11
|
+
onValueChange: t,
|
|
12
|
+
min: e = 0,
|
|
13
|
+
max: r = 100
|
|
14
|
+
}) {
|
|
15
|
+
const [i, p] = m(a ?? 0), s = (l) => {
|
|
16
|
+
const o = Math.min(Math.max(l, e), r);
|
|
17
|
+
if (t) {
|
|
18
|
+
t(o);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
p(o);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ c(
|
|
24
|
+
f.Provider,
|
|
25
|
+
{
|
|
26
|
+
value: { value: u ?? i, setValue: s, min: e, max: r },
|
|
27
|
+
children: n
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
C as Stepper
|
|
33
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/Button/index.cjs"),t=require("./components/Input/index.cjs"),n=require("./components/Stepper/index.cjs");exports.Button=e.Button;exports.Input=t.Input;exports.Stepper=n.Stepper;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Button as
|
|
1
|
+
import { Button as t } from "./components/Button/index.js";
|
|
2
2
|
import { Input as e } from "./components/Input/index.js";
|
|
3
|
+
import { Stepper as m } from "./components/Stepper/index.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
e as Input
|
|
5
|
+
t as Button,
|
|
6
|
+
e as Input,
|
|
7
|
+
m as Stepper
|
|
6
8
|
};
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"css-in-js-framework",
|
|
17
17
|
"react"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.5",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
50
50
|
"storybook": "^9.1.1",
|
|
51
51
|
"typescript": "^5.9.2",
|
|
52
|
-
"vite": "^7.
|
|
52
|
+
"vite": "^7.1.1",
|
|
53
53
|
"vite-plugin-dts": "^4.5.4",
|
|
54
54
|
"vitest": "^3.2.4",
|
|
55
|
-
"@devup-ui/vite-plugin": "1.0.
|
|
55
|
+
"@devup-ui/vite-plugin": "1.0.27"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"csstype": "*",
|