@reportportal/ui-kit 0.0.1-alpha.7 → 0.0.1-alpha.70

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.
Files changed (152) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +255 -3
  3. package/dist/arrowUp-4a5caee7.js +6 -0
  4. package/dist/baseIconButton-251479f7.js +25 -0
  5. package/dist/baseIconButton.js +7 -0
  6. package/dist/bubblesLoader-a7e709d4.js +17 -0
  7. package/dist/bubblesLoader.js +1 -1
  8. package/dist/button-33bc880f.js +64 -0
  9. package/dist/button.js +1 -1
  10. package/dist/calendarArrow-3e1339ea.js +6 -0
  11. package/dist/checkbox-aa91985d.js +73 -0
  12. package/dist/checkbox.js +1 -1
  13. package/dist/close-4b33d7c1.js +5 -0
  14. package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
  15. package/dist/common/types.d.ts +3 -0
  16. package/dist/components/baseIconButton/baseIconButton.d.ts +9 -0
  17. package/dist/components/baseIconButton/index.d.ts +5 -0
  18. package/dist/components/bubblesLoader/bubblesLoader.d.ts +1 -0
  19. package/dist/components/bubblesLoader/index.d.ts +1 -0
  20. package/dist/components/button/button.d.ts +4 -4
  21. package/dist/components/button/index.d.ts +3 -2
  22. package/dist/components/checkbox/checkbox.d.ts +3 -0
  23. package/dist/components/checkbox/index.d.ts +1 -0
  24. package/dist/components/datePicker/datePicker.d.ts +25 -0
  25. package/dist/components/datePicker/header/datePickerHeader.d.ts +16 -0
  26. package/dist/components/datePicker/header/index.d.ts +4 -0
  27. package/dist/components/datePicker/index.d.ts +5 -0
  28. package/dist/components/datePicker/utils.d.ts +4 -0
  29. package/dist/components/dropdown/constants.d.ts +5 -0
  30. package/dist/components/dropdown/dropdown.d.ts +13 -5
  31. package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
  32. package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
  33. package/dist/components/dropdown/index.d.ts +1 -0
  34. package/dist/components/dropdown/types.d.ts +3 -0
  35. package/dist/components/dropdown/utils.d.ts +2 -1
  36. package/dist/components/fieldLabel/fieldLabel.d.ts +7 -0
  37. package/dist/components/fieldLabel/index.d.ts +1 -0
  38. package/dist/components/fieldNumber/constants.d.ts +1 -0
  39. package/dist/components/fieldNumber/fieldNumber.d.ts +3 -2
  40. package/dist/components/fieldNumber/index.d.ts +1 -0
  41. package/dist/components/fieldText/fieldText.d.ts +13 -5
  42. package/dist/components/fieldText/index.d.ts +1 -0
  43. package/dist/components/fieldText/types.d.ts +5 -0
  44. package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +16 -0
  45. package/dist/components/fieldTextFlex/index.d.ts +4 -0
  46. package/dist/components/icons/index.d.ts +48 -0
  47. package/dist/components/index.d.ts +11 -1
  48. package/dist/components/maxValueDisplay/index.d.ts +4 -0
  49. package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +8 -0
  50. package/dist/components/maxValueDisplay/utils/index.d.ts +1 -0
  51. package/dist/components/maxValueDisplay/utils/isPositiveInteger.d.ts +1 -0
  52. package/dist/components/modal/modal.d.ts +7 -2
  53. package/dist/components/modal/modalContent/modalContent.d.ts +2 -0
  54. package/dist/components/modal/modalFooter/modalFooter.d.ts +1 -0
  55. package/dist/components/modal/modalHeader/modalHeader.d.ts +2 -1
  56. package/dist/components/pagination/index.d.ts +5 -0
  57. package/dist/components/pagination/itemsCounter/index.d.ts +1 -0
  58. package/dist/components/pagination/itemsCounter/itemCounter.d.ts +10 -0
  59. package/dist/components/pagination/pageControls/activePage/activePage.d.ts +13 -0
  60. package/dist/components/pagination/pageControls/activePage/index.d.ts +1 -0
  61. package/dist/components/pagination/pageControls/activePage/pageSelector/index.d.ts +1 -0
  62. package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +11 -0
  63. package/dist/components/pagination/pageControls/index.d.ts +1 -0
  64. package/dist/components/pagination/pageControls/pageControls.d.ts +17 -0
  65. package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +12 -0
  66. package/dist/components/pagination/pageControls/pageNavigator/bar/index.d.ts +1 -0
  67. package/dist/components/pagination/pageControls/pageNavigator/index.d.ts +1 -0
  68. package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +12 -0
  69. package/dist/components/pagination/pageSizeControl/index.d.ts +1 -0
  70. package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +11 -0
  71. package/dist/components/pagination/pageSizeControl/sizeSelector/index.d.ts +1 -0
  72. package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +9 -0
  73. package/dist/components/pagination/pagination.d.ts +23 -0
  74. package/dist/components/pagination/types.d.ts +2 -0
  75. package/dist/components/popover/index.d.ts +1 -0
  76. package/dist/components/popover/popover.d.ts +20 -0
  77. package/dist/components/radio/index.d.ts +5 -0
  78. package/dist/components/radio/radio.d.ts +17 -0
  79. package/dist/components/radio/radioGroup.d.ts +9 -0
  80. package/dist/components/spinLoader/index.d.ts +4 -0
  81. package/dist/components/spinLoader/spinLoader.d.ts +8 -0
  82. package/dist/components/systemAlert/index.d.ts +1 -0
  83. package/dist/components/systemAlert/systemAlert.d.ts +4 -0
  84. package/dist/components/systemAlert/types.d.ts +16 -0
  85. package/dist/components/systemMessage/index.d.ts +1 -0
  86. package/dist/components/systemMessage/systemMessage.d.ts +1 -0
  87. package/dist/components/table/constants.d.ts +2 -0
  88. package/dist/components/table/index.d.ts +4 -0
  89. package/dist/components/table/table.d.ts +4 -0
  90. package/dist/components/table/types.d.ts +52 -0
  91. package/dist/components/table/utils.d.ts +6 -0
  92. package/dist/components/themeProvider/index.d.ts +1 -0
  93. package/dist/components/themeProvider/themeProvider.d.ts +3 -1
  94. package/dist/components/toggle/index.d.ts +1 -0
  95. package/dist/components/toggle/toggle.d.ts +1 -0
  96. package/dist/components/tooltip/index.d.ts +1 -0
  97. package/dist/components/tooltip/tooltip.d.ts +23 -0
  98. package/dist/datePicker-382ef010.js +201 -0
  99. package/dist/datePicker.js +28 -0
  100. package/dist/dropdown-0260bb66.js +5 -0
  101. package/dist/dropdown-13d7d50e.js +278 -0
  102. package/dist/dropdown.js +6 -4
  103. package/dist/fieldLabel.js +18 -0
  104. package/dist/fieldNumber-2542b311.js +128 -0
  105. package/dist/fieldNumber.js +4 -3
  106. package/dist/fieldText-e605a521.js +158 -0
  107. package/dist/fieldText.js +6 -2
  108. package/dist/fieldTextFlex-9e616f66.js +78 -0
  109. package/dist/fieldTextFlex.js +10 -0
  110. package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
  111. package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
  112. package/dist/icons.js +60 -0
  113. package/dist/index.js +103 -23
  114. package/dist/maxValueDisplay-9be01a75.js +13 -0
  115. package/dist/maxValueDisplay.js +6 -0
  116. package/dist/modal.js +115 -97
  117. package/dist/openEye-7b9cf080.js +7 -0
  118. package/dist/pagination-ecbc9940.js +345 -0
  119. package/dist/pagination.js +20 -0
  120. package/dist/plus-0929dda4.js +6 -0
  121. package/dist/popover.js +99 -0
  122. package/dist/prevPage-87faf576.js +6 -0
  123. package/dist/radio-62546efa.js +76 -0
  124. package/dist/{icon.js → radio.js} +4 -4
  125. package/dist/spinLoader-c4a53718.js +11 -0
  126. package/dist/spinLoader.js +7 -0
  127. package/dist/style.css +1 -1
  128. package/dist/success-dc1914aa.js +7 -0
  129. package/dist/systemAlert.js +63 -0
  130. package/dist/{systemMessage-62c3133d.js → systemMessage-924fdaa6.js} +14 -14
  131. package/dist/systemMessage.js +1 -1
  132. package/dist/table-20aa2cdf.js +142 -0
  133. package/dist/table.js +11 -0
  134. package/dist/themeProvider-46c2be7b.js +23 -0
  135. package/dist/themeProvider.js +4 -3
  136. package/dist/toggle-304107fa.js +59 -0
  137. package/dist/toggle.js +1 -1
  138. package/dist/tooltip.js +101 -0
  139. package/package.json +53 -17
  140. package/dist/bubblesLoader-9bec3797.js +0 -17
  141. package/dist/button-d4944dbc.js +0 -64
  142. package/dist/checkbox-fdc44740.js +0 -68
  143. package/dist/clear-4963efcd.js +0 -5
  144. package/dist/components/icon/icon.d.ts +0 -11
  145. package/dist/components/icon/icons.d.ts +0 -21
  146. package/dist/components/icon/index.d.ts +0 -3
  147. package/dist/dropdown-45e7bc7d.js +0 -204
  148. package/dist/fieldNumber-27e69676.js +0 -132
  149. package/dist/fieldText-c7085849.js +0 -99
  150. package/dist/icon-71262f5c.js +0 -26
  151. package/dist/themeProvider-5800417e.js +0 -19
  152. package/dist/toggle-5b3d8333.js +0 -67
@@ -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,13 +1,18 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.7",
3
+ "version": "0.0.1-alpha.70",
4
+ "description": "The UI-kit library for ReportPortal Design System.",
4
5
  "type": "module",
5
6
  "scripts": {
6
- "dev": "storybook dev -p 6006",
7
+ "start": "storybook dev -p 6006",
7
8
  "build": "tsc && vite build",
8
9
  "build:storybook": "storybook build",
9
10
  "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
10
11
  "format": "npm run lint -- --fix",
12
+ "test": "vitest",
13
+ "test:coverage": "vitest run --coverage",
14
+ "test:ci": "vitest run",
15
+ "test:ui": "vitest --ui",
11
16
  "prepare": "husky install"
12
17
  },
13
18
  "files": [
@@ -21,28 +26,36 @@
21
26
  "react-dom": "17.x-18.x"
22
27
  },
23
28
  "dependencies": {
24
- "@popperjs/core": "^2.11.8",
29
+ "@floating-ui/react": "^0.26.16",
30
+ "@floating-ui/react-dom": "^2.0.1",
25
31
  "classnames": "^2.3.2",
26
32
  "downshift": "^6.1.12",
27
33
  "framer-motion": "^10.15.2",
28
34
  "rc-scrollbars": "^1.1.6",
29
- "react-popper": "^2.3.0"
35
+ "react-datepicker": "^7.6.0"
30
36
  },
31
37
  "devDependencies": {
32
- "@storybook/addon-essentials": "^7.2.0",
33
- "@storybook/addon-interactions": "^7.2.0",
34
- "@storybook/addon-links": "^7.2.0",
35
- "@storybook/addon-onboarding": "^1.0.8",
36
- "@storybook/blocks": "^7.2.0",
37
- "@storybook/react": "^7.2.0",
38
- "@storybook/react-vite": "^7.2.0",
39
- "@storybook/testing-library": "^0.2.0",
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",
40
49
  "@types/node": "^20.4.5",
41
- "@types/react": "^18.2.20",
50
+ "@types/react": "^18.3.3",
51
+ "@types/react-datepicker": "^6.2.0",
42
52
  "@types/react-dom": "^18.2.7",
43
53
  "@typescript-eslint/eslint-plugin": "^5.62.0",
44
54
  "@typescript-eslint/parser": "^5.62.0",
45
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",
46
59
  "eslint": "^8.46.0",
47
60
  "eslint-config-airbnb-typescript": "^15.0.0",
48
61
  "eslint-config-prettier": "^8.10.0",
@@ -52,18 +65,41 @@
52
65
  "eslint-plugin-react": "^7.33.1",
53
66
  "eslint-plugin-react-hooks": "^4.6.0",
54
67
  "eslint-plugin-react-refresh": "^0.4.3",
55
- "eslint-plugin-storybook": "^0.6.13",
68
+ "eslint-plugin-storybook": "^0.8.0",
56
69
  "husky": "^8.0.3",
70
+ "jsdom": "^25.0.1",
57
71
  "lint-staged": "^13.2.3",
58
72
  "prettier": "^3.0.1",
59
73
  "react": "18.2.0",
60
74
  "react-dom": "18.2.0",
61
75
  "sass": "^1.64.1",
62
- "storybook": "^7.2.2",
76
+ "storybook": "^8.6.14",
63
77
  "typescript": "^5.0.2",
64
- "vite": "^4.4.5",
78
+ "vite": "^4.5.14",
65
79
  "vite-plugin-dts": "^3.4.0",
66
80
  "vite-plugin-svgr": "^3.2.0",
67
- "vite-tsconfig-paths": "^4.2.0"
81
+ "vite-tsconfig-paths": "^4.2.0",
82
+ "vitest": "^2.1.8"
83
+ },
84
+ "repository": {
85
+ "type": "git",
86
+ "url": "git+https://github.com/reportportal/ui-kit.git"
87
+ },
88
+ "author": "ReportPortal.io",
89
+ "license": "Apache-2.0",
90
+ "bugs": {
91
+ "url": "https://github.com/reportportal/ui-kit/issues"
92
+ },
93
+ "homepage": "https://github.com/reportportal/ui-kit#readme",
94
+ "keywords": [
95
+ "react",
96
+ "react-components",
97
+ "design-systems",
98
+ "ui-kit",
99
+ "reportportal",
100
+ "epam"
101
+ ],
102
+ "engines": {
103
+ "node": ">=16.x"
68
104
  }
69
105
  }
@@ -1,17 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { c as r } from "./bind-06a7ff84.js";
3
- const a = "_bubble_1wrm9_1", c = "_bubbles_1wrm9_1", _ = {
4
- "bubbles-loader": "_bubbles-loader_1wrm9_1",
5
- "color-topaz": "_color-topaz_1wrm9_4",
6
- bubble: a,
7
- bubbles: c
8
- }, l = r.bind(_), t = 7, i = ({
9
- color: b = "topaz",
10
- className: o
11
- }) => /* @__PURE__ */ s("div", { className: l("bubbles-loader", o, { [`color-${b}`]: b }), children: Array(t).fill(void 0).map((m, e) => (
12
- // eslint-disable-next-line react/no-array-index-key
13
- /* @__PURE__ */ s("div", { className: l("bubble") }, e)
14
- )) });
15
- export {
16
- i as B
17
- };
@@ -1,64 +0,0 @@
1
- import { jsxs as h, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as x } from "react";
3
- import { c as f } from "./bind-06a7ff84.js";
4
- const g = "_button_wutm5_1", y = "_primary_wutm5_19", N = "_disabled_wutm5_24", B = "_ghost_wutm5_36", $ = "_danger_wutm5_51", j = "_text_wutm5_67", I = "_icon_wutm5_113", R = {
5
- button: g,
6
- primary: y,
7
- disabled: N,
8
- ghost: B,
9
- danger: $,
10
- text: j,
11
- "width-wide-content": "_width-wide-content_wutm5_103",
12
- "width-parent": "_width-parent_wutm5_108",
13
- icon: I,
14
- "icon-start": "_icon-start_wutm5_119",
15
- "icon-end": "_icon-end_wutm5_123"
16
- }, c = f.bind(R), A = x(
17
- ({
18
- variant: t = "primary",
19
- icon: e,
20
- iconPlace: n = "start",
21
- adjustWidthOn: o = "content",
22
- type: i = "button",
23
- children: r,
24
- disabled: s = !1,
25
- onClick: a,
26
- title: m,
27
- className: d,
28
- dataAutomationId: u,
29
- ...w
30
- }, b) => {
31
- const p = c("button", t, d, {
32
- disabled: s,
33
- [`width-${o}`]: o
34
- }), _ = t === "text" && e;
35
- return /* @__PURE__ */ h(
36
- "button",
37
- {
38
- ref: b,
39
- type: i,
40
- disabled: s,
41
- className: p,
42
- onClick: a,
43
- title: m,
44
- "data-automation-id": u,
45
- ...w,
46
- children: [
47
- _ && /* @__PURE__ */ l(
48
- "i",
49
- {
50
- className: c("icon", {
51
- [`icon-${n}`]: n
52
- }),
53
- children: _
54
- }
55
- ),
56
- r
57
- ]
58
- }
59
- );
60
- }
61
- );
62
- export {
63
- A as B
64
- };
@@ -1,68 +0,0 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { c as x } from "./bind-06a7ff84.js";
3
- import { useRef as d } from "react";
4
- import { K as p } from "./keyCodes-f63c0e11.js";
5
- const m = "_checkbox_1ggpr_1", f = "_disabled_1ggpr_12", g = "_input_1ggpr_17", y = "_control_1ggpr_24", C = "_children_1ggpr_78", E = {
6
- checkbox: m,
7
- disabled: f,
8
- input: g,
9
- control: y,
10
- children: C
11
- }, e = x.bind(E), j = ({
12
- children: t,
13
- disabled: c = !1,
14
- onChange: _,
15
- className: b,
16
- value: s,
17
- ...h
18
- }) => {
19
- const o = d(null), k = (n) => {
20
- var a, i;
21
- const { keyCode: l } = n;
22
- if (l === p.SPACE_KEY_CODE) {
23
- n.preventDefault(), (a = o.current) == null || a.click();
24
- return;
25
- }
26
- l === p.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__ */ r(
37
- "input",
38
- {
39
- ref: o,
40
- tabIndex: 0,
41
- type: "checkbox",
42
- onKeyDown: k,
43
- className: e("input"),
44
- disabled: c,
45
- onChange: _,
46
- checked: s,
47
- ...h
48
- }
49
- ),
50
- /* @__PURE__ */ r(
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
- t && /* @__PURE__ */ r("span", { className: e("children", { disabled: c }), children: t })
62
- ]
63
- }
64
- );
65
- };
66
- export {
67
- j as C
68
- };
@@ -1,5 +0,0 @@
1
- import * as e from "react";
2
- const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("rect", { width: 16.2089, height: 16.1568, rx: 8.07842, fill: "#A2AAB5" }), /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.14768 5.14645C4.95077 5.34171 4.95077 5.65829 5.14768 5.85355L7.49578 8.18198L5.35655 10.3033C5.15963 10.4986 5.15963 10.8151 5.35655 11.0104C5.55346 11.2057 5.87271 11.2057 6.06962 11.0104L8.20886 8.88909L10.1392 10.8033C10.3361 10.9986 10.6554 10.9986 10.8523 10.8033C11.0492 10.608 11.0492 10.2915 10.8523 10.0962L8.92193 8.18198L11.0612 6.06065C11.2581 5.86539 11.2581 5.54881 11.0612 5.35355C10.8643 5.15828 10.545 5.15828 10.3481 5.35355L8.20886 7.47487L5.86076 5.14645C5.66385 4.95118 5.34459 4.95118 5.14768 5.14645Z", fill: "white" }));
3
- export {
4
- l as S
5
- };
@@ -1,11 +0,0 @@
1
- import { FC, MouseEventHandler } from 'react';
2
- import { icons } from './icons';
3
- type IconName = keyof typeof icons;
4
- interface IconProps {
5
- icon: IconName;
6
- className?: string;
7
- disabled?: boolean;
8
- onClick?: MouseEventHandler<HTMLSpanElement>;
9
- }
10
- export declare const Icon: FC<IconProps>;
11
- export {};
@@ -1,21 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const icons: {
3
- clear: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
4
- title?: string | undefined;
5
- }>;
6
- close: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
7
- title?: string | undefined;
8
- }>;
9
- dropdown: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
10
- title?: string | undefined;
11
- }>;
12
- delete: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
13
- title?: string | undefined;
14
- }>;
15
- plus: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
16
- title?: string | undefined;
17
- }>;
18
- minus: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
19
- title?: string | undefined;
20
- }>;
21
- };
@@ -1,3 +0,0 @@
1
- import { Icon } from './icon';
2
- export { Icon };
3
- export default Icon;
@@ -1,204 +0,0 @@
1
- import { jsx as d, jsxs as R } from "react/jsx-runtime";
2
- import { forwardRef as Q, useState as X, useRef as S } from "react";
3
- import { c as H } from "./bind-06a7ff84.js";
4
- import { Manager as Z, Reference as U, Popper as F } from "react-popper";
5
- import { useSelect as N } from "downshift";
6
- import { Scrollbars as B } from "rc-scrollbars";
7
- import { u as ee } from "./useOnClickOutside-c332f7d3.js";
8
- import { K as u } from "./keyCodes-f63c0e11.js";
9
- import { I as ne } from "./icon-71262f5c.js";
10
- const te = "_disabled_ev7l2_13", oe = "_hidden_ev7l2_17", de = "_selected_ev7l2_23", re = "_hover_ev7l2_26", le = {
11
- "dropdown-option": "_dropdown-option_ev7l2_1",
12
- disabled: te,
13
- hidden: oe,
14
- selected: de,
15
- hover: re,
16
- "single-option": "_single-option_ev7l2_39",
17
- "sub-option": "_sub-option_ev7l2_45"
18
- }, T = H.bind(le), se = Q(
19
- (t, n) => {
20
- const {
21
- option: { value: l, disabled: a, hidden: m, label: i, title: r, groupRef: b },
22
- selected: w,
23
- onChange: g,
24
- render: f,
25
- highlightHovered: E,
26
- onMouseEnter: p
27
- } = t, C = () => {
28
- g && g(l);
29
- };
30
- return /* @__PURE__ */ d(
31
- "div",
32
- {
33
- className: T("dropdown-option", {
34
- selected: w,
35
- disabled: a,
36
- hidden: m,
37
- hover: E
38
- }),
39
- title: a && r || void 0,
40
- onClick: C,
41
- ref: n,
42
- onMouseEnter: p,
43
- children: /* @__PURE__ */ d("div", { className: T("single-option", { "sub-option": !!b }), children: f ? f(t) : i })
44
- }
45
- );
46
- }
47
- ), ae = [
48
- u.ENTER_KEY_CODE,
49
- u.SPACE_KEY_CODE,
50
- u.ARROW_DOWN_KEY_CODE
51
- ], ie = [u.ESCAPE_KEY_CODE, u.TAB_KEY_CODE], ce = (t, n) => t.map(({ value: l }) => l).indexOf(n), _e = (t, n) => (t % n + n) % n, x = (t, n = 0, l = 1) => {
52
- if (!t[n].disabled)
53
- return n;
54
- const a = t.length;
55
- return x(t, _e(n + l, a));
56
- }, he = (t, n) => x(t, n), ue = (t, n) => x(t, n, -1), fe = "_container_1d54v_1", ge = "_icon_1d54v_10", pe = "_arrow_1d54v_16", ve = "_dropdown_1d54v_22", me = "_disabled_1d54v_39", be = "_error_1d54v_43", we = "_touched_1d54v_43", Ee = "_opened_1d54v_47", Ce = "_placeholder_1d54v_72", De = "_value_1d54v_75", Oe = "_ghost_1d54v_113", Ne = {
57
- container: fe,
58
- "default-width": "_default-width_1d54v_6",
59
- icon: ge,
60
- arrow: pe,
61
- dropdown: ve,
62
- "transparent-background": "_transparent-background_1d54v_36",
63
- disabled: me,
64
- error: be,
65
- touched: we,
66
- opened: Ee,
67
- placeholder: Ce,
68
- value: De,
69
- "mobile-disabled": "_mobile-disabled_1d54v_87",
70
- "select-list": "_select-list_1d54v_92",
71
- ghost: Oe
72
- }, h = H.bind(Ne), Pe = ({
73
- value: t = "",
74
- options: n = [],
75
- disabled: l = !1,
76
- error: a,
77
- onChange: m,
78
- onFocus: i,
79
- onBlur: r,
80
- mobileDisabled: b,
81
- title: w,
82
- touched: g = !1,
83
- icon: f,
84
- variant: E,
85
- placeholder: p = "",
86
- defaultWidth: C = !0,
87
- renderOption: M,
88
- transparentBackground: P = !1,
89
- className: Y,
90
- toggleButtonClassName: A
91
- }) => {
92
- const [c, _] = X(!1), y = S(null), s = S(null);
93
- ee(y, () => {
94
- c && (_(!1), r && r());
95
- });
96
- const I = (e) => {
97
- e.disabled || (m(e.value), _((o) => !o));
98
- }, W = () => n.find(({ value: e }) => e === t), K = ce(n, t), {
99
- getToggleButtonProps: $,
100
- getMenuProps: j,
101
- getItemProps: V,
102
- setHighlightedIndex: v,
103
- highlightedIndex: k,
104
- selectedItem: D
105
- } = N({
106
- items: n,
107
- itemToString: (e) => (e != null && e.label ? String(e.label) : p) || "",
108
- selectedItem: W(),
109
- isOpen: c,
110
- circularNavigation: !0,
111
- defaultHighlightedIndex: K,
112
- onHighlightedIndexChange: (e) => {
113
- switch (e.type) {
114
- case N.stateChangeTypes.MenuKeyDownArrowUp:
115
- return v(ue(n, e.highlightedIndex)), e;
116
- case N.stateChangeTypes.MenuKeyDownArrowDown:
117
- return v(he(n, e.highlightedIndex)), e;
118
- default:
119
- return e;
120
- }
121
- }
122
- }), L = () => {
123
- l || (s != null && s.current && s.current(), _((e) => !e), c ? r && r() : i && i());
124
- }, q = () => {
125
- if (!t && t !== !1)
126
- return p;
127
- let e = t;
128
- return n.forEach((o) => {
129
- o.value === t && (e = o.label);
130
- }), e;
131
- }, z = (e) => {
132
- const { keyCode: o } = e;
133
- ae.includes(o) && !c && (e.preventDefault(), v(K), s != null && s.current && s.current(), _(!0), i && i());
134
- }, G = (e) => {
135
- const { keyCode: o } = e;
136
- if (o === u.ENTER_KEY_CODE) {
137
- const O = n[k];
138
- I(O), _(!1), r && r();
139
- return;
140
- }
141
- ie.includes(o) && (e.stopPropagation(), _(!1), r && r());
142
- }, J = () => n.map((e, o) => /* @__PURE__ */ d(
143
- se,
144
- {
145
- ...V({
146
- item: e,
147
- index: o
148
- }),
149
- selected: e.value === (D == null ? void 0 : D.value),
150
- option: e,
151
- highlightHovered: k === o,
152
- render: M,
153
- onChange: e.disabled ? null : () => I(e),
154
- onMouseEnter: () => v(o)
155
- },
156
- e.value
157
- ));
158
- return /* @__PURE__ */ d(Z, { children: /* @__PURE__ */ R(
159
- "div",
160
- {
161
- ref: y,
162
- className: h("container", { "default-width": C }, Y),
163
- title: w,
164
- children: [
165
- /* @__PURE__ */ d(U, { children: ({ ref: e }) => /* @__PURE__ */ R(
166
- "button",
167
- {
168
- ...$({
169
- ref: e,
170
- tabIndex: l ? -1 : 0,
171
- className: h("dropdown", E, A, {
172
- "transparent-background": P,
173
- opened: c,
174
- disabled: l,
175
- error: a,
176
- touched: g,
177
- "mobile-disabled": b
178
- }),
179
- onClick: L,
180
- onKeyDown: z
181
- }),
182
- children: [
183
- f && /* @__PURE__ */ d("span", { className: h("icon"), children: f }),
184
- /* @__PURE__ */ d("span", { className: h("value", { placeholder: !t }), children: q() }),
185
- /* @__PURE__ */ d(ne, { icon: "dropdown", className: h("arrow") })
186
- ]
187
- }
188
- ) }),
189
- /* @__PURE__ */ d(F, { placement: "bottom-start", children: ({ ref: e, style: o, update: O }) => (s.current = O, /* @__PURE__ */ d(
190
- "div",
191
- {
192
- className: h("select-list", { opened: c }),
193
- style: o,
194
- ...j({ ref: e, onKeyDown: G }),
195
- children: /* @__PURE__ */ d(B, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: J() })
196
- }
197
- )) })
198
- ]
199
- }
200
- ) });
201
- };
202
- export {
203
- Pe as D
204
- };