@reportportal/ui-kit 0.0.1-alpha.8 → 0.0.1-alpha.80
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/README.md +71 -13
- package/dist/arrowUp-4a5caee7.js +6 -0
- package/dist/baseIconButton-251479f7.js +25 -0
- package/dist/baseIconButton.js +1 -1
- package/dist/button-2baad814.js +66 -0
- package/dist/button.js +1 -1
- package/dist/calendarArrow-3e1339ea.js +6 -0
- package/dist/checkbox-aa91985d.js +73 -0
- package/dist/checkbox.js +1 -1
- package/dist/close-4d480ef7.js +5 -0
- package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/common/types.d.ts +3 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/baseIconButton.d.ts +1 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/index.d.ts +1 -0
- package/dist/components/bubblesLoader/bubblesLoader.d.ts +1 -0
- package/dist/components/bubblesLoader/index.d.ts +1 -0
- package/dist/components/button/button.d.ts +5 -4
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +4 -1
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/datePicker/datePicker.d.ts +25 -0
- package/dist/components/datePicker/header/datePickerHeader.d.ts +16 -0
- package/dist/components/datePicker/header/index.d.ts +4 -0
- package/dist/components/datePicker/index.d.ts +5 -0
- package/dist/components/datePicker/utils.d.ts +4 -0
- package/dist/components/dropdown/constants.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +13 -4
- package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
- package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/dropdown/types.d.ts +3 -0
- package/dist/components/dropdown/utils.d.ts +2 -1
- package/dist/components/fieldLabel/fieldLabel.d.ts +7 -0
- package/dist/components/fieldLabel/index.d.ts +1 -0
- package/dist/components/fieldNumber/constants.d.ts +1 -0
- package/dist/components/fieldNumber/fieldNumber.d.ts +3 -2
- package/dist/components/fieldNumber/index.d.ts +1 -0
- package/dist/components/fieldText/fieldText.d.ts +13 -4
- package/dist/components/fieldText/index.d.ts +1 -0
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +4 -2
- package/dist/components/fieldTextFlex/index.d.ts +1 -0
- package/dist/components/icons/index.d.ts +46 -3
- package/dist/components/index.d.ts +10 -0
- package/dist/components/maxValueDisplay/index.d.ts +4 -0
- package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +8 -0
- package/dist/components/maxValueDisplay/utils/index.d.ts +1 -0
- package/dist/components/maxValueDisplay/utils/isPositiveInteger.d.ts +1 -0
- package/dist/components/modal/modal.d.ts +5 -2
- package/dist/components/modal/modalContent/modalContent.d.ts +2 -0
- package/dist/components/modal/modalFooter/modalFooter.d.ts +1 -0
- package/dist/components/modal/modalHeader/modalHeader.d.ts +2 -1
- package/dist/components/pagination/index.d.ts +5 -0
- package/dist/components/pagination/itemsCounter/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +10 -0
- package/dist/components/pagination/pageControls/activePage/activePage.d.ts +13 -0
- package/dist/components/pagination/pageControls/activePage/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +11 -0
- package/dist/components/pagination/pageControls/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageControls.d.ts +17 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +12 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +12 -0
- package/dist/components/pagination/pageSizeControl/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +11 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +9 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/types.d.ts +2 -0
- package/dist/components/popover/index.d.ts +4 -0
- package/dist/components/popover/popover.d.ts +19 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/radio.d.ts +1 -0
- package/dist/components/radio/radioGroup.d.ts +1 -0
- package/dist/components/spinLoader/index.d.ts +4 -0
- package/dist/components/spinLoader/spinLoader.d.ts +8 -0
- package/dist/components/systemAlert/index.d.ts +1 -0
- package/dist/components/systemAlert/systemAlert.d.ts +4 -0
- package/dist/components/systemAlert/types.d.ts +16 -0
- package/dist/components/systemMessage/index.d.ts +1 -0
- package/dist/components/systemMessage/systemMessage.d.ts +1 -0
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/table.d.ts +4 -0
- package/dist/components/table/types.d.ts +52 -0
- package/dist/components/table/utils.d.ts +6 -0
- package/dist/components/themeProvider/index.d.ts +1 -0
- package/dist/components/themeProvider/themeProvider.d.ts +1 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/toggle.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +23 -0
- package/dist/datePicker-d3709c9e.js +201 -0
- package/dist/datePicker.js +28 -0
- package/dist/dropdown-0260bb66.js +5 -0
- package/dist/dropdown-9427f821.js +282 -0
- package/dist/dropdown.js +5 -2
- package/dist/fieldLabel.js +18 -0
- package/dist/fieldNumber-2542b311.js +128 -0
- package/dist/fieldNumber.js +4 -2
- package/dist/fieldText-f38be7ba.js +166 -0
- package/dist/fieldText.js +6 -2
- package/dist/fieldTextFlex-9e616f66.js +78 -0
- package/dist/fieldTextFlex.js +10 -0
- package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
- package/dist/icons.js +62 -0
- package/dist/index.js +106 -30
- package/dist/maxValueDisplay-9be01a75.js +13 -0
- package/dist/maxValueDisplay.js +6 -0
- package/dist/modal.js +144 -14
- package/dist/openEye-7b9cf080.js +7 -0
- package/dist/pagination-8cf70249.js +345 -0
- package/dist/pagination.js +20 -0
- package/dist/plus-0929dda4.js +6 -0
- package/dist/popover.js +99 -0
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio-62546efa.js +76 -0
- package/dist/radio.js +9 -0
- package/dist/spinLoader-c4a53718.js +11 -0
- package/dist/spinLoader.js +7 -0
- package/dist/style.css +1 -1
- package/dist/success-8fd8bd2c.js +7 -0
- package/dist/systemAlert.js +63 -0
- package/dist/systemMessage-924fdaa6.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-20aa2cdf.js +142 -0
- package/dist/table.js +11 -0
- package/dist/toggle-304107fa.js +59 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +101 -0
- package/package.json +30 -17
- package/dist/baseIconButton-7bc53dec.js +0 -25
- package/dist/button-497b4d19.js +0 -62
- package/dist/checkbox-1e21cf3e.js +0 -68
- package/dist/dropdown-e07f2a71.js +0 -212
- package/dist/fieldNumber-46fe79b9.js +0 -127
- package/dist/fieldText-65a50d9d.js +0 -101
- package/dist/index-2bee4457.js +0 -131
- package/dist/systemMessage-1ced6079.js +0 -30
- package/dist/toggle-707ecb74.js +0 -67
package/dist/toggle.js
CHANGED
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as p, Fragment as D, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as H, useRef as d } from "react";
|
|
3
|
+
import { createPortal as R } from "react-dom";
|
|
4
|
+
import { c as G } from "./bind-06a7ff84.js";
|
|
5
|
+
import { useFloating as P, offset as j, flip as k, arrow as $, autoUpdate as C, FloatingArrow as U } from "@floating-ui/react";
|
|
6
|
+
const Y = {
|
|
7
|
+
"tooltip-wrapper": "_tooltip-wrapper_lwpn2_16",
|
|
8
|
+
"tooltip-content": "_tooltip-content_lwpn2_23"
|
|
9
|
+
}, n = G.bind(Y), Z = 300, q = 100, z = 16, f = 8, B = ["top", "right", "bottom", "left"], tt = ({
|
|
10
|
+
content: u,
|
|
11
|
+
wrapperClassName: h,
|
|
12
|
+
tooltipClassName: w,
|
|
13
|
+
contentClassName: x,
|
|
14
|
+
dynamicWidth: T,
|
|
15
|
+
width: _,
|
|
16
|
+
minWidth: g = 120,
|
|
17
|
+
safeZone: E = 4,
|
|
18
|
+
zIndex: A = 9,
|
|
19
|
+
placement: N = "bottom",
|
|
20
|
+
arrowColor: b = "rgba(34, 34, 34, 0.91)",
|
|
21
|
+
dataAutomationId: I,
|
|
22
|
+
mainAxis: S = !0,
|
|
23
|
+
children: W,
|
|
24
|
+
portalRoot: s,
|
|
25
|
+
isFloating: y = !0
|
|
26
|
+
}) => {
|
|
27
|
+
const [i, l] = H(!1), r = d(null), t = d(), { refs: c, floatingStyles: F, context: L } = P({
|
|
28
|
+
open: i,
|
|
29
|
+
placement: N,
|
|
30
|
+
middleware: [
|
|
31
|
+
j({
|
|
32
|
+
mainAxis: E + f
|
|
33
|
+
}),
|
|
34
|
+
y && k({
|
|
35
|
+
mainAxis: S,
|
|
36
|
+
fallbackAxisSideDirection: "start",
|
|
37
|
+
fallbackPlacements: B
|
|
38
|
+
}),
|
|
39
|
+
$({
|
|
40
|
+
element: r
|
|
41
|
+
})
|
|
42
|
+
],
|
|
43
|
+
whileElementsMounted: C
|
|
44
|
+
}), e = T ? null : { width: `${_}px` }, M = document.documentElement.clientWidth, O = e || M - q, a = () => {
|
|
45
|
+
t.current && clearTimeout(t.current), l(!1);
|
|
46
|
+
}, v = () => {
|
|
47
|
+
t.current = setTimeout(() => l(!0), Z);
|
|
48
|
+
}, m = () => /* @__PURE__ */ p(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: c.setFloating,
|
|
52
|
+
style: {
|
|
53
|
+
...F,
|
|
54
|
+
...e,
|
|
55
|
+
minWidth: g,
|
|
56
|
+
zIndex: A
|
|
57
|
+
},
|
|
58
|
+
"data-automation-id": I,
|
|
59
|
+
className: n(w),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
U,
|
|
63
|
+
{
|
|
64
|
+
ref: r,
|
|
65
|
+
context: L,
|
|
66
|
+
width: z,
|
|
67
|
+
height: f,
|
|
68
|
+
fill: b
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ o(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: n("tooltip-content", x),
|
|
75
|
+
style: {
|
|
76
|
+
maxWidth: `${O}px`
|
|
77
|
+
},
|
|
78
|
+
children: u
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
return /* @__PURE__ */ p(D, { children: [
|
|
85
|
+
/* @__PURE__ */ o(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
ref: c.setReference,
|
|
89
|
+
className: n("tooltip-wrapper", h),
|
|
90
|
+
onMouseDown: a,
|
|
91
|
+
onMouseEnter: v,
|
|
92
|
+
onMouseLeave: a,
|
|
93
|
+
children: W
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
i && (s ? R(m(), s) : m())
|
|
97
|
+
] });
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
tt as Tooltip
|
|
101
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reportportal/ui-kit",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.80",
|
|
4
4
|
"description": "The UI-kit library for ReportPortal Design System.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
"build:storybook": "storybook build",
|
|
10
10
|
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
11
11
|
"format": "npm run lint -- --fix",
|
|
12
|
-
"test": "
|
|
13
|
-
"test:coverage": "
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"test:coverage": "vitest run --coverage",
|
|
14
|
+
"test:ci": "vitest run",
|
|
15
|
+
"test:ui": "vitest --ui",
|
|
14
16
|
"prepare": "husky install"
|
|
15
17
|
},
|
|
16
18
|
"files": [
|
|
@@ -24,27 +26,36 @@
|
|
|
24
26
|
"react-dom": "17.x-18.x"
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
29
|
+
"@floating-ui/react": "^0.26.16",
|
|
27
30
|
"@floating-ui/react-dom": "^2.0.1",
|
|
28
31
|
"classnames": "^2.3.2",
|
|
29
32
|
"downshift": "^6.1.12",
|
|
30
33
|
"framer-motion": "^10.15.2",
|
|
31
|
-
"rc-scrollbars": "^1.1.6"
|
|
34
|
+
"rc-scrollbars": "^1.1.6",
|
|
35
|
+
"react-datepicker": "^7.6.0"
|
|
32
36
|
},
|
|
33
37
|
"devDependencies": {
|
|
34
|
-
"@storybook/addon-essentials": "^
|
|
35
|
-
"@storybook/addon-interactions": "^
|
|
36
|
-
"@storybook/addon-links": "^
|
|
37
|
-
"@storybook/addon-onboarding": "^
|
|
38
|
-
"@storybook/blocks": "^
|
|
39
|
-
"@storybook/react": "^
|
|
40
|
-
"@storybook/react-vite": "^
|
|
41
|
-
"@storybook/testing-library": "^0.2.
|
|
38
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
39
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
40
|
+
"@storybook/addon-links": "^8.6.14",
|
|
41
|
+
"@storybook/addon-onboarding": "^8.6.14",
|
|
42
|
+
"@storybook/blocks": "^8.6.14",
|
|
43
|
+
"@storybook/react": "^8.6.14",
|
|
44
|
+
"@storybook/react-vite": "^8.6.14",
|
|
45
|
+
"@storybook/testing-library": "^0.2.2",
|
|
46
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
47
|
+
"@testing-library/react": "^16.1.0",
|
|
48
|
+
"@testing-library/user-event": "^14.5.2",
|
|
42
49
|
"@types/node": "^20.4.5",
|
|
43
|
-
"@types/react": "^18.
|
|
50
|
+
"@types/react": "^18.3.3",
|
|
51
|
+
"@types/react-datepicker": "^6.2.0",
|
|
44
52
|
"@types/react-dom": "^18.2.7",
|
|
45
53
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
46
54
|
"@typescript-eslint/parser": "^5.62.0",
|
|
47
55
|
"@vitejs/plugin-react": "^4.0.3",
|
|
56
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
57
|
+
"@vitest/ui": "^2.1.8",
|
|
58
|
+
"date-fns": "^3.6.0",
|
|
48
59
|
"eslint": "^8.46.0",
|
|
49
60
|
"eslint-config-airbnb-typescript": "^15.0.0",
|
|
50
61
|
"eslint-config-prettier": "^8.10.0",
|
|
@@ -54,19 +65,21 @@
|
|
|
54
65
|
"eslint-plugin-react": "^7.33.1",
|
|
55
66
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
56
67
|
"eslint-plugin-react-refresh": "^0.4.3",
|
|
57
|
-
"eslint-plugin-storybook": "^0.
|
|
68
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
58
69
|
"husky": "^8.0.3",
|
|
70
|
+
"jsdom": "^25.0.1",
|
|
59
71
|
"lint-staged": "^13.2.3",
|
|
60
72
|
"prettier": "^3.0.1",
|
|
61
73
|
"react": "18.2.0",
|
|
62
74
|
"react-dom": "18.2.0",
|
|
63
75
|
"sass": "^1.64.1",
|
|
64
|
-
"storybook": "^
|
|
76
|
+
"storybook": "^8.6.14",
|
|
65
77
|
"typescript": "^5.0.2",
|
|
66
|
-
"vite": "^4.
|
|
78
|
+
"vite": "^4.5.14",
|
|
67
79
|
"vite-plugin-dts": "^3.4.0",
|
|
68
80
|
"vite-plugin-svgr": "^3.2.0",
|
|
69
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
81
|
+
"vite-tsconfig-paths": "^4.2.0",
|
|
82
|
+
"vitest": "^2.1.8"
|
|
70
83
|
},
|
|
71
84
|
"repository": {
|
|
72
85
|
"type": "git",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "./bind-06a7ff84.js";
|
|
3
|
-
const b = "_disabled_p6ked_12", i = {
|
|
4
|
-
"base-icon-button": "_base-icon-button_p6ked_1",
|
|
5
|
-
disabled: b
|
|
6
|
-
}, d = c.bind(i), l = ({
|
|
7
|
-
children: s,
|
|
8
|
-
className: o,
|
|
9
|
-
disabled: t = !1,
|
|
10
|
-
onClick: n,
|
|
11
|
-
...e
|
|
12
|
-
}) => /* @__PURE__ */ a(
|
|
13
|
-
"button",
|
|
14
|
-
{
|
|
15
|
-
className: d("base-icon-button", o, { disabled: t }),
|
|
16
|
-
type: "button",
|
|
17
|
-
disabled: t,
|
|
18
|
-
onClick: n,
|
|
19
|
-
...e,
|
|
20
|
-
children: s
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
export {
|
|
24
|
-
l as B
|
|
25
|
-
};
|
package/dist/button-497b4d19.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { jsxs as z, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as h } from "react";
|
|
3
|
-
import { c as l } from "./bind-06a7ff84.js";
|
|
4
|
-
const u = "_button_3xwzb_1", f = "_primary_3xwzb_19", g = "_disabled_3xwzb_24", y = "_ghost_3xwzb_36", N = "_danger_3xwzb_54", B = "_text_3xwzb_70", $ = "_icon_3xwzb_116", j = {
|
|
5
|
-
button: u,
|
|
6
|
-
primary: f,
|
|
7
|
-
disabled: g,
|
|
8
|
-
ghost: y,
|
|
9
|
-
danger: N,
|
|
10
|
-
text: B,
|
|
11
|
-
"width-wide-content": "_width-wide-content_3xwzb_106",
|
|
12
|
-
"width-parent": "_width-parent_3xwzb_111",
|
|
13
|
-
icon: $,
|
|
14
|
-
"icon-start": "_icon-start_3xwzb_122",
|
|
15
|
-
"icon-end": "_icon-end_3xwzb_126"
|
|
16
|
-
}, c = l.bind(j), q = h(
|
|
17
|
-
({
|
|
18
|
-
variant: t = "primary",
|
|
19
|
-
icon: e,
|
|
20
|
-
iconPlace: n = "start",
|
|
21
|
-
adjustWidthOn: o = "content",
|
|
22
|
-
type: r = "button",
|
|
23
|
-
children: i,
|
|
24
|
-
disabled: s = !1,
|
|
25
|
-
onClick: a,
|
|
26
|
-
title: b,
|
|
27
|
-
className: w,
|
|
28
|
-
...x
|
|
29
|
-
}, d) => {
|
|
30
|
-
const m = c("button", t, w, {
|
|
31
|
-
disabled: s,
|
|
32
|
-
[`width-${o}`]: o
|
|
33
|
-
}), _ = t === "text" && e;
|
|
34
|
-
return /* @__PURE__ */ z(
|
|
35
|
-
"button",
|
|
36
|
-
{
|
|
37
|
-
ref: d,
|
|
38
|
-
type: r,
|
|
39
|
-
disabled: s,
|
|
40
|
-
className: m,
|
|
41
|
-
onClick: a,
|
|
42
|
-
title: b,
|
|
43
|
-
...x,
|
|
44
|
-
children: [
|
|
45
|
-
_ && /* @__PURE__ */ p(
|
|
46
|
-
"i",
|
|
47
|
-
{
|
|
48
|
-
className: c("icon", {
|
|
49
|
-
[`icon-${n}`]: n
|
|
50
|
-
}),
|
|
51
|
-
children: _
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
i
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
export {
|
|
61
|
-
q as B
|
|
62
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { c as x } from "./bind-06a7ff84.js";
|
|
3
|
-
import { useRef as d } from "react";
|
|
4
|
-
import { K as _ } from "./keyCodes-f63c0e11.js";
|
|
5
|
-
const m = "_checkbox_l76v2_1", f = "_disabled_l76v2_11", y = "_input_l76v2_16", C = "_control_l76v2_23", E = "_children_l76v2_77", D = {
|
|
6
|
-
checkbox: m,
|
|
7
|
-
disabled: f,
|
|
8
|
-
input: y,
|
|
9
|
-
control: C,
|
|
10
|
-
children: E
|
|
11
|
-
}, e = x.bind(D), j = ({
|
|
12
|
-
children: l,
|
|
13
|
-
disabled: c = !1,
|
|
14
|
-
onChange: p,
|
|
15
|
-
className: b,
|
|
16
|
-
value: s,
|
|
17
|
-
...h
|
|
18
|
-
}) => {
|
|
19
|
-
const o = d(null), k = (n) => {
|
|
20
|
-
var a, i;
|
|
21
|
-
const { keyCode: r } = n;
|
|
22
|
-
if (r === _.SPACE_KEY_CODE) {
|
|
23
|
-
n.preventDefault(), (a = o.current) == null || a.click();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
r === _.ENTER_KEY_CODE && (n.preventDefault(), (i = o.current) == null || i.click());
|
|
27
|
-
};
|
|
28
|
-
return /* @__PURE__ */ u(
|
|
29
|
-
"label",
|
|
30
|
-
{
|
|
31
|
-
id: "rp-ui-kit-checkbox-label",
|
|
32
|
-
className: e("checkbox", b, {
|
|
33
|
-
disabled: c
|
|
34
|
-
}),
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ t(
|
|
37
|
-
"input",
|
|
38
|
-
{
|
|
39
|
-
ref: o,
|
|
40
|
-
tabIndex: 0,
|
|
41
|
-
type: "checkbox",
|
|
42
|
-
onKeyDown: k,
|
|
43
|
-
className: e("input"),
|
|
44
|
-
disabled: c,
|
|
45
|
-
onChange: p,
|
|
46
|
-
checked: s,
|
|
47
|
-
...h
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
-
"span",
|
|
52
|
-
{
|
|
53
|
-
"aria-labelledby": "rp-ui-kit-checkbox-label",
|
|
54
|
-
role: "checkbox",
|
|
55
|
-
"aria-checked": s,
|
|
56
|
-
className: e("control", {
|
|
57
|
-
disabled: c
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
l && /* @__PURE__ */ t("span", { className: e("children", { disabled: c }), children: l })
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
j as C
|
|
68
|
-
};
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as L } from "react/jsx-runtime";
|
|
2
|
-
import * as R from "react";
|
|
3
|
-
import { forwardRef as F, useState as Y, useRef as B } from "react";
|
|
4
|
-
import { c as A } from "./bind-06a7ff84.js";
|
|
5
|
-
import { useFloating as ee, offset as te, flip as ne } from "@floating-ui/react-dom";
|
|
6
|
-
import { useSelect as x } from "downshift";
|
|
7
|
-
import { Scrollbars as de } from "rc-scrollbars";
|
|
8
|
-
import { u as oe } from "./useOnClickOutside-c332f7d3.js";
|
|
9
|
-
import { K as f } from "./keyCodes-f63c0e11.js";
|
|
10
|
-
import { B as se } from "./baseIconButton-7bc53dec.js";
|
|
11
|
-
const ae = (t) => /* @__PURE__ */ R.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ R.createElement("path", { d: "M14.2174 5.82426C14.3736 5.66805 14.3736 5.41479 14.2174 5.25858L14.0759 5.11716C13.9197 4.96095 13.6665 4.96095 13.5103 5.11716L8.16726 10.4602L2.82426 5.11716C2.66805 4.96095 2.41479 4.96095 2.25858 5.11716L2.11716 5.25858C1.96095 5.41479 1.96095 5.66805 2.11716 5.82426L7.89176 11.5989C8.04797 11.7551 8.30124 11.7551 8.45745 11.5989L8.88171 11.1746L8.87436 11.1673L14.2174 5.82426Z", fill: "#A2AAB5" })), le = "_disabled_nx3fh_13", re = "_hidden_nx3fh_17", ie = "_selected_nx3fh_23", ce = "_hover_nx3fh_26", _e = {
|
|
12
|
-
"dropdown-option": "_dropdown-option_nx3fh_1",
|
|
13
|
-
disabled: le,
|
|
14
|
-
hidden: re,
|
|
15
|
-
selected: ie,
|
|
16
|
-
hover: ce,
|
|
17
|
-
"single-option": "_single-option_nx3fh_39",
|
|
18
|
-
"sub-option": "_sub-option_nx3fh_45"
|
|
19
|
-
}, P = A.bind(_e), he = F(
|
|
20
|
-
(t, n) => {
|
|
21
|
-
const {
|
|
22
|
-
option: { value: s, disabled: i, hidden: O, label: l, title: d, groupRef: E },
|
|
23
|
-
selected: D,
|
|
24
|
-
onChange: p,
|
|
25
|
-
render: g,
|
|
26
|
-
highlightHovered: b,
|
|
27
|
-
onMouseEnter: w
|
|
28
|
-
} = t, N = () => {
|
|
29
|
-
p && p(s);
|
|
30
|
-
};
|
|
31
|
-
return /* @__PURE__ */ a(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
className: P("dropdown-option", {
|
|
35
|
-
selected: D,
|
|
36
|
-
disabled: i,
|
|
37
|
-
hidden: O,
|
|
38
|
-
hover: b
|
|
39
|
-
}),
|
|
40
|
-
title: i && d || void 0,
|
|
41
|
-
onClick: N,
|
|
42
|
-
ref: n,
|
|
43
|
-
onMouseEnter: w,
|
|
44
|
-
children: /* @__PURE__ */ a("div", { className: P("single-option", { "sub-option": !!E }), children: g ? g(t) : l })
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
), fe = [
|
|
49
|
-
f.ENTER_KEY_CODE,
|
|
50
|
-
f.SPACE_KEY_CODE,
|
|
51
|
-
f.ARROW_DOWN_KEY_CODE
|
|
52
|
-
], ge = [f.ESCAPE_KEY_CODE, f.TAB_KEY_CODE];
|
|
53
|
-
var h = /* @__PURE__ */ ((t) => (t.ON_KEY_DOWN = "onKeyDown", t.ON_CLICK = "onClick", t))(h || {});
|
|
54
|
-
const pe = (t, n) => t.map(({ value: s }) => s).indexOf(n), we = (t, n) => (t % n + n) % n, v = (t, n = 0, s = 1) => {
|
|
55
|
-
if (!t[n].disabled)
|
|
56
|
-
return n;
|
|
57
|
-
const i = t.length;
|
|
58
|
-
return v(
|
|
59
|
-
t,
|
|
60
|
-
we(n + s, i),
|
|
61
|
-
s
|
|
62
|
-
);
|
|
63
|
-
}, me = (t, n) => v(t, n), ue = (t, n) => v(t, n, -1), Ce = "_container_3wi7d_1", Oe = "_icon_3wi7d_7", Ee = "_arrow_3wi7d_13", De = "_dropdown_3wi7d_19", be = "_disabled_3wi7d_36", Ne = "_value_3wi7d_43", xe = "_error_3wi7d_46", ve = "_touched_3wi7d_46", Ke = "_opened_3wi7d_50", ye = "_placeholder_3wi7d_72", Ie = "_ghost_3wi7d_108", ke = {
|
|
64
|
-
container: Ce,
|
|
65
|
-
icon: Oe,
|
|
66
|
-
arrow: Ee,
|
|
67
|
-
dropdown: De,
|
|
68
|
-
"transparent-background": "_transparent-background_3wi7d_33",
|
|
69
|
-
disabled: be,
|
|
70
|
-
value: Ne,
|
|
71
|
-
error: xe,
|
|
72
|
-
touched: ve,
|
|
73
|
-
opened: Ke,
|
|
74
|
-
placeholder: ye,
|
|
75
|
-
"mobile-disabled": "_mobile-disabled_3wi7d_87",
|
|
76
|
-
"select-list": "_select-list_3wi7d_92",
|
|
77
|
-
ghost: Ie
|
|
78
|
-
}, _ = A.bind(ke), $e = ({
|
|
79
|
-
value: t = "",
|
|
80
|
-
options: n = [],
|
|
81
|
-
disabled: s = !1,
|
|
82
|
-
error: i,
|
|
83
|
-
onChange: O,
|
|
84
|
-
onFocus: l,
|
|
85
|
-
onBlur: d,
|
|
86
|
-
mobileDisabled: E,
|
|
87
|
-
title: D,
|
|
88
|
-
touched: p = !1,
|
|
89
|
-
icon: g,
|
|
90
|
-
variant: b,
|
|
91
|
-
placeholder: w = "",
|
|
92
|
-
renderOption: N,
|
|
93
|
-
transparentBackground: T = !1,
|
|
94
|
-
className: W,
|
|
95
|
-
toggleButtonClassName: H
|
|
96
|
-
}) => {
|
|
97
|
-
const [r, c] = Y(!1), K = B(null), [M, m] = Y(null), { refs: y, floatingStyles: $ } = ee({
|
|
98
|
-
middleware: [
|
|
99
|
-
te(5),
|
|
100
|
-
ne({
|
|
101
|
-
fallbackPlacements: ["bottom", "top"]
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
oe(K, () => {
|
|
106
|
-
r && (c(!1), d == null || d());
|
|
107
|
-
});
|
|
108
|
-
const I = (e) => {
|
|
109
|
-
e.disabled || (O(e.value), c((o) => !o));
|
|
110
|
-
}, j = () => n.find(({ value: e }) => e === t), k = pe(n, t), {
|
|
111
|
-
getToggleButtonProps: V,
|
|
112
|
-
getMenuProps: U,
|
|
113
|
-
getItemProps: Z,
|
|
114
|
-
setHighlightedIndex: u,
|
|
115
|
-
highlightedIndex: S,
|
|
116
|
-
selectedItem: C
|
|
117
|
-
} = x({
|
|
118
|
-
items: n,
|
|
119
|
-
itemToString: (e) => (e != null && e.label ? String(e.label) : w) || "",
|
|
120
|
-
selectedItem: j(),
|
|
121
|
-
isOpen: r,
|
|
122
|
-
circularNavigation: !0,
|
|
123
|
-
defaultHighlightedIndex: k,
|
|
124
|
-
onHighlightedIndexChange: (e) => {
|
|
125
|
-
switch (e.type) {
|
|
126
|
-
case x.stateChangeTypes.MenuKeyDownArrowUp:
|
|
127
|
-
return m(h.ON_KEY_DOWN), u(ue(n, e.highlightedIndex)), e;
|
|
128
|
-
case x.stateChangeTypes.MenuKeyDownArrowDown:
|
|
129
|
-
return m(h.ON_KEY_DOWN), u(me(n, e.highlightedIndex)), e;
|
|
130
|
-
default:
|
|
131
|
-
return e;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}), q = () => {
|
|
135
|
-
s || (c((e) => !e), r ? d == null || d() : l == null || l(), m(h.ON_CLICK));
|
|
136
|
-
}, z = () => {
|
|
137
|
-
if (!t && t !== !1)
|
|
138
|
-
return w;
|
|
139
|
-
let e = t;
|
|
140
|
-
return n.forEach((o) => {
|
|
141
|
-
o.value === t && (e = o.label);
|
|
142
|
-
}), e;
|
|
143
|
-
}, G = (e) => {
|
|
144
|
-
const { keyCode: o } = e;
|
|
145
|
-
fe.includes(o) && !r && (e.preventDefault(), u(k), c(!0), l == null || l(), m(h.ON_KEY_DOWN));
|
|
146
|
-
}, J = (e) => {
|
|
147
|
-
const { keyCode: o } = e;
|
|
148
|
-
if (o === f.ENTER_KEY_CODE) {
|
|
149
|
-
const X = n[S];
|
|
150
|
-
I(X), c(!1), d == null || d();
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
ge.includes(o) && (e.stopPropagation(), c(!1), d == null || d());
|
|
154
|
-
}, Q = () => n.map((e, o) => /* @__PURE__ */ a(
|
|
155
|
-
he,
|
|
156
|
-
{
|
|
157
|
-
...Z({
|
|
158
|
-
item: e,
|
|
159
|
-
index: o
|
|
160
|
-
}),
|
|
161
|
-
selected: e.value === ((C == null ? void 0 : C.value) ?? C),
|
|
162
|
-
option: e,
|
|
163
|
-
highlightHovered: S === o && M !== h.ON_CLICK,
|
|
164
|
-
render: N,
|
|
165
|
-
onChange: e.disabled ? null : () => I(e),
|
|
166
|
-
onMouseEnter: () => u(o)
|
|
167
|
-
},
|
|
168
|
-
e.value
|
|
169
|
-
));
|
|
170
|
-
return /* @__PURE__ */ L("div", { ref: K, className: _("container", W), title: D, children: [
|
|
171
|
-
/* @__PURE__ */ L(
|
|
172
|
-
"button",
|
|
173
|
-
{
|
|
174
|
-
disabled: s,
|
|
175
|
-
...V({
|
|
176
|
-
className: _("dropdown", b, H, {
|
|
177
|
-
"transparent-background": T,
|
|
178
|
-
opened: r,
|
|
179
|
-
disabled: s,
|
|
180
|
-
error: i,
|
|
181
|
-
touched: p,
|
|
182
|
-
"mobile-disabled": E
|
|
183
|
-
}),
|
|
184
|
-
onClick: q,
|
|
185
|
-
onKeyDown: G,
|
|
186
|
-
ref: y.setReference
|
|
187
|
-
}),
|
|
188
|
-
children: [
|
|
189
|
-
g && /* @__PURE__ */ a("span", { className: _("icon"), children: g }),
|
|
190
|
-
/* @__PURE__ */ a("span", { className: _("value", { placeholder: !t }), children: z() }),
|
|
191
|
-
/* @__PURE__ */ a(se, { className: _("arrow"), tabIndex: -1, children: /* @__PURE__ */ a(ae, {}) })
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
),
|
|
195
|
-
r && /* @__PURE__ */ a(
|
|
196
|
-
"div",
|
|
197
|
-
{
|
|
198
|
-
style: $,
|
|
199
|
-
className: _("select-list", { opened: r }),
|
|
200
|
-
...U({
|
|
201
|
-
onKeyDown: J,
|
|
202
|
-
ref: y.setFloating
|
|
203
|
-
}),
|
|
204
|
-
children: /* @__PURE__ */ a(de, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: Q() })
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
] });
|
|
208
|
-
};
|
|
209
|
-
export {
|
|
210
|
-
$e as D,
|
|
211
|
-
ae as S
|
|
212
|
-
};
|