@companix/uikit 0.0.36 → 0.0.38
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/Avatar.scss +64 -0
- package/dist/Avatar/helpers.d.ts +10 -0
- package/dist/Avatar/index.d.ts +8 -0
- package/dist/Avatar/types.d.ts +2 -0
- package/dist/Button/Button.scss +128 -0
- package/dist/Button/index.d.ts +21 -0
- package/dist/ButtonGroup/ButtonGroup.scss +18 -0
- package/dist/ButtonGroup/index.d.ts +6 -0
- package/dist/Calendar/Calendar.d.ts +14 -0
- package/dist/Calendar/Calendar.scss +125 -0
- package/dist/Calendar/CalendarHeader.d.ts +10 -0
- package/dist/Checkbox/Checkbox.scss +115 -0
- package/dist/Checkbox/index.d.ts +10 -0
- package/dist/Countdown/index.d.ts +6 -0
- package/dist/DateInput/DateInput.scss +11 -0
- package/dist/DateInput/index.d.ts +13 -0
- package/dist/DatePicker/index.d.ts +9 -0
- package/dist/Dialog/Dialog.scss +25 -0
- package/dist/Dialog/Popup.scss +55 -0
- package/dist/Dialog/index.d.ts +16 -0
- package/dist/DialogAlert/Alert.d.ts +19 -0
- package/dist/DialogAlert/Alert.scss +52 -0
- package/dist/DialogAlert/Viewport.d.ts +8 -0
- package/dist/DialogAlert/index.d.ts +11 -0
- package/dist/Drawer/Drawer.scss +112 -0
- package/dist/Drawer/index.d.ts +13 -0
- package/dist/File/index.d.ts +10 -0
- package/dist/FormGroup/FormGroup.scss +32 -0
- package/dist/FormGroup/index.d.ts +9 -0
- package/dist/Icon/icon.scss +18 -0
- package/dist/Icon/index.d.ts +7 -0
- package/dist/Input/Form.scss +67 -0
- package/dist/Input/InlineInput.d.ts +0 -0
- package/dist/Input/Input.d.ts +14 -0
- package/dist/Input/Input.scss +47 -0
- package/dist/Input/InputContainer.d.ts +11 -0
- package/dist/Input/InputElement.d.ts +9 -0
- package/dist/LoadingButton/index.d.ts +5 -0
- package/dist/NumberInput/index.d.ts +23 -0
- package/dist/OptionItem/Option.scss +89 -0
- package/dist/OptionItem/OptionItem.d.ts +6 -0
- package/dist/OptionItem/OptionsList.d.ts +7 -0
- package/dist/Popover/Popover.scss +80 -0
- package/dist/Popover/index.d.ts +27 -0
- package/dist/Progress/Progress.scss +47 -0
- package/dist/Progress/index.d.ts +5 -0
- package/dist/Radio/Radio.scss +148 -0
- package/dist/Radio/index.d.ts +20 -0
- package/dist/Scrollable/ImitateScroll.d.ts +10 -0
- package/dist/Scrollable/Scrollable.scss +50 -0
- package/dist/Scrollable/index.d.ts +33 -0
- package/dist/Segments/Segments.scss +57 -0
- package/dist/Segments/index.d.ts +11 -0
- package/dist/Select/Select.scss +80 -0
- package/dist/Select/SelectInput.d.ts +15 -0
- package/dist/Select/SelectOptions.d.ts +12 -0
- package/dist/Select/SelectRight.d.ts +8 -0
- package/dist/Select/index.d.ts +24 -0
- package/dist/SelectTags/SelectTags.scss +67 -0
- package/dist/SelectTags/index.d.ts +17 -0
- package/dist/Spinner/Spinner.scss +14 -0
- package/dist/Spinner/index.d.ts +7 -0
- package/dist/Switch/Switch.scss +102 -0
- package/dist/Switch/index.d.ts +10 -0
- package/dist/Tabs/Tabs.scss +58 -0
- package/dist/Tabs/index.d.ts +13 -0
- package/dist/TextArea/TextArea.scss +34 -0
- package/dist/TextArea/index.d.ts +7 -0
- package/dist/ThemeProvider/helpers.d.ts +4 -0
- package/dist/ThemeProvider/index.d.ts +12 -0
- package/dist/ThemeProvider/script.d.ts +8 -0
- package/dist/ThemeProvider/types.d.ts +2 -0
- package/dist/TimePicker/index.d.ts +10 -0
- package/dist/Toaster/Toast.d.ts +15 -0
- package/dist/Toaster/Toaster.scss +155 -0
- package/dist/Toaster/Viewport.d.ts +13 -0
- package/dist/Toaster/index.d.ts +20 -0
- package/dist/Tooltip/Tooltip.scss +28 -0
- package/dist/Tooltip/index.d.ts +7 -0
- package/dist/__helpers/createDialogRegistry.d.ts +26 -0
- package/dist/__helpers/createPopoversRegistry.d.ts +19 -0
- package/dist/__hooks/use-frooze-closing.d.ts +5 -0
- package/dist/__hooks/use-input-padding.d.ts +5 -0
- package/dist/__hooks/use-loading.d.ts +8 -0
- package/dist/__hooks/use-local-storage.d.ts +1 -0
- package/dist/__hooks/use-popover-position.d.ts +8 -0
- package/dist/__hooks/use-previos.d.ts +2 -0
- package/dist/__hooks/use-resize.d.ts +3 -0
- package/dist/__hooks/use-scrollbox.d.ts +7 -0
- package/dist/__hooks/use-update.d.ts +1 -0
- package/dist/__hooks/useCalendar.d.ts +17 -0
- package/dist/__hooks/useCalendarOptions-copy.d.ts +22 -0
- package/dist/__hooks/useCalendarOptions.d.ts +31 -0
- package/dist/__libs/calendar.d.ts +25 -0
- package/dist/__utils/RemoveListener.d.ts +3 -0
- package/dist/__utils/utils.d.ts +39 -0
- package/dist/bundle.es.js +88 -0
- package/dist/bundle.es10.js +82 -0
- package/dist/bundle.es11.js +28 -0
- package/dist/bundle.es12.js +77 -0
- package/dist/bundle.es13.js +43 -0
- package/dist/bundle.es14.js +38 -0
- package/dist/bundle.es15.js +58 -0
- package/dist/bundle.es16.js +23 -0
- package/dist/bundle.es17.js +35 -0
- package/dist/bundle.es18.js +27 -0
- package/dist/bundle.es19.js +47 -0
- package/dist/bundle.es2.js +44 -0
- package/dist/bundle.es20.js +25 -0
- package/dist/bundle.es21.js +31 -0
- package/dist/bundle.es22.js +40 -0
- package/dist/bundle.es23.js +18 -0
- package/dist/bundle.es24.js +36 -0
- package/dist/bundle.es25.js +23 -0
- package/dist/bundle.es26.js +44 -0
- package/dist/bundle.es27.js +117 -0
- package/dist/bundle.es28.js +123 -0
- package/dist/bundle.es29.js +76 -0
- package/dist/bundle.es3.js +4 -0
- package/dist/bundle.es30.js +35 -0
- package/dist/bundle.es31.js +14 -0
- package/dist/bundle.es32.js +88 -0
- package/dist/bundle.es33.js +22 -0
- package/dist/bundle.es34.js +9 -0
- package/dist/bundle.es35.js +37 -0
- package/dist/bundle.es36.js +24 -0
- package/dist/bundle.es37.js +13 -0
- package/dist/bundle.es38.js +27 -0
- package/dist/bundle.es39.js +41 -0
- package/dist/bundle.es4.js +47 -0
- package/dist/bundle.es40.js +53 -0
- package/dist/bundle.es41.js +45 -0
- package/dist/bundle.es42.js +11 -0
- package/dist/bundle.es43.js +27 -0
- package/dist/bundle.es44.js +26 -0
- package/dist/bundle.es45.js +89 -0
- package/dist/bundle.es46.js +20 -0
- package/dist/bundle.es47.js +22 -0
- package/dist/bundle.es48.js +26 -0
- package/dist/bundle.es49.js +41 -0
- package/dist/bundle.es5.js +10 -0
- package/dist/bundle.es50.js +7 -0
- package/dist/bundle.es51.js +16 -0
- package/dist/bundle.es52.js +16 -0
- package/dist/bundle.es53.js +72 -0
- package/dist/bundle.es54.js +70 -0
- package/dist/bundle.es55.js +72 -0
- package/dist/bundle.es56.js +13 -0
- package/dist/bundle.es57.js +45 -0
- package/dist/bundle.es58.js +17 -0
- package/dist/bundle.es59.js +34 -0
- package/dist/bundle.es6.js +13 -0
- package/dist/bundle.es60.js +72 -0
- package/dist/bundle.es61.js +16 -0
- package/dist/bundle.es62.js +77 -0
- package/dist/bundle.es63.js +51 -0
- package/dist/bundle.es64.js +16 -0
- package/dist/bundle.es7.js +87 -0
- package/dist/bundle.es8.js +87 -0
- package/dist/bundle.es9.js +24 -0
- package/dist/css-properties.scss +120 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.scss +28 -0
- package/dist/mixins.scss +102 -0
- package/dist/theme.scss +101 -0
- package/dist/types.d.ts +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import S from "classnames";
|
|
3
|
+
import { forwardRef as I } from "react";
|
|
4
|
+
import { customCSS as r, px as i } from "@companix/utils-browser";
|
|
5
|
+
const $ = I((t, c) => {
|
|
6
|
+
let {
|
|
7
|
+
interactionKind: m = "static",
|
|
8
|
+
thumbPos: g = "center",
|
|
9
|
+
thumbPadding: l = 4,
|
|
10
|
+
heightAuto: s,
|
|
11
|
+
scrollX: h,
|
|
12
|
+
className: u,
|
|
13
|
+
scrollY: n,
|
|
14
|
+
onWheel: b,
|
|
15
|
+
maxHeight: d,
|
|
16
|
+
onScroll: f,
|
|
17
|
+
thumbColor: p,
|
|
18
|
+
children: w
|
|
19
|
+
} = t;
|
|
20
|
+
const x = (() => {
|
|
21
|
+
if (t.implementation === "edge") {
|
|
22
|
+
l = 0;
|
|
23
|
+
const { padding: o, scrollbarWidth: e } = t;
|
|
24
|
+
return {
|
|
25
|
+
...r({ "--scrollbar-width": i(e) }),
|
|
26
|
+
padding: `0px ${o - e}px 0px ${o}px`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (t.implementation === "outer") {
|
|
30
|
+
const { shadowPadding: o = 0, noneCorrect: e, scrollbarWidth: a } = t;
|
|
31
|
+
return window.IS_MOBILE ? {
|
|
32
|
+
padding: o,
|
|
33
|
+
margin: -o
|
|
34
|
+
} : {
|
|
35
|
+
...r({ "--scrollbar-width": i(a) }),
|
|
36
|
+
padding: o,
|
|
37
|
+
margin: -o,
|
|
38
|
+
marginRight: e ? void 0 : `calc(-${a}px - ${o}px)`,
|
|
39
|
+
marginBottom: 0
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (t.implementation === "inner") {
|
|
43
|
+
const { padding: o } = t;
|
|
44
|
+
return window.IS_MOBILE ? {
|
|
45
|
+
[n ? "paddingLeft" : "paddingTop"]: o,
|
|
46
|
+
[n ? "paddingRight" : "paddingBottom"]: o
|
|
47
|
+
} : {
|
|
48
|
+
[n ? "paddingLeft" : "paddingTop"]: o,
|
|
49
|
+
...r({ "--scrollbar-width": i(o) })
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {};
|
|
53
|
+
})();
|
|
54
|
+
return /* @__PURE__ */ v(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
ref: c,
|
|
58
|
+
onWheel: b,
|
|
59
|
+
onScroll: f,
|
|
60
|
+
onMouseDown: (o) => {
|
|
61
|
+
o.preventDefault();
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
...x,
|
|
65
|
+
...t.style,
|
|
66
|
+
maxHeight: d ? i(d) : void 0,
|
|
67
|
+
...r({ "--thumb-padding": i(l) }),
|
|
68
|
+
...r({ "--thumb-color": p ?? "#c1c2c8bd" })
|
|
69
|
+
},
|
|
70
|
+
className: S(
|
|
71
|
+
!window.IS_MOBILE && "scrollable",
|
|
72
|
+
u,
|
|
73
|
+
s ? "" : "h-full",
|
|
74
|
+
{
|
|
75
|
+
"overflow-y-scroll": n,
|
|
76
|
+
"overflow-x-scroll": h,
|
|
77
|
+
"scrollable-hover-interaction": m === "hover",
|
|
78
|
+
"scrollable-border-position": g === "border"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
children: w
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
$ as Scrollable
|
|
87
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs as x, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import L from "classnames";
|
|
3
|
+
import { useRef as d, useMemo as f, useCallback as n, useEffect as T, useLayoutEffect as H } from "react";
|
|
4
|
+
import { getContainers as p, pc as h, px as v } from "@companix/utils-browser";
|
|
5
|
+
const C = ({
|
|
6
|
+
children: b,
|
|
7
|
+
thumbClassName: y,
|
|
8
|
+
scrollableClassName: g,
|
|
9
|
+
thumbMargin: R = 0,
|
|
10
|
+
trackWidth: w = 20
|
|
11
|
+
}) => {
|
|
12
|
+
const l = d(null), t = d(null), r = f(() => ({ positons: { top: 0, y: 0 }, scrollRatio: 0 }), []), i = f(() => ({
|
|
13
|
+
start() {
|
|
14
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", m);
|
|
15
|
+
},
|
|
16
|
+
clear() {
|
|
17
|
+
document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", m);
|
|
18
|
+
}
|
|
19
|
+
}), []);
|
|
20
|
+
T(() => {
|
|
21
|
+
const o = new ResizeObserver(u);
|
|
22
|
+
return t.current && p(t.current, (e) => {
|
|
23
|
+
o.observe(e);
|
|
24
|
+
}), () => {
|
|
25
|
+
t.current && p(t.current, (e) => {
|
|
26
|
+
o.unobserve(e);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}, []), H(() => {
|
|
30
|
+
u();
|
|
31
|
+
}, []);
|
|
32
|
+
const u = n(() => {
|
|
33
|
+
const { current: o } = t, { current: e } = l;
|
|
34
|
+
if (e && o) {
|
|
35
|
+
const s = o.clientHeight / o.scrollHeight;
|
|
36
|
+
e.style.height = h(s * 100), e.style.display = s === 1 ? "none" : "block", r.scrollRatio = s;
|
|
37
|
+
}
|
|
38
|
+
}, []), a = n(({ clientY: o }) => {
|
|
39
|
+
const { current: e } = t;
|
|
40
|
+
if (e) {
|
|
41
|
+
const s = o - r.positons.y;
|
|
42
|
+
e.scrollTop = r.positons.top + s / r.scrollRatio;
|
|
43
|
+
}
|
|
44
|
+
}, []), m = n(() => {
|
|
45
|
+
i.clear();
|
|
46
|
+
}, []), E = n(({ clientY: o }) => {
|
|
47
|
+
const { current: e } = t;
|
|
48
|
+
e && (r.positons = {
|
|
49
|
+
top: e.scrollTop,
|
|
50
|
+
y: o
|
|
51
|
+
}), i.start();
|
|
52
|
+
}, []), M = () => {
|
|
53
|
+
requestAnimationFrame(() => {
|
|
54
|
+
const { current: o } = t, { current: e } = l;
|
|
55
|
+
e && o && (e.style.top = h(o.scrollTop * 100 / o.scrollHeight));
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ x("div", { className: "relative h-full overflow-hidden", children: [
|
|
59
|
+
/* @__PURE__ */ c(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: L("hidden-scroll h-full overflow-y-scroll", g),
|
|
63
|
+
onScroll: M,
|
|
64
|
+
ref: t,
|
|
65
|
+
children: b
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ c(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "absolute right-0 top-0 box-border h-full",
|
|
72
|
+
style: { width: v(w), padding: v(R) },
|
|
73
|
+
children: /* @__PURE__ */ c(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
onMouseDown: E,
|
|
77
|
+
className: `${y} relative w-full rounded-full`,
|
|
78
|
+
ref: l
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
C as ImitateScroll
|
|
87
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { attr as d } from "@companix/utils-browser";
|
|
3
|
+
const u = ({ value: t, onChange: i, options: r }) => {
|
|
4
|
+
const n = r.findIndex((e) => e.value === t), a = {
|
|
5
|
+
"--uikit--current-index": String(n),
|
|
6
|
+
"--uikit--options": String(r.length)
|
|
7
|
+
};
|
|
8
|
+
return /* @__PURE__ */ s("div", { className: "segments-container", children: /* @__PURE__ */ l("div", { role: "radiogroup", className: "segments", children: [
|
|
9
|
+
n > -1 && /* @__PURE__ */ s("div", { "aria-hidden": !0, className: "segments-slider", style: a }),
|
|
10
|
+
r.map((e) => /* @__PURE__ */ s(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
onClick: () => i(e.value),
|
|
14
|
+
className: "segments-option",
|
|
15
|
+
"data-active": d(e.value === t),
|
|
16
|
+
children: e.label
|
|
17
|
+
},
|
|
18
|
+
`segment-${e.value}`
|
|
19
|
+
))
|
|
20
|
+
] }) });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
u as Segments
|
|
24
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
$properties: (
|
|
2
|
+
// Layout
|
|
3
|
+
display,
|
|
4
|
+
position,
|
|
5
|
+
top,
|
|
6
|
+
right,
|
|
7
|
+
bottom,
|
|
8
|
+
left,
|
|
9
|
+
z-index,
|
|
10
|
+
float,
|
|
11
|
+
clear,
|
|
12
|
+
overflow,
|
|
13
|
+
overflow-x,
|
|
14
|
+
overflow-y,
|
|
15
|
+
visibility,
|
|
16
|
+
// Box model
|
|
17
|
+
box-sizing,
|
|
18
|
+
width,
|
|
19
|
+
min-width,
|
|
20
|
+
max-width,
|
|
21
|
+
height,
|
|
22
|
+
min-height,
|
|
23
|
+
max-height,
|
|
24
|
+
margin,
|
|
25
|
+
margin-top,
|
|
26
|
+
margin-right,
|
|
27
|
+
margin-bottom,
|
|
28
|
+
margin-left,
|
|
29
|
+
padding,
|
|
30
|
+
padding-top,
|
|
31
|
+
padding-right,
|
|
32
|
+
padding-bottom,
|
|
33
|
+
padding-left,
|
|
34
|
+
// Flexbox
|
|
35
|
+
flex,
|
|
36
|
+
flex-direction,
|
|
37
|
+
flex-wrap,
|
|
38
|
+
flex-grow,
|
|
39
|
+
flex-shrink,
|
|
40
|
+
flex-basis,
|
|
41
|
+
justify-content,
|
|
42
|
+
align-items,
|
|
43
|
+
align-content,
|
|
44
|
+
align-self,
|
|
45
|
+
gap,
|
|
46
|
+
row-gap,
|
|
47
|
+
column-gap,
|
|
48
|
+
// Grid
|
|
49
|
+
grid,
|
|
50
|
+
grid-template-columns,
|
|
51
|
+
grid-template-rows,
|
|
52
|
+
grid-template-areas,
|
|
53
|
+
grid-column,
|
|
54
|
+
grid-row,
|
|
55
|
+
grid-area,
|
|
56
|
+
// Typography
|
|
57
|
+
color,
|
|
58
|
+
font,
|
|
59
|
+
font-family,
|
|
60
|
+
font-size,
|
|
61
|
+
font-weight,
|
|
62
|
+
font-style,
|
|
63
|
+
font-stretch,
|
|
64
|
+
line-height,
|
|
65
|
+
letter-spacing,
|
|
66
|
+
text-align,
|
|
67
|
+
text-decoration,
|
|
68
|
+
text-transform,
|
|
69
|
+
text-overflow,
|
|
70
|
+
white-space,
|
|
71
|
+
word-break,
|
|
72
|
+
word-wrap,
|
|
73
|
+
// Background
|
|
74
|
+
background,
|
|
75
|
+
background-color,
|
|
76
|
+
background-image,
|
|
77
|
+
background-repeat,
|
|
78
|
+
background-position,
|
|
79
|
+
background-size,
|
|
80
|
+
// Border
|
|
81
|
+
border,
|
|
82
|
+
border-width,
|
|
83
|
+
border-style,
|
|
84
|
+
border-color,
|
|
85
|
+
border-radius,
|
|
86
|
+
border-top,
|
|
87
|
+
border-right,
|
|
88
|
+
border-bottom,
|
|
89
|
+
border-left,
|
|
90
|
+
// Effects
|
|
91
|
+
box-shadow,
|
|
92
|
+
opacity,
|
|
93
|
+
filter,
|
|
94
|
+
// Transform & animation
|
|
95
|
+
transform,
|
|
96
|
+
transform-origin,
|
|
97
|
+
transition,
|
|
98
|
+
transition-property,
|
|
99
|
+
transition-duration,
|
|
100
|
+
transition-timing-function,
|
|
101
|
+
transition-delay,
|
|
102
|
+
animation,
|
|
103
|
+
animation-name,
|
|
104
|
+
animation-duration,
|
|
105
|
+
animation-timing-function,
|
|
106
|
+
animation-delay,
|
|
107
|
+
animation-iteration-count,
|
|
108
|
+
animation-direction,
|
|
109
|
+
animation-fill-mode,
|
|
110
|
+
// Interaction
|
|
111
|
+
cursor,
|
|
112
|
+
pointer-events,
|
|
113
|
+
user-select,
|
|
114
|
+
// Misc
|
|
115
|
+
outline,
|
|
116
|
+
outline-offset,
|
|
117
|
+
resize,
|
|
118
|
+
object-fit,
|
|
119
|
+
object-position
|
|
120
|
+
);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export { Avatar } from './Avatar';
|
|
2
|
+
export type { AvatarProps } from './Avatar';
|
|
3
|
+
export type { AvatarSize } from './Avatar/types';
|
|
4
|
+
export { avatarSizes } from './Avatar/types';
|
|
5
|
+
export { Button } from './Button';
|
|
6
|
+
export type { ButtonProps, Appearance, Mode, Size } from './Button';
|
|
7
|
+
export { ButtonGroup } from './ButtonGroup';
|
|
8
|
+
export type { ButtonGroupProps } from './ButtonGroup';
|
|
9
|
+
export { Spinner } from './Spinner';
|
|
10
|
+
export type { SpinnerProps } from './Spinner';
|
|
11
|
+
export { Scrollable } from './Scrollable';
|
|
12
|
+
export { ImitateScroll } from './Scrollable/ImitateScroll';
|
|
13
|
+
export type { ImitateScrollProps } from './Scrollable/ImitateScroll';
|
|
14
|
+
export { Segments } from './Segments';
|
|
15
|
+
export type { SegmentsProps } from './Segments';
|
|
16
|
+
export { Popover } from './Popover';
|
|
17
|
+
export type { PopoverProps } from './Popover';
|
|
18
|
+
export { Tooltip } from './Tooltip';
|
|
19
|
+
export type { TooltipProps } from './Tooltip';
|
|
20
|
+
export { Select } from './Select';
|
|
21
|
+
export type { SelectProps } from './Select';
|
|
22
|
+
export { Input } from './Input/Input';
|
|
23
|
+
export type { InputProps } from './Input/Input';
|
|
24
|
+
export { OptionItem } from './OptionItem/OptionItem';
|
|
25
|
+
export type { OptionProps } from './OptionItem/OptionItem';
|
|
26
|
+
export { NumberInput } from './NumberInput';
|
|
27
|
+
export type { NumberInputProps, ReactNumberFormatParams } from './NumberInput';
|
|
28
|
+
export { OptionsList } from './OptionItem/OptionsList';
|
|
29
|
+
export type { OptionsListProps } from './OptionItem/OptionsList';
|
|
30
|
+
export { Checkbox } from './Checkbox';
|
|
31
|
+
export type { CheckboxProps } from './Checkbox';
|
|
32
|
+
export { Switch } from './Switch';
|
|
33
|
+
export type { SwitchProps } from './Switch';
|
|
34
|
+
export { Radio, RadioGroup } from './Radio';
|
|
35
|
+
export type { RadioOption, RadioGroupProps } from './Radio';
|
|
36
|
+
export { Drawer } from './Drawer';
|
|
37
|
+
export type { DrawerProps } from './Drawer';
|
|
38
|
+
export { Dialog } from './Dialog';
|
|
39
|
+
export type { DialogProps, DialogSize } from './Dialog';
|
|
40
|
+
export { AlertDialog } from './DialogAlert/Alert';
|
|
41
|
+
export type { AlertDialogProps } from './DialogAlert/Alert';
|
|
42
|
+
export { LoadingButton } from './LoadingButton';
|
|
43
|
+
export type { LoadingButtonProps } from './LoadingButton';
|
|
44
|
+
export { Tabs } from './Tabs';
|
|
45
|
+
export type { TabsProps } from './Tabs';
|
|
46
|
+
export { Countdown } from './Countdown';
|
|
47
|
+
export type { CountDownProps } from './Countdown';
|
|
48
|
+
export { TextArea } from './TextArea';
|
|
49
|
+
export type { TextAreaProps } from './TextArea';
|
|
50
|
+
export { SelectTags } from './SelectTags';
|
|
51
|
+
export type { SelectTagsProps } from './SelectTags';
|
|
52
|
+
export { DatePicker } from './DatePicker';
|
|
53
|
+
export type { DatePickerProps } from './DatePicker';
|
|
54
|
+
export { DateInput } from './DateInput';
|
|
55
|
+
export type { DateInputProps } from './DateInput';
|
|
56
|
+
export { FileOverlay } from './File';
|
|
57
|
+
export type { FileOverlayProps } from './File';
|
|
58
|
+
export { FormGroup } from './FormGroup';
|
|
59
|
+
export type { FormGroupProps } from './FormGroup';
|
|
60
|
+
export { TimePicker } from './TimePicker';
|
|
61
|
+
export type { TimePickerProps } from './TimePicker';
|
|
62
|
+
export { Icon } from './Icon';
|
|
63
|
+
export type { IconProps, IconDefinition } from './Icon';
|
|
64
|
+
export { ProgressBar } from './Progress';
|
|
65
|
+
export type { ProgressBarProps } from './Progress';
|
|
66
|
+
export { ThemeProvider, useTheme } from './ThemeProvider';
|
|
67
|
+
export { ColorSchemeScript, colorSchemeScript } from './ThemeProvider/script';
|
|
68
|
+
export { useLocalStorage } from './__hooks/use-local-storage';
|
|
69
|
+
export { createAlertAgent } from './DialogAlert';
|
|
70
|
+
export { createToaster } from './Toaster';
|
|
71
|
+
export { Toast } from './Toaster/Toast';
|
|
72
|
+
export * from './types';
|
|
73
|
+
export type { CalendarProps } from './Calendar/Calendar';
|
|
74
|
+
export { createDialogsRegistry, DialogShell } from './__helpers/createDialogRegistry';
|
|
75
|
+
export { createPopoversRegistry } from './__helpers/createPopoversRegistry';
|
|
76
|
+
export type { PopupProps } from './__helpers/createDialogRegistry';
|
|
77
|
+
export type { PopoverContentProps } from './__helpers/createPopoversRegistry';
|
package/dist/index.scss
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use './Avatar/Avatar.scss';
|
|
2
|
+
@use './Button/Button.scss';
|
|
3
|
+
@use './Icon/icon.scss';
|
|
4
|
+
@use './Popover/Popover.scss';
|
|
5
|
+
@use './Tooltip/Tooltip.scss';
|
|
6
|
+
@use './Checkbox/Checkbox.scss';
|
|
7
|
+
@use './Radio/Radio.scss';
|
|
8
|
+
@use './Tabs/Tabs.scss';
|
|
9
|
+
@use './Toaster/Toaster.scss';
|
|
10
|
+
@use './Dialog/Popup.scss';
|
|
11
|
+
@use './Dialog/Dialog.scss';
|
|
12
|
+
@use './DialogAlert/Alert.scss';
|
|
13
|
+
@use './Drawer/Drawer.scss';
|
|
14
|
+
@use './Select/Select.scss';
|
|
15
|
+
@use './TextArea/TextArea.scss';
|
|
16
|
+
@use './SelectTags/SelectTags.scss';
|
|
17
|
+
@use './OptionItem/Option.scss';
|
|
18
|
+
@use './Input/Input.scss';
|
|
19
|
+
@use './Input/Form.scss';
|
|
20
|
+
@use './DateInput/DateInput.scss';
|
|
21
|
+
@use './Calendar/Calendar.scss';
|
|
22
|
+
@use './Switch/Switch.scss';
|
|
23
|
+
@use './Spinner/Spinner.scss';
|
|
24
|
+
@use './ButtonGroup/ButtonGroup.scss';
|
|
25
|
+
@use './Segments/Segments.scss';
|
|
26
|
+
@use './Scrollable/Scrollable.scss';
|
|
27
|
+
@use './FormGroup/FormGroup.scss';
|
|
28
|
+
@use './Progress/Progress.scss';
|
package/dist/mixins.scss
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@use './theme.scss';
|
|
2
|
+
@use './css-properties.scss';
|
|
3
|
+
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
@use 'sass:list';
|
|
6
|
+
@use 'sass:meta';
|
|
7
|
+
|
|
8
|
+
@mixin height($size) {
|
|
9
|
+
height: $size;
|
|
10
|
+
min-height: $size;
|
|
11
|
+
max-height: $size;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@mixin box($size) {
|
|
15
|
+
height: $size;
|
|
16
|
+
width: $size;
|
|
17
|
+
min-width: $size;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin items-spacing($spacing) {
|
|
21
|
+
& > * {
|
|
22
|
+
margin-right: $spacing;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& > :last-child {
|
|
26
|
+
margin-right: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin truncate-text() {
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@function get-value($map, $keys...) {
|
|
37
|
+
$current: $map;
|
|
38
|
+
|
|
39
|
+
@each $key in $keys {
|
|
40
|
+
@if meta.type-of($current) != 'map' {
|
|
41
|
+
@return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
$current: map.get($current, $key);
|
|
45
|
+
|
|
46
|
+
@if $current == null {
|
|
47
|
+
@return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@return $current;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin set-style($property, $source, $keys...) {
|
|
55
|
+
$path: list.append($keys, $property);
|
|
56
|
+
$var-name: get-value($source, $path...);
|
|
57
|
+
|
|
58
|
+
@if $var-name != null {
|
|
59
|
+
@if meta.type-of($var-name) != 'map' {
|
|
60
|
+
#{$property}: $var-name;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@mixin use-styles($component, $keys...) {
|
|
66
|
+
$source: map.get(theme.$tokens, $component);
|
|
67
|
+
|
|
68
|
+
@each $property, $v in css-properties.$properties {
|
|
69
|
+
@include set-style($property, $source, $keys...);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@mixin use-styles-debug($component, $keys...) {
|
|
74
|
+
$source: map.get(theme.$tokens, $component);
|
|
75
|
+
|
|
76
|
+
@debug $source;
|
|
77
|
+
|
|
78
|
+
@each $property, $v in css-properties.$properties {
|
|
79
|
+
@include set-style($property, $source, $keys...);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@function get-var-name($component, $keys...) {
|
|
84
|
+
$source: map.get(theme.$tokens, $component);
|
|
85
|
+
$var-name: get-value($source, $keys...);
|
|
86
|
+
|
|
87
|
+
@return $var-name;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@mixin use-size($component, $keys...) {
|
|
91
|
+
$name: get-var-name($component, $keys...);
|
|
92
|
+
|
|
93
|
+
@if $name != null {
|
|
94
|
+
@if meta.type-of($name) != 'map' {
|
|
95
|
+
width: $name;
|
|
96
|
+
min-width: $name;
|
|
97
|
+
height: $name;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
$appearances: ('primary', 'neutral', 'positive', 'negative');
|
package/dist/theme.scss
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
|
|
5
|
+
$button-appearances: ();
|
|
6
|
+
$tokens: ();
|
|
7
|
+
|
|
8
|
+
@function str-split($string, $delimiter) {
|
|
9
|
+
$result: ();
|
|
10
|
+
$buffer: '';
|
|
11
|
+
|
|
12
|
+
@for $i from 1 through string.length($string) {
|
|
13
|
+
$char: string.slice($string, $i, $i);
|
|
14
|
+
|
|
15
|
+
@if ($char == $delimiter) {
|
|
16
|
+
$result: list.append($result, $buffer);
|
|
17
|
+
$buffer: '';
|
|
18
|
+
} @else {
|
|
19
|
+
$buffer: $buffer + $char;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$result: list.append($result, $buffer);
|
|
24
|
+
|
|
25
|
+
@return $result;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@function list-slice($list, $start, $end: list.length($list)) {
|
|
29
|
+
$new: ();
|
|
30
|
+
|
|
31
|
+
@for $i from $start through $end {
|
|
32
|
+
$new: list.append($new, list.nth($list, $i));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@return $new;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// Добавляет значение в многоуровневую карту
|
|
39
|
+
@function map-deep-set($map, $keys, $value) {
|
|
40
|
+
$current: $map;
|
|
41
|
+
$key: list.nth($keys, 1);
|
|
42
|
+
|
|
43
|
+
@if list.length($keys) == 1 {
|
|
44
|
+
@return map.merge(
|
|
45
|
+
$current,
|
|
46
|
+
(
|
|
47
|
+
$key: $value
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
$nested: map.get($current, $key);
|
|
53
|
+
|
|
54
|
+
@if $nested == null {
|
|
55
|
+
$nested: ();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
$nested: map-deep-set($nested, list-slice($keys, 2), $value);
|
|
59
|
+
|
|
60
|
+
@return map.merge(
|
|
61
|
+
$current,
|
|
62
|
+
(
|
|
63
|
+
$key: $nested
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin use-button-properties($vars) {
|
|
69
|
+
@each $full-name, $v in $vars {
|
|
70
|
+
// Разбиваем путь: primary-default-enabled-background → ('primary', 'default', 'enabled', 'background')
|
|
71
|
+
$parts: str-split($full-name, '_');
|
|
72
|
+
// Создаём CSS переменную:
|
|
73
|
+
$css-var: string.unquote('var(--btn_#{$full-name})');
|
|
74
|
+
// Глубоко добавляем значение в структуру
|
|
75
|
+
$button-appearances: map-deep-set($button-appearances, $parts, $css-var) !global;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@mixin use-tokens($components) {
|
|
80
|
+
@each $component-name, $v in $components {
|
|
81
|
+
$component-vars: map.get($components, $component-name);
|
|
82
|
+
|
|
83
|
+
@each $path, $v in $component-vars {
|
|
84
|
+
$name: #{$component-name}_#{$path};
|
|
85
|
+
// Разбиваем путь: primary_default_enabled_background → ('primary', 'default', 'enabled', 'background')
|
|
86
|
+
$keys: str-split($name, '_');
|
|
87
|
+
// Создаём CSS переменную:
|
|
88
|
+
$css-var: string.unquote('var(--#{$name})');
|
|
89
|
+
// Глубоко добавляем значение в структуру
|
|
90
|
+
$tokens: map-deep-set($tokens, $keys, $css-var) !global;
|
|
91
|
+
// set scss var
|
|
92
|
+
--#{$name}: #{map.get($component-vars, $path)};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@mixin use-css-vars($prefix, $map) {
|
|
98
|
+
@each $name, $value in $map {
|
|
99
|
+
--#{$prefix}_#{$name}: #{$value};
|
|
100
|
+
}
|
|
101
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Option<T> {
|
|
2
|
+
title: string;
|
|
3
|
+
value: T;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DateFormat {
|
|
10
|
+
month: number;
|
|
11
|
+
year: number;
|
|
12
|
+
day: number;
|
|
13
|
+
}
|
|
14
|
+
export interface TimeFormat {
|
|
15
|
+
hours: number;
|
|
16
|
+
minutes: number;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companix/uikit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"main": "./dist/bundle.es.js",
|
|
5
5
|
"module": "./dist/bundle.es.js",
|
|
6
|
-
"types": "./
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"react-dom": "^18.3.1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@companix/icons-solid": "
|
|
27
|
-
"@companix/utils-browser": "
|
|
28
|
-
"@companix/utils-js": "
|
|
26
|
+
"@companix/icons-solid": "*",
|
|
27
|
+
"@companix/utils-browser": "*",
|
|
28
|
+
"@companix/utils-js": "*",
|
|
29
29
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
30
30
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
31
31
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
"vite-plugin-dts": "^4.5.4",
|
|
66
66
|
"vite-plugin-static-copy": "^3.1.4"
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|