@devup-ui/components 0.1.42 → 0.1.44
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/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/Button/IconSpinner.cjs +1 -1
- package/dist/components/Button/IconSpinner.js +72 -84
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +220 -217
- package/dist/components/Checkbox/CheckIcon.cjs +1 -1
- package/dist/components/Checkbox/CheckIcon.js +17 -23
- package/dist/components/Checkbox/index.cjs +1 -2
- package/dist/components/Checkbox/index.js +87 -127
- package/dist/components/Input/index.cjs +1 -2
- package/dist/components/Input/index.js +130 -181
- package/dist/components/Radio/index.cjs +1 -1
- package/dist/components/Radio/index.js +143 -194
- package/dist/components/RadioGroup/index.cjs +1 -2
- package/dist/components/RadioGroup/index.js +43 -59
- package/dist/components/Select/IconCheck.cjs +1 -1
- package/dist/components/Select/IconCheck.js +18 -24
- package/dist/components/Select/index.cjs +1 -2
- package/dist/components/Select/index.js +215 -315
- package/dist/components/Stepper/IconMinus.cjs +1 -1
- package/dist/components/Stepper/IconMinus.js +18 -24
- package/dist/components/Stepper/IconPlus.cjs +1 -1
- package/dist/components/Stepper/IconPlus.js +17 -23
- package/dist/components/Stepper/index.cjs +1 -2
- package/dist/components/Stepper/index.js +98 -142
- package/dist/components/Textarea/index.cjs +1 -2
- package/dist/components/Textarea/index.js +85 -108
- package/dist/components/Toggle/index.cjs +1 -2
- package/dist/components/Toggle/index.js +71 -91
- package/dist/contexts/useSelect.cjs +1 -2
- package/dist/contexts/useSelect.js +9 -10
- package/dist/index.cjs +1 -1
- package/dist/index.js +11 -32
- package/package.json +11 -14
|
@@ -1,93 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { Box as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
filter: !e && "drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",
|
|
72
|
-
outline: "4px",
|
|
73
|
-
pos: "absolute",
|
|
74
|
-
style: m?.toggle,
|
|
75
|
-
styleVars: {
|
|
76
|
-
primary: r?.primary,
|
|
77
|
-
primaryHoverBg: r?.primaryHoverBg,
|
|
78
|
-
switchShadow: r?.switchShadow,
|
|
79
|
-
switchHoverOutline: r?.switchHoverOutline
|
|
80
|
-
},
|
|
81
|
-
top: !e && "-6px",
|
|
82
|
-
transform: a && "translateX(calc(100% + 2px))",
|
|
83
|
-
transition: ".25s"
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ i(w, { type: "hidden", value: String(a) })
|
|
89
|
-
] });
|
|
2
|
+
"use client";
|
|
3
|
+
import { Box as e, Input as t } from "@devup-ui/react";
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { useState as a } from "react";
|
|
6
|
+
//#region src/components/Toggle/index.tsx
|
|
7
|
+
function o({ defaultValue: o = null, value: s = null, onChange: c, disabled: l, className: u, style: d, variant: f = "default", colors: p, classNames: m, styles: h }) {
|
|
8
|
+
let [g, _] = a(s ?? o ?? !1), v = s ?? g;
|
|
9
|
+
function y(e) {
|
|
10
|
+
c?.(!e), _((e) => !e);
|
|
11
|
+
}
|
|
12
|
+
let b = f === "default";
|
|
13
|
+
return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(e, {
|
|
14
|
+
"aria-disabled": l,
|
|
15
|
+
bg: v ? "var(--primary)" : "var(--bg, light-dark(#E4E4E4, #383838))",
|
|
16
|
+
borderRadius: "500px",
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
className: u,
|
|
19
|
+
cursor: "pointer",
|
|
20
|
+
h: b ? "28px" : "8px",
|
|
21
|
+
justifyContent: v && "flex-end",
|
|
22
|
+
onClick: () => !l && y(v),
|
|
23
|
+
p: b && 1,
|
|
24
|
+
position: "relative",
|
|
25
|
+
role: "group",
|
|
26
|
+
selectors: {
|
|
27
|
+
"&[aria-disabled=true]": {
|
|
28
|
+
cursor: "not-allowed",
|
|
29
|
+
bg: "var(--disabledBg, light-dark(#D6D7DE, #373737))"
|
|
30
|
+
},
|
|
31
|
+
"&:hover:not([aria-disabled=true]):not(:disabled)": { bg: v ? "var(--primaryHoverBg, light-dark(color-mix(in srgb, var(--primary) 100%, #000 15%), color-mix(in srgb, var(--primary) 100%, #FFF 15%)))" : "var(--hoverBg, light-dark(#C3C2C8, #696A6F))" }
|
|
32
|
+
},
|
|
33
|
+
style: d,
|
|
34
|
+
styleVars: {
|
|
35
|
+
primary: p?.primary,
|
|
36
|
+
bg: p?.bg,
|
|
37
|
+
primaryHoverBg: p?.primaryHoverBg,
|
|
38
|
+
hoverBg: p?.hoverBg,
|
|
39
|
+
disabledBg: p?.disabledBg
|
|
40
|
+
},
|
|
41
|
+
"test-id": "toggle-wrapper",
|
|
42
|
+
transition: ".25s",
|
|
43
|
+
w: b ? "50px" : "40px",
|
|
44
|
+
children: /* @__PURE__ */ r(e, {
|
|
45
|
+
_groupHover: !b && {
|
|
46
|
+
outline: "4px solid",
|
|
47
|
+
outlineColor: "var(--switchHoverOutline, light-dark(color-mix(in srgb, var(--primary) 20%, transparent), color-mix(in srgb, var(--primary) 50%, transparent)))"
|
|
48
|
+
},
|
|
49
|
+
backgroundColor: "#fff",
|
|
50
|
+
borderRadius: "100%",
|
|
51
|
+
boxSize: "20px",
|
|
52
|
+
className: m?.toggle,
|
|
53
|
+
filter: !b && "drop-shadow(0px 0px 3px var(--switchShadow, rgba(0, 0, 0, 0.10)));",
|
|
54
|
+
outline: "4px",
|
|
55
|
+
pos: "absolute",
|
|
56
|
+
style: h?.toggle,
|
|
57
|
+
styleVars: {
|
|
58
|
+
primary: p?.primary,
|
|
59
|
+
primaryHoverBg: p?.primaryHoverBg,
|
|
60
|
+
switchShadow: p?.switchShadow,
|
|
61
|
+
switchHoverOutline: p?.switchHoverOutline
|
|
62
|
+
},
|
|
63
|
+
top: !b && "-6px",
|
|
64
|
+
transform: v && "translateX(calc(100% + 2px))",
|
|
65
|
+
transition: ".25s"
|
|
66
|
+
})
|
|
67
|
+
}), /* @__PURE__ */ r(t, {
|
|
68
|
+
type: "hidden",
|
|
69
|
+
value: String(v)
|
|
70
|
+
})] });
|
|
90
71
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { o as Toggle };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),c=t.createContext(null),n=()=>{const e=t.useContext(c);if(!e)throw new Error("useSelect must be used within a Select");return e};exports.SelectContext=c;exports.useSelect=n;
|
|
1
|
+
"use client";"use client";require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`react`);var t=(0,e.createContext)(null),n=()=>{let n=(0,e.useContext)(t);if(!n)throw Error(`useSelect must be used within a Select`);return n};exports.SelectContext=t,exports.useSelect=n;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
n as SelectContext,
|
|
11
|
-
c as useSelect
|
|
2
|
+
"use client";
|
|
3
|
+
import { createContext as e, useContext as t } from "react";
|
|
4
|
+
//#region src/contexts/useSelect.ts
|
|
5
|
+
var n = e(null), r = () => {
|
|
6
|
+
let e = t(n);
|
|
7
|
+
if (!e) throw Error("useSelect must be used within a Select");
|
|
8
|
+
return e;
|
|
12
9
|
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as SelectContext, r as useSelect };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components/Button/index.cjs`),t=require(`./components/Checkbox/index.cjs`),n=require(`./components/Input/index.cjs`),r=require(`./components/Radio/index.cjs`),i=require(`./components/RadioGroup/index.cjs`),a=require(`./contexts/useSelect.cjs`),o=require(`./components/Select/index.cjs`),s=require(`./components/Stepper/index.cjs`),c=require(`./components/Textarea/index.cjs`),l=require(`./components/Toggle/index.cjs`);exports.Button=e.Button,exports.Checkbox=t.Checkbox,exports.Input=n.Input,exports.Radio=r.Radio,exports.RadioGroup=i.RadioGroup,exports.Select=o.Select,exports.SelectContainer=o.SelectContainer,exports.SelectContext=a.SelectContext,exports.SelectDivider=o.SelectDivider,exports.SelectOption=o.SelectOption,exports.SelectTrigger=o.SelectTrigger,exports.Stepper=s.Stepper,exports.StepperContainer=s.StepperContainer,exports.StepperDecreaseButton=s.StepperDecreaseButton,exports.StepperIncreaseButton=s.StepperIncreaseButton,exports.StepperInput=s.StepperInput,exports.Textarea=c.Textarea,exports.Toggle=l.Toggle,exports.useSelect=a.useSelect,exports.useStepper=s.useStepper;
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Checkbox as
|
|
3
|
-
import { Input as
|
|
4
|
-
import { Radio as
|
|
5
|
-
import { RadioGroup as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export {
|
|
12
|
-
r as Button,
|
|
13
|
-
p as Checkbox,
|
|
14
|
-
S as Input,
|
|
15
|
-
c as Radio,
|
|
16
|
-
m as RadioGroup,
|
|
17
|
-
i as Select,
|
|
18
|
-
l as SelectContainer,
|
|
19
|
-
O as SelectContext,
|
|
20
|
-
u as SelectDivider,
|
|
21
|
-
g as SelectOption,
|
|
22
|
-
s as SelectTrigger,
|
|
23
|
-
d as Stepper,
|
|
24
|
-
B as StepperContainer,
|
|
25
|
-
I as StepperDecreaseButton,
|
|
26
|
-
T as StepperIncreaseButton,
|
|
27
|
-
D as StepperInput,
|
|
28
|
-
h as Textarea,
|
|
29
|
-
v as Toggle,
|
|
30
|
-
j as useSelect,
|
|
31
|
-
R as useStepper
|
|
32
|
-
};
|
|
1
|
+
import { Button as e } from "./components/Button/index.js";
|
|
2
|
+
import { Checkbox as t } from "./components/Checkbox/index.js";
|
|
3
|
+
import { Input as n } from "./components/Input/index.js";
|
|
4
|
+
import { Radio as r } from "./components/Radio/index.js";
|
|
5
|
+
import { RadioGroup as i } from "./components/RadioGroup/index.js";
|
|
6
|
+
import { SelectContext as a, useSelect as o } from "./contexts/useSelect.js";
|
|
7
|
+
import { Select as s, SelectContainer as c, SelectDivider as l, SelectOption as u, SelectTrigger as d } from "./components/Select/index.js";
|
|
8
|
+
import { Stepper as f, StepperContainer as p, StepperDecreaseButton as m, StepperIncreaseButton as h, StepperInput as g, useStepper as _ } from "./components/Stepper/index.js";
|
|
9
|
+
import { Textarea as v } from "./components/Textarea/index.js";
|
|
10
|
+
import { Toggle as y } from "./components/Toggle/index.js";
|
|
11
|
+
export { e as Button, t as Checkbox, n as Input, r as Radio, i as RadioGroup, s as Select, c as SelectContainer, a as SelectContext, l as SelectDivider, u as SelectOption, d as SelectTrigger, f as Stepper, p as StepperContainer, m as StepperDecreaseButton, h as StepperIncreaseButton, g as StepperInput, v as Textarea, y as Toggle, o as useSelect, _ as useStepper };
|
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.44",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint",
|
|
@@ -43,28 +43,25 @@
|
|
|
43
43
|
],
|
|
44
44
|
"types": "./dist/index.d.ts",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@devup-ui/react": "^1.0.
|
|
47
|
-
"csstype-extra": "latest",
|
|
46
|
+
"@devup-ui/react": "^1.0.35",
|
|
48
47
|
"react": "^19.2.4",
|
|
49
|
-
"react-dom": "^19.2.4",
|
|
50
48
|
"clsx": "^2.1"
|
|
51
49
|
},
|
|
52
50
|
"devDependencies": {
|
|
53
|
-
"@devup-ui/vite-plugin": "^1.0.
|
|
54
|
-
"@storybook/addon-docs": "^10.
|
|
55
|
-
"@storybook/addon-onboarding": "^10.
|
|
56
|
-
"@storybook/react-vite": "^10.
|
|
51
|
+
"@devup-ui/vite-plugin": "^1.0.58",
|
|
52
|
+
"@storybook/addon-docs": "^10.3",
|
|
53
|
+
"@storybook/addon-onboarding": "^10.3",
|
|
54
|
+
"@storybook/react-vite": "^10.3",
|
|
57
55
|
"@types/react": "^19.2",
|
|
58
|
-
"eslint-plugin-storybook": "^10.
|
|
56
|
+
"eslint-plugin-storybook": "^10.3",
|
|
59
57
|
"rollup-plugin-preserve-directives": "^0.4",
|
|
60
|
-
"storybook": "^10.
|
|
61
|
-
"typescript": "^
|
|
62
|
-
"vite": "^
|
|
58
|
+
"storybook": "^10.3",
|
|
59
|
+
"typescript": "^6.0",
|
|
60
|
+
"vite": "^8.0",
|
|
63
61
|
"vite-plugin-dts": "^4.5"
|
|
64
62
|
},
|
|
65
63
|
"peerDependencies": {
|
|
66
|
-
"@devup-ui/react": "^1.0.
|
|
67
|
-
"csstype-extra": "*",
|
|
64
|
+
"@devup-ui/react": "^1.0.35",
|
|
68
65
|
"react": "*"
|
|
69
66
|
}
|
|
70
67
|
}
|