@reportportal/ui-kit 0.0.1-alpha.236 → 0.0.1-alpha.238

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/modal.js CHANGED
@@ -1,182 +1,34 @@
1
- import { jsx as e, jsxs as d, Fragment as F } from "react/jsx-runtime";
2
- import { useState as N, useRef as G, useCallback as A, useEffect as x, useMemo as K } from "react";
3
- import { Scrollbars as U } from "rc-scrollbars";
4
- import { AnimatePresence as Y, motion as X } from "framer-motion";
5
- import { c as b } from "./bind-06a7ff84.js";
6
- import { u as q } from "./useOnClickOutside-8f7d68a1.js";
1
+ import { M as z, a as A, c as B, b as D } from "./index-a13c9a87.js";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "rc-scrollbars";
5
+ import "framer-motion";
6
+ import "./bind-06a7ff84.js";
7
+ import "./useOnClickOutside-8f7d68a1.js";
7
8
  import "react-dnd";
8
9
  import "react-dnd-html5-backend";
9
- import { u as J } from "./useWindowResize-a7e1ac92.js";
10
- import { A as Q } from "./constants-85822a6b.js";
11
- import { a as V } from "./dropdown-d2a05471.js";
12
- import { K as Z } from "./keyCodes-f63c0e11.js";
13
- import { B as C } from "./button-7ab874f3.js";
14
- import { Tooltip as ee } from "./tooltip.js";
15
- import { B as te } from "./baseIconButton-251479f7.js";
16
- import { S as oe } from "./close-4d480ef7.js";
10
+ import "./useWindowResize-a7e1ac92.js";
11
+ import "./dropdown-d2a05471.js";
17
12
  import "react-dom";
18
13
  import "@floating-ui/react-dom";
19
14
  import "downshift";
15
+ import "./keyCodes-f63c0e11.js";
16
+ import "./baseIconButton-251479f7.js";
20
17
  import "./clear-53660571.js";
21
18
  import "./dropdown-0260bb66.js";
22
19
  import "./fieldLabel.js";
23
20
  import "./adaptiveTagList.js";
21
+ import "./button-7ab874f3.js";
22
+ import "./close-4d480ef7.js";
24
23
  import "./isEmpty-ccacb5ff.js";
25
24
  import "./useEllipsisTitle-462fa254.js";
26
25
  import "./checkbox-76aa8f97.js";
26
+ import "./tooltip.js";
27
27
  import "@floating-ui/react";
28
28
  import "./floatingUi-46f5b896.js";
29
- const ne = {
30
- "modal-content": "_modal-content_ppzcb_1"
31
- }, ae = b.bind(ne), R = ({ children: o }) => /* @__PURE__ */ e("div", { className: ae("modal-content"), children: o }), ie = {
32
- "buttons-block": "_buttons-block_1mwne_1",
33
- "button-container": "_button-container_1mwne_7",
34
- "modal-footer": "_modal-footer_1mwne_12",
35
- "with-extra-node": "_with-extra-node_1mwne_19",
36
- "size-small": "_size-small_1mwne_23"
37
- }, f = b.bind(ie), se = ({
38
- footerNode: o,
39
- closeHandler: a,
40
- okButton: i,
41
- cancelButton: p,
42
- size: s
43
- }) => {
44
- const { tooltipNode: u, ...m } = i || {}, g = () => {
45
- const _ = /* @__PURE__ */ e(C, { adjustWidthOn: s === "small" ? "parent" : "min-width", ...m });
46
- return u ? /* @__PURE__ */ e(ee, { content: u, placement: "top", width: 270, children: _ }) : _;
47
- };
48
- return /* @__PURE__ */ d("div", { className: f("modal-footer", { "with-extra-node": o, [`size-${s}`]: s }), children: [
49
- o && o,
50
- /* @__PURE__ */ d("div", { className: f("buttons-block"), children: [
51
- p && /* @__PURE__ */ e("div", { className: f("button-container"), children: /* @__PURE__ */ e(
52
- C,
53
- {
54
- variant: "ghost",
55
- adjustWidthOn: s === "small" ? "parent" : "min-width",
56
- onClick: a,
57
- ...p
58
- }
59
- ) }),
60
- i && /* @__PURE__ */ e("div", { className: f("button-container"), children: g() })
61
- ] })
62
- ] });
63
- }, le = {
64
- "modal-header": "_modal-header_w4aaf_1",
65
- "width-description": "_width-description_w4aaf_10",
66
- "modal-header-content": "_modal-header-content_w4aaf_14",
67
- "modal-title": "_modal-title_w4aaf_20",
68
- "close-modal-icon": "_close-modal-icon_w4aaf_29"
69
- }, w = b.bind(le), re = ({ title: o, onClose: a, withDescription: i = !1 }) => /* @__PURE__ */ d("div", { className: w("modal-header", { "width-description": i }), children: [
70
- /* @__PURE__ */ e("div", { className: w("modal-header-content"), children: o && /* @__PURE__ */ e("div", { className: w("modal-title"), children: o }) }),
71
- /* @__PURE__ */ e(te, { className: w("close-modal-icon"), onClick: a, children: /* @__PURE__ */ e(oe, {}) })
72
- ] }), ce = "_modal_35896_1", de = "_description_35896_43", me = {
73
- modal: ce,
74
- "overlay-default": "_overlay-default_35896_12",
75
- "overlay-light-cyan": "_overlay-light-cyan_35896_16",
76
- "scrolling-content": "_scrolling-content_35896_20",
77
- "modal-window": "_modal-window_35896_26",
78
- description: de,
79
- "scrollable-wrapper": "_scrollable-wrapper_35896_54",
80
- "scrollable-content": "_scrollable-content_35896_58",
81
- "size-default": "_size-default_35896_62",
82
- "size-small": "_size-small_35896_74",
83
- "size-large": "_size-large_35896_86"
84
- }, c = b.bind(me), _e = 0.9, pe = 32 + 24, ue = 32 + 8, he = 36 + 16, fe = 32 * 2, Ue = ({
85
- title: o,
86
- children: a,
87
- footerNode: i,
88
- okButton: p,
89
- cancelButton: s,
90
- className: u,
91
- size: m = "default",
92
- onClose: g = () => {
93
- },
94
- overlay: _ = "default",
95
- zIndex: D = 2,
96
- allowCloseOutside: k = !0,
97
- scrollable: S = !1,
98
- withoutFooter: E = !1,
99
- createFooter: H = null,
100
- description: l = null
101
- }) => {
102
- const [v, M] = N(!1), [z, I] = N(0), [L, $] = N(!1), n = G(null), T = J().height, P = T * _e, O = (T - z) / 2, W = () => {
103
- let t = P - fe;
104
- return E || (t = t - he), l ? t = t - ue : t = t - pe, t;
105
- }, r = A(() => {
106
- M(!1);
107
- }, []), y = A(
108
- (t) => {
109
- const { keyCode: h } = t;
110
- h === Z.ESCAPE_KEY_CODE && r();
111
- },
112
- [r]
113
- ), B = () => {
114
- var t;
115
- L || ((t = n.current) == null || t.focus(), $(!0));
116
- };
117
- x(() => {
118
- if (!v || !n.current)
119
- return;
120
- const t = () => {
121
- n.current && I(n.current.clientHeight);
122
- };
123
- if (t(), typeof ResizeObserver > "u")
124
- return;
125
- const h = new ResizeObserver(t);
126
- return h.observe(n.current), () => h.disconnect();
127
- }, [v]), x(() => (M(!0), document.addEventListener("keydown", y, !1), () => document.removeEventListener("keydown", y, !1)), [y]);
128
- const j = K(
129
- () => ({
130
- ignoreSelectors: [`[${V}]`, `[${Q}]`]
131
- }),
132
- []
133
- );
134
- return q(n, k ? r : void 0, j), /* @__PURE__ */ e(Y, { onExitComplete: g, children: v && /* @__PURE__ */ e("div", { className: c("modal", { [`overlay-${_}`]: _ }), style: { zIndex: D }, children: /* @__PURE__ */ d(
135
- X.div,
136
- {
137
- className: c("modal-window", { [`size-${m}`]: m }, u),
138
- ref: n,
139
- tabIndex: 0,
140
- initial: { opacity: 0, marginTop: -O },
141
- animate: { opacity: 1, marginTop: O },
142
- exit: { opacity: 0, marginTop: -O },
143
- transition: { duration: 0.3 },
144
- onAnimationStart: B,
145
- children: [
146
- /* @__PURE__ */ e(re, { title: o, onClose: r, withDescription: !!l }),
147
- S ? /* @__PURE__ */ e("div", { className: c("scrollable-wrapper"), children: /* @__PURE__ */ e(
148
- U,
149
- {
150
- autoHeight: !0,
151
- autoHeightMax: W(),
152
- hideTracksWhenNotNeeded: !0,
153
- children: /* @__PURE__ */ d("div", { className: c("scrollable-content"), children: [
154
- l && /* @__PURE__ */ e("span", { className: c("description"), children: l }),
155
- /* @__PURE__ */ e(R, { children: a })
156
- ] })
157
- }
158
- ) }) : /* @__PURE__ */ d(F, { children: [
159
- l && /* @__PURE__ */ e("span", { className: c("description"), children: l }),
160
- /* @__PURE__ */ e(R, { children: a })
161
- ] }),
162
- !E && (H ? H(r) : /* @__PURE__ */ e(
163
- se,
164
- {
165
- size: m,
166
- footerNode: i,
167
- okButton: p,
168
- cancelButton: s,
169
- closeHandler: r
170
- }
171
- ))
172
- ]
173
- },
174
- "modal-window"
175
- ) }) });
176
- };
177
29
  export {
178
- Ue as Modal,
179
- R as ModalContent,
180
- se as ModalFooter,
181
- re as ModalHeader
30
+ z as Modal,
31
+ A as ModalContent,
32
+ B as ModalFooter,
33
+ D as ModalHeader
182
34
  };
@@ -1,21 +1,74 @@
1
- import { P as t } from "./pagination-53c8a559.js";
1
+ import { P as t } from "./index-7ddba309.js";
2
2
  import "react/jsx-runtime";
3
- import "./bind-06a7ff84.js";
4
3
  import "react";
5
- import "./popover.js";
6
- import "@floating-ui/react";
7
- import "./floatingUi-46f5b896.js";
4
+ import "./bind-06a7ff84.js";
5
+ import "rc-scrollbars";
6
+ import "./bubblesLoader-f3ffa240.js";
8
7
  import "./button-7ab874f3.js";
9
- import "./fieldText-1749da7a.js";
8
+ import "./plus-0929dda4.js";
9
+ import "./isEmpty-ccacb5ff.js";
10
+ import "react-dom";
11
+ import "downshift";
12
+ import "@floating-ui/react";
10
13
  import "./clear-53660571.js";
11
- import "./openEye-950159cb.js";
14
+ import "./prevPage-1c4a826f.js";
15
+ import "./adaptiveTagList.js";
16
+ import "./close-4d480ef7.js";
17
+ import "./actionMenu-f8a2f5bb.js";
18
+ import "./details-dbb1530b.js";
12
19
  import "./baseIconButton-251479f7.js";
13
- import "./spinLoader-c4a53718.js";
14
- import "./maxValueDisplay-9be01a75.js";
15
- import "./fieldLabel.js";
16
- import "./prevPage-87faf576.js";
20
+ import "./popover.js";
21
+ import "./floatingUi-46f5b896.js";
22
+ import "./index-d6e02727.js";
23
+ import "./xls-995781cc.js";
24
+ import "./breadcrumbs-5730e318.js";
25
+ import "es-toolkit";
26
+ import "./tree-c3dd3d45.js";
27
+ import "./bulkPanel.js";
28
+ import "./useOnClickOutside-8f7d68a1.js";
29
+ import "react-dnd";
30
+ import "react-dnd-html5-backend";
31
+ import "./keyCodes-f63c0e11.js";
32
+ import "./selection-da1a3528.js";
33
+ import "./chip.js";
17
34
  import "./tooltip.js";
18
- import "react-dom";
35
+ import "./chevronDownDropdown-0260bb66.js";
36
+ import "./warning-537ead32.js";
37
+ import "./checkbox-76aa8f97.js";
38
+ import "react-datepicker/dist/es/index.js";
39
+ import "./dropdown-d2a05471.js";
40
+ import "@floating-ui/react-dom";
41
+ import "./dropdown-0260bb66.js";
42
+ import "./fieldLabel.js";
43
+ import "./useEllipsisTitle-462fa254.js";
44
+ import "react-datepicker";
45
+ import "./fieldNumber-c9795245.js";
46
+ import "./fieldTextFlex-2f51c173.js";
47
+ import "./maxValueDisplay-9be01a75.js";
48
+ import "./fileDropArea.js";
49
+ import "react-dropzone";
50
+ import "./filtersButton.js";
51
+ import "./filterOutline-819b4b0d.js";
52
+ import "./filterItem.js";
53
+ import "./issueList.js";
54
+ import "./index-a13c9a87.js";
55
+ import "framer-motion";
56
+ import "./useWindowResize-a7e1ac92.js";
57
+ import "./radio-62546efa.js";
58
+ import "./segmentedControl.js";
59
+ import "./spinLoader-c4a53718.js";
60
+ import "./systemAlert.js";
61
+ import "./success-8fd8bd2c.js";
62
+ import "./systemMessage-924fdaa6.js";
63
+ import "./treeSortableItem-301dbd92.js";
64
+ import "./useTreeSortable-bc631689.js";
65
+ import "./common.js";
66
+ import "./table-4d35951e.js";
67
+ import "react-resizable";
68
+ import "./resizeColumn-46b5b30f.js";
69
+ import "./themeProvider-46c2be7b.js";
70
+ import "./toggle-304107fa.js";
71
+ import "./sidePanel.js";
19
72
  export {
20
73
  t as Pagination,
21
74
  t as default
@@ -0,0 +1,6 @@
1
+ import * as e from "react";
2
+ const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.31082 7.31081C2.94108 7.30926 2.6426 7.60773 2.64415 7.97748C2.64571 8.34722 2.9467 8.64822 3.31645 8.64977L12.6892 8.68919C13.0589 8.69074 13.3574 8.39227 13.3559 8.02252C13.3543 7.65278 13.0533 7.35178 12.6836 7.35023L3.31082 7.31081Z" })), C = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.00117 2.62046C7.63142 2.6189 7.33294 2.91738 7.3345 3.28712L7.35159 7.35159L3.28712 7.3345C2.91738 7.33295 2.6189 7.63142 2.62045 8.00117C2.62201 8.37091 2.92301 8.67191 3.29275 8.67346L7.35722 8.69056L7.37391 12.6599C7.37547 13.0296 7.67647 13.3306 8.04621 13.3322C8.41596 13.3337 8.71443 13.0352 8.71288 12.6655L8.69619 8.69619L12.6655 8.71288C13.0352 8.71444 13.3337 8.41596 13.3322 8.04621C13.3306 7.67647 13.0296 7.37547 12.6599 7.37392L8.69056 7.35722L8.67346 3.29275C8.67191 2.92301 8.37091 2.62201 8.00117 2.62046Z" }));
3
+ export {
4
+ l as S,
5
+ C as a
6
+ };
@@ -0,0 +1,9 @@
1
+ import * as C from "react";
2
+ const t = (e) => /* @__PURE__ */ C.createElement("svg", { width: 8, height: 13, viewBox: "0 0 8 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.54134 12.2173C6.69755 12.3735 6.95081 12.3735 7.10702 12.2173L7.24844 12.0759C7.40465 11.9197 7.40465 11.6664 7.24844 11.5102L1.90539 6.16715L7.24844 0.824097C7.40465 0.667887 7.40465 0.41462 7.24844 0.258411L7.10702 0.116989C6.95081 -0.0392199 6.69755 -0.0392199 6.54134 0.116989L0.998591 5.65973L0.999562 5.6607L0.767094 5.89317C0.610884 6.04938 0.610884 6.30265 0.767093 6.45886L1.48425 7.17602L1.49215 7.16813L6.54134 12.2173Z", fill: "#C1C7D0" })), l = (e) => /* @__PURE__ */ C.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M14.7083 10.2978C14.647 10.3327 14.5794 10.3552 14.5094 10.364C14.4394 10.3728 14.3684 10.3677 14.3004 10.3491C14.2323 10.3304 14.1687 10.2984 14.113 10.2551C14.0573 10.2118 14.0108 10.1579 13.9759 10.0966L12.7018 7.87013C11.961 8.371 11.1438 8.74832 10.2822 8.98738L10.6758 11.3493C10.6874 11.4188 10.6852 11.49 10.6693 11.5587C10.6534 11.6273 10.6242 11.6922 10.5832 11.7496C10.5422 11.8069 10.4903 11.8557 10.4305 11.893C10.3707 11.9303 10.3041 11.9554 10.2345 11.9669C10.2059 11.9716 10.177 11.9741 10.148 11.9743C10.0211 11.9741 9.89838 11.9289 9.80163 11.8468C9.70487 11.7647 9.64037 11.6509 9.61959 11.5257L9.23264 9.20667C8.41663 9.32023 7.58882 9.32023 6.77281 9.20667L6.38586 11.5257C6.36504 11.6511 6.30035 11.7651 6.20332 11.8472C6.10629 11.9294 5.98322 11.9744 5.85607 11.9743C5.82642 11.9742 5.79682 11.9717 5.76755 11.9669C5.69801 11.9554 5.63142 11.9303 5.5716 11.893C5.51178 11.8557 5.4599 11.8069 5.41892 11.7496C5.37794 11.6922 5.34866 11.6273 5.33277 11.5587C5.31687 11.49 5.31467 11.4188 5.32629 11.3493L5.72195 8.98738C4.86063 8.74757 4.04393 8.36957 3.3037 7.86812L2.03355 10.0966C1.9624 10.2206 1.84493 10.3112 1.70696 10.3485C1.569 10.3859 1.42184 10.3669 1.29788 10.2958C1.17391 10.2246 1.08328 10.1071 1.04593 9.96918C1.00857 9.83121 1.02756 9.68406 1.0987 9.56009L2.43994 7.21292C1.96883 6.80591 1.53562 6.35699 1.14565 5.87168C1.09701 5.81738 1.05995 5.75374 1.03673 5.68464C1.01351 5.61554 1.00462 5.54244 1.01059 5.46978C1.01657 5.39713 1.03729 5.32646 1.07148 5.26208C1.10568 5.19771 1.15263 5.14097 1.20948 5.09534C1.26633 5.04972 1.33189 5.01616 1.40214 4.99671C1.4724 4.97726 1.54588 4.97233 1.6181 4.98222C1.69032 4.99211 1.75977 5.01662 1.8222 5.05425C1.88464 5.09188 1.93875 5.14183 1.98124 5.20107C3.09447 6.57852 5.04194 8.21885 8.00206 8.21885C10.9622 8.21885 12.9096 6.57651 14.0229 5.20107C14.0649 5.14062 14.1189 5.08946 14.1815 5.05077C14.2441 5.01209 14.314 4.9867 14.3869 4.9762C14.4597 4.96569 14.534 4.97029 14.605 4.9897C14.676 5.00912 14.7422 5.04294 14.7996 5.08905C14.857 5.13517 14.9042 5.1926 14.9384 5.25777C14.9727 5.32294 14.9931 5.39445 14.9985 5.46786C15.0039 5.54127 14.9941 5.615 14.9698 5.68448C14.9455 5.75395 14.9071 5.81767 14.8571 5.87168C14.4672 6.35699 14.0339 6.80591 13.5628 7.21292L14.9041 9.56009C14.9401 9.62128 14.9636 9.689 14.9732 9.75933C14.9829 9.82967 14.9784 9.90122 14.9602 9.96983C14.942 10.0384 14.9104 10.1028 14.8671 10.1591C14.8239 10.2154 14.7699 10.2625 14.7083 10.2978Z", fill: "#A2AAB5" })), n = (e) => /* @__PURE__ */ C.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M13.9655 7.838C13.948 7.7985 13.5245 6.859 12.583 5.9175C11.3285 4.663 9.744 4 8 4C6.256 4 4.6715 4.663 3.417 5.9175C2.4755 6.859 2.05 7.8 2.0345 7.838C2.01175 7.88916 2 7.94452 2 8.0005C2 8.05648 2.01175 8.11184 2.0345 8.163C2.052 8.2025 2.4755 9.1415 3.417 10.083C4.6715 11.337 6.256 12 8 12C9.744 12 11.3285 11.337 12.583 10.083C13.5245 9.1415 13.948 8.2025 13.9655 8.163C13.9882 8.11184 14 8.05648 14 8.0005C14 7.94452 13.9882 7.88916 13.9655 7.838ZM8 11.2C6.461 11.2 5.1165 10.6405 4.0035 9.5375C3.54682 9.08335 3.15829 8.56548 2.85 8C3.15821 7.43447 3.54674 6.91659 4.0035 6.4625C5.1165 5.3595 6.461 4.8 8 4.8C9.539 4.8 10.8835 5.3595 11.9965 6.4625C12.4541 6.91648 12.8434 7.43436 13.1525 8C12.792 8.673 11.2215 11.2 8 11.2ZM8 5.6C7.52532 5.6 7.06131 5.74076 6.66663 6.00447C6.27195 6.26819 5.96434 6.64302 5.78269 7.08156C5.60104 7.5201 5.55351 8.00266 5.64611 8.46822C5.73872 8.93377 5.9673 9.36141 6.30294 9.69706C6.63859 10.0327 7.06623 10.2613 7.53178 10.3539C7.99734 10.4465 8.4799 10.399 8.91844 10.2173C9.35698 10.0357 9.73181 9.72805 9.99553 9.33337C10.2592 8.93869 10.4 8.47468 10.4 8C10.3993 7.36368 10.1463 6.75362 9.69633 6.30367C9.24638 5.85373 8.63632 5.60066 8 5.6ZM8 9.6C7.68355 9.6 7.37421 9.50616 7.11109 9.33035C6.84797 9.15454 6.64289 8.90465 6.52179 8.61229C6.40069 8.31993 6.36901 7.99823 6.43074 7.68786C6.49248 7.37749 6.64486 7.09239 6.86863 6.86863C7.09239 6.64487 7.37749 6.49248 7.68786 6.43074C7.99823 6.36901 8.31993 6.40069 8.61229 6.52179C8.90466 6.64289 9.15454 6.84797 9.33035 7.11109C9.50616 7.37421 9.6 7.68355 9.6 8C9.6 8.42435 9.43143 8.83131 9.13137 9.13137C8.83131 9.43143 8.42435 9.6 8 9.6Z", fill: "#A2AAB5" })), w = (e) => /* @__PURE__ */ C.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 12L2 12L2 2.38498e-08L1.90798e-07 0L0 12ZM13 1L5 6L13 11L13 1Z" })), i = (e) => /* @__PURE__ */ C.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#A2AAB5", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M12 13L4 8L12 3L12 13Z" }));
3
+ export {
4
+ t as S,
5
+ l as a,
6
+ n as b,
7
+ w as c,
8
+ i as d
9
+ };
@@ -0,0 +1,76 @@
1
+ import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
+ import { useRef as g, useId as k } from "react";
3
+ import { c as p } from "./bind-06a7ff84.js";
4
+ import { K as o } from "./keyCodes-f63c0e11.js";
5
+ const y = "_disabled_1fetm_9", E = "_toggler_1fetm_15", x = "_checked_1fetm_21", C = "_input_1fetm_28", D = {
6
+ "radio-button": "_radio-button_1fetm_1",
7
+ disabled: y,
8
+ "children-container": "_children-container_1fetm_12",
9
+ toggler: E,
10
+ checked: x,
11
+ input: C
12
+ }, a = p.bind(D), j = ({
13
+ option: e,
14
+ value: u,
15
+ onChange: b,
16
+ onFocus: K,
17
+ onBlur: N,
18
+ className: _,
19
+ ...m
20
+ }) => {
21
+ const d = g(null), l = k(), s = String(e.value) === String(u), f = (c) => {
22
+ var n, i;
23
+ const { keyCode: r } = c;
24
+ if (r === o.SPACE_KEY_CODE) {
25
+ c.preventDefault(), (n = d.current) == null || n.click();
26
+ return;
27
+ }
28
+ r === o.ENTER_KEY_CODE && (c.preventDefault(), (i = d.current) == null || i.click());
29
+ };
30
+ return (
31
+ // eslint-disable-next-line
32
+ /* @__PURE__ */ h(
33
+ "label",
34
+ {
35
+ id: l,
36
+ className: a(_, "radio-button", {
37
+ disabled: e.disabled
38
+ }),
39
+ tabIndex: e.disabled ? -1 : 0,
40
+ onKeyDown: e.disabled ? void 0 : f,
41
+ children: [
42
+ /* @__PURE__ */ t(
43
+ "input",
44
+ {
45
+ tabIndex: -1,
46
+ ref: d,
47
+ type: "radio",
48
+ className: a("input"),
49
+ disabled: e.disabled,
50
+ onChange: b,
51
+ value: e.value,
52
+ checked: s,
53
+ ...m
54
+ }
55
+ ),
56
+ /* @__PURE__ */ t(
57
+ "span",
58
+ {
59
+ role: "radio",
60
+ "aria-labelledby": l,
61
+ "aria-checked": s,
62
+ className: a("toggler", {
63
+ disabled: e.disabled,
64
+ checked: s
65
+ })
66
+ }
67
+ ),
68
+ /* @__PURE__ */ t("span", { className: a("children-container"), children: e.label })
69
+ ]
70
+ }
71
+ )
72
+ );
73
+ };
74
+ export {
75
+ j as R
76
+ };
package/dist/radio.js CHANGED
@@ -1,11 +1,11 @@
1
- import { R as r } from "./radioGroup-0c132c2e.js";
2
- import { a as e } from "./radioGroup-0c132c2e.js";
1
+ import { R as r } from "./radio-62546efa.js";
2
+ import { R as d } from "./radioGroup-183d7a6f.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "./bind-06a7ff84.js";
6
6
  import "./keyCodes-f63c0e11.js";
7
7
  export {
8
8
  r as Radio,
9
- e as RadioGroup,
9
+ d as RadioGroup,
10
10
  r as default
11
11
  };
@@ -0,0 +1,6 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { R as l } from "./radio-62546efa.js";
3
+ const d = ({ options: r, value: a, ...e }) => /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column" }, children: r.map((o) => /* @__PURE__ */ i(l, { option: o, value: a, ...e }, o.value)) });
4
+ export {
5
+ d as R
6
+ };