@egov3/system-design 2.2.8 → 2.2.11
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/index.cjs +499 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +411 -1
- package/dist/index.css.map +1 -1
- package/dist/{index.d.mts → index.d.cts} +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +466 -1
- package/dist/index.js.map +1 -1
- package/package.json +24 -38
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1,466 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/Accordion/Accordion.module.css
|
|
2
|
+
var Accordion_default = {};
|
|
3
|
+
|
|
4
|
+
// src/utils/joinClasses.tsx
|
|
5
|
+
var joinClasses = (...args) => args.filter((item) => !!item).join(" ");
|
|
6
|
+
|
|
7
|
+
// src/components/Accordion/index.tsx
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var Accordion = ({
|
|
10
|
+
open,
|
|
11
|
+
setOpen,
|
|
12
|
+
children,
|
|
13
|
+
title
|
|
14
|
+
}) => {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsxs(
|
|
17
|
+
"button",
|
|
18
|
+
{
|
|
19
|
+
"data-testid": "Accordion_BUTTON",
|
|
20
|
+
className: Accordion_default.accordionBtn,
|
|
21
|
+
onClick: () => {
|
|
22
|
+
setOpen(!open);
|
|
23
|
+
},
|
|
24
|
+
children: [
|
|
25
|
+
title,
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
"data-testid": "Accordion_DIRECTION",
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
width: "20",
|
|
32
|
+
height: "20",
|
|
33
|
+
viewBox: "0 0 20 20",
|
|
34
|
+
fill: "none",
|
|
35
|
+
style: {
|
|
36
|
+
transform: !open ? "none" : "rotate(0.5turn)"
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx("path", { d: "M15.8346 7.5L10.0013 13.3333L4.16797 7.5", stroke: "#758393" })
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
"data-testid": "Accordion_CONTENT",
|
|
48
|
+
className: joinClasses(
|
|
49
|
+
Accordion_default.accordionContent,
|
|
50
|
+
!open && Accordion_default[`accordionContent--hidden`]
|
|
51
|
+
),
|
|
52
|
+
children
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/components/Button/button.module.css
|
|
59
|
+
var button_default = {};
|
|
60
|
+
|
|
61
|
+
// src/styles/typography.module.css
|
|
62
|
+
var typography_default = {};
|
|
63
|
+
|
|
64
|
+
// src/components/Button/index.tsx
|
|
65
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
66
|
+
var btnTypography = {
|
|
67
|
+
mini: typography_default.Caption2Medium,
|
|
68
|
+
small: typography_default.Caption1Medium,
|
|
69
|
+
medium: typography_default.Body2Medium,
|
|
70
|
+
large: typography_default.Body1Medium
|
|
71
|
+
};
|
|
72
|
+
var Button = ({
|
|
73
|
+
onClick,
|
|
74
|
+
children,
|
|
75
|
+
style,
|
|
76
|
+
className = "",
|
|
77
|
+
isRounded = false,
|
|
78
|
+
disabled = false,
|
|
79
|
+
variant = "default",
|
|
80
|
+
size = "medium",
|
|
81
|
+
ariaLabel = "\u041A\u043D\u043E\u043F\u043A\u0430"
|
|
82
|
+
}) => /* @__PURE__ */ jsx2(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
"data-testid": "Button_MAIN",
|
|
86
|
+
"aria-label": ariaLabel,
|
|
87
|
+
disabled,
|
|
88
|
+
"aria-disabled": disabled,
|
|
89
|
+
onClick,
|
|
90
|
+
className: joinClasses(
|
|
91
|
+
button_default[`btn--${size}`],
|
|
92
|
+
btnTypography[size],
|
|
93
|
+
isRounded ? button_default[`btn-rounded--${size}`] : button_default[`btn-square--${size}`],
|
|
94
|
+
disabled ? button_default[`btn-${variant}--disabled`] : button_default[`btn-${variant}`],
|
|
95
|
+
button_default.button,
|
|
96
|
+
className
|
|
97
|
+
),
|
|
98
|
+
style,
|
|
99
|
+
children
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// src/components/InputField/index.tsx
|
|
104
|
+
import { forwardRef } from "react";
|
|
105
|
+
|
|
106
|
+
// src/components/InputField/InputField.module.css
|
|
107
|
+
var InputField_default = {};
|
|
108
|
+
|
|
109
|
+
// src/svg/ClearIcon.tsx
|
|
110
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
111
|
+
var ClearIcon = ({
|
|
112
|
+
fill = "none",
|
|
113
|
+
pathFill = "#fff",
|
|
114
|
+
width = 20,
|
|
115
|
+
height = 20,
|
|
116
|
+
...props
|
|
117
|
+
}) => {
|
|
118
|
+
return /* @__PURE__ */ jsx3(
|
|
119
|
+
"svg",
|
|
120
|
+
{
|
|
121
|
+
"data-testid": "Icons_CLEAR",
|
|
122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
+
width,
|
|
124
|
+
height,
|
|
125
|
+
fill,
|
|
126
|
+
viewBox: "0 0 20 20",
|
|
127
|
+
...props,
|
|
128
|
+
children: /* @__PURE__ */ jsx3(
|
|
129
|
+
"path",
|
|
130
|
+
{
|
|
131
|
+
fill: pathFill,
|
|
132
|
+
fillRule: "evenodd",
|
|
133
|
+
d: "M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666zM7.5 6.027L6.027 7.5l2.5 2.5-2.5 2.5L7.5 13.973l2.5-2.5 2.5 2.5 1.473-1.473-2.5-2.5 2.5-2.5L12.5 6.027l-2.5 2.5-2.5-2.5z",
|
|
134
|
+
clipRule: "evenodd"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// src/components/InputField/index.tsx
|
|
142
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
143
|
+
var InputField = forwardRef(
|
|
144
|
+
({
|
|
145
|
+
onFocus,
|
|
146
|
+
onBlur,
|
|
147
|
+
onChange,
|
|
148
|
+
onEnterPress,
|
|
149
|
+
value = "",
|
|
150
|
+
inputLeftIcon,
|
|
151
|
+
placeholder = "",
|
|
152
|
+
className = "",
|
|
153
|
+
style,
|
|
154
|
+
isClearable = false,
|
|
155
|
+
type = "text",
|
|
156
|
+
id,
|
|
157
|
+
labelText = "",
|
|
158
|
+
ariaLabel = "",
|
|
159
|
+
focused = false,
|
|
160
|
+
setFocused = () => {
|
|
161
|
+
},
|
|
162
|
+
readOnly = false
|
|
163
|
+
}, ref) => {
|
|
164
|
+
const handleClear = () => {
|
|
165
|
+
if (onChange) {
|
|
166
|
+
onChange({
|
|
167
|
+
target: { value: "" }
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const handleFocus = () => {
|
|
172
|
+
setFocused(true);
|
|
173
|
+
if (onFocus) onFocus();
|
|
174
|
+
};
|
|
175
|
+
const handleBlur = () => {
|
|
176
|
+
setFocused(false);
|
|
177
|
+
if (onBlur) onBlur();
|
|
178
|
+
};
|
|
179
|
+
const handleKeyDown = (event) => {
|
|
180
|
+
if (onEnterPress && event.key === "Enter") {
|
|
181
|
+
onEnterPress(event);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
return /* @__PURE__ */ jsxs2(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
"data-testid": "InputField_MAIN",
|
|
188
|
+
className: joinClasses(
|
|
189
|
+
InputField_default[labelText.length ? "inputContainerLabeled" : "inputContainer"],
|
|
190
|
+
focused ? InputField_default[`input--onfocus`] : void 0,
|
|
191
|
+
InputField_default[`input-${type?.toLocaleLowerCase()}`],
|
|
192
|
+
className
|
|
193
|
+
),
|
|
194
|
+
style,
|
|
195
|
+
children: [
|
|
196
|
+
labelText.length > 0 && /* @__PURE__ */ jsx4("label", { htmlFor: id, "data-testid": "InputField_LABEL", children: labelText }),
|
|
197
|
+
inputLeftIcon,
|
|
198
|
+
/* @__PURE__ */ jsx4(
|
|
199
|
+
"input",
|
|
200
|
+
{
|
|
201
|
+
ref,
|
|
202
|
+
"data-testid": "InputField_INPUT",
|
|
203
|
+
"aria-label": ariaLabel,
|
|
204
|
+
id,
|
|
205
|
+
type,
|
|
206
|
+
className: InputField_default.input,
|
|
207
|
+
placeholder,
|
|
208
|
+
"aria-placeholder": placeholder,
|
|
209
|
+
onFocus: handleFocus,
|
|
210
|
+
onBlur: handleBlur,
|
|
211
|
+
onChange,
|
|
212
|
+
onKeyDown: handleKeyDown,
|
|
213
|
+
value,
|
|
214
|
+
readOnly
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
isClearable && value && /* @__PURE__ */ jsx4(
|
|
218
|
+
ClearIcon,
|
|
219
|
+
{
|
|
220
|
+
fill: "red",
|
|
221
|
+
pathFill: "#758393",
|
|
222
|
+
className: InputField_default.clearIcon,
|
|
223
|
+
onClick: handleClear
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
// src/components/Modal/index.tsx
|
|
233
|
+
import Icons from "@egov3/graphics";
|
|
234
|
+
|
|
235
|
+
// src/components/Modal/Modal.module.css
|
|
236
|
+
var Modal_default = {};
|
|
237
|
+
|
|
238
|
+
// src/components/Modal/index.tsx
|
|
239
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
240
|
+
var Modal = ({
|
|
241
|
+
open,
|
|
242
|
+
setOpen,
|
|
243
|
+
children,
|
|
244
|
+
headerTitle,
|
|
245
|
+
variant
|
|
246
|
+
}) => {
|
|
247
|
+
if (open) {
|
|
248
|
+
return /* @__PURE__ */ jsx5("div", { "data-testid": "Modal_OVERLAY", className: Modal_default.overlay, children: /* @__PURE__ */ jsxs3(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
"data-testid": "Modal_WRAPPER",
|
|
252
|
+
className: joinClasses(
|
|
253
|
+
Modal_default.contentWrap,
|
|
254
|
+
Modal_default[`${variant}Variant`]
|
|
255
|
+
),
|
|
256
|
+
children: [
|
|
257
|
+
headerTitle && headerTitle.length > 0 && /* @__PURE__ */ jsxs3("div", { "data-testid": "Modal_HEADER", className: Modal_default.contentHeader, children: [
|
|
258
|
+
/* @__PURE__ */ jsx5(
|
|
259
|
+
Components.Typography,
|
|
260
|
+
{
|
|
261
|
+
tag: "h3",
|
|
262
|
+
fontClass: "Body1Medium",
|
|
263
|
+
"data-testid": "Modal_TITLE",
|
|
264
|
+
className: Modal_default.title,
|
|
265
|
+
children: headerTitle
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsx5(
|
|
269
|
+
"button",
|
|
270
|
+
{
|
|
271
|
+
"data-testid": "ModalHeader_BTN",
|
|
272
|
+
onClick: () => {
|
|
273
|
+
setOpen(!open);
|
|
274
|
+
},
|
|
275
|
+
children: /* @__PURE__ */ jsx5(Icons.General.Close, { "data-testid": "Modal_ICON" })
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
] }),
|
|
279
|
+
children
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
) });
|
|
283
|
+
} else {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
// src/components/RadioGroup/RadioGroup.module.css
|
|
289
|
+
var RadioGroup_default = {};
|
|
290
|
+
|
|
291
|
+
// src/components/RadioGroup/index.tsx
|
|
292
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
293
|
+
var CustomRadioButton = ({
|
|
294
|
+
label,
|
|
295
|
+
name,
|
|
296
|
+
checked,
|
|
297
|
+
onChange,
|
|
298
|
+
value
|
|
299
|
+
}) => /* @__PURE__ */ jsxs4("label", { "data-testid": "RadioGroupItem_LABEL", className: RadioGroup_default.radio, children: [
|
|
300
|
+
/* @__PURE__ */ jsx6(
|
|
301
|
+
"input",
|
|
302
|
+
{
|
|
303
|
+
"data-testid": "RadioGroupItem_INPUT",
|
|
304
|
+
value,
|
|
305
|
+
type: "radio",
|
|
306
|
+
name,
|
|
307
|
+
checked,
|
|
308
|
+
onChange
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/* @__PURE__ */ jsx6("span", { "data-testid": "RadioGroupItem_RADIO", className: RadioGroup_default.radioBtn }),
|
|
312
|
+
/* @__PURE__ */ jsx6(
|
|
313
|
+
"span",
|
|
314
|
+
{
|
|
315
|
+
"data-testid": "RadioGroupItem_TEXT",
|
|
316
|
+
className: joinClasses(RadioGroup_default.radioBtnText, typography_default.Body2Regular),
|
|
317
|
+
children: label
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
] });
|
|
321
|
+
var RadioGroup = ({
|
|
322
|
+
RadioGroupItems,
|
|
323
|
+
invokeCustomOnChange,
|
|
324
|
+
setSelectedOption,
|
|
325
|
+
selectedOption
|
|
326
|
+
}) => {
|
|
327
|
+
const handleChange = (event) => {
|
|
328
|
+
setSelectedOption(event.target.value);
|
|
329
|
+
invokeCustomOnChange(event);
|
|
330
|
+
};
|
|
331
|
+
return /* @__PURE__ */ jsx6("fieldset", { "data-testid": "RadioGroup_FIELDSET", children: RadioGroupItems.map((item) => /* @__PURE__ */ jsx6(
|
|
332
|
+
CustomRadioButton,
|
|
333
|
+
{
|
|
334
|
+
label: item.label,
|
|
335
|
+
name: "radio",
|
|
336
|
+
checked: selectedOption === item.value,
|
|
337
|
+
onChange: handleChange,
|
|
338
|
+
value: item.value
|
|
339
|
+
},
|
|
340
|
+
item.label
|
|
341
|
+
)) });
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
// src/components/RadioToggle/RadioToggle.module.css
|
|
345
|
+
var RadioToggle_default = {};
|
|
346
|
+
|
|
347
|
+
// src/components/RadioToggle/index.tsx
|
|
348
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
349
|
+
var RadioToggle = ({ lock, setLock }) => /* @__PURE__ */ jsx7(
|
|
350
|
+
"button",
|
|
351
|
+
{
|
|
352
|
+
"data-testid": "RadioToggle_BUTTON",
|
|
353
|
+
"aria-pressed": lock,
|
|
354
|
+
"aria-label": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F",
|
|
355
|
+
onClick: () => {
|
|
356
|
+
setLock(!lock);
|
|
357
|
+
},
|
|
358
|
+
children: /* @__PURE__ */ jsx7(
|
|
359
|
+
"div",
|
|
360
|
+
{
|
|
361
|
+
"data-testid": "RadioToggle_WRAP",
|
|
362
|
+
className: joinClasses(RadioToggle_default.wrap, lock && RadioToggle_default.wrapLock),
|
|
363
|
+
children: /* @__PURE__ */ jsx7("div", { "data-testid": "RadioToggle_ROUND", className: RadioToggle_default.round })
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
// src/components/SelectBoxButton/index.tsx
|
|
370
|
+
import Icons2 from "@egov3/graphics";
|
|
371
|
+
|
|
372
|
+
// src/components/SelectBoxButton/SelectBoxButton.module.css
|
|
373
|
+
var SelectBoxButton_default = {};
|
|
374
|
+
|
|
375
|
+
// src/components/SelectBoxButton/index.tsx
|
|
376
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
377
|
+
var SelectBoxButton = ({
|
|
378
|
+
setIsOpen,
|
|
379
|
+
labelText,
|
|
380
|
+
disabled,
|
|
381
|
+
error,
|
|
382
|
+
modalValue
|
|
383
|
+
}) => /* @__PURE__ */ jsxs5(
|
|
384
|
+
"button",
|
|
385
|
+
{
|
|
386
|
+
"data-testid": "SelectBoxModal_BUTTON",
|
|
387
|
+
className: SelectBoxButton_default.selectContainer,
|
|
388
|
+
onClick: () => !disabled && setIsOpen(true),
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ jsxs5("div", { "data-testid": "SelectBoxModal_TITLE", children: [
|
|
391
|
+
/* @__PURE__ */ jsx8(
|
|
392
|
+
Components.Typography,
|
|
393
|
+
{
|
|
394
|
+
tag: "label",
|
|
395
|
+
fontClass: "Caption1Regular",
|
|
396
|
+
"data-testid": "SelectBoxModal_LABEL",
|
|
397
|
+
className: error ? SelectBoxButton_default.errorLabel : SelectBoxButton_default.label,
|
|
398
|
+
"aria-label": labelText,
|
|
399
|
+
children: labelText
|
|
400
|
+
}
|
|
401
|
+
),
|
|
402
|
+
modalValue && modalValue.length > 0 && /* @__PURE__ */ jsx8(
|
|
403
|
+
Components.Typography,
|
|
404
|
+
{
|
|
405
|
+
tag: "div",
|
|
406
|
+
fontClass: "Body2Regular",
|
|
407
|
+
"data-testid": "SelectBoxModal_VALUE",
|
|
408
|
+
className: SelectBoxButton_default.selectText,
|
|
409
|
+
"aria-label": modalValue,
|
|
410
|
+
children: modalValue
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
] }),
|
|
414
|
+
/* @__PURE__ */ jsx8(
|
|
415
|
+
Icons2.Basic.ChevronDownSmall,
|
|
416
|
+
{
|
|
417
|
+
"aria-label": "\u043A\u043D\u043E\u043F\u043A\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C",
|
|
418
|
+
fill: "#758393",
|
|
419
|
+
className: SelectBoxButton_default.clearIcon
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
// src/components/Typography/index.tsx
|
|
427
|
+
import React2 from "react";
|
|
428
|
+
var Typography = ({
|
|
429
|
+
tag,
|
|
430
|
+
fontClass,
|
|
431
|
+
className,
|
|
432
|
+
children,
|
|
433
|
+
style,
|
|
434
|
+
...restProps
|
|
435
|
+
}) => React2.createElement(
|
|
436
|
+
tag,
|
|
437
|
+
{
|
|
438
|
+
...restProps,
|
|
439
|
+
className: joinClasses(fontClass ? typography_default[fontClass] : "", className),
|
|
440
|
+
style
|
|
441
|
+
},
|
|
442
|
+
children
|
|
443
|
+
);
|
|
444
|
+
|
|
445
|
+
// src/components/index.ts
|
|
446
|
+
var Components = {
|
|
447
|
+
Accordion,
|
|
448
|
+
Button,
|
|
449
|
+
CustomRadioButton,
|
|
450
|
+
InputField,
|
|
451
|
+
Modal,
|
|
452
|
+
RadioGroup,
|
|
453
|
+
RadioToggle,
|
|
454
|
+
SelectBoxButton,
|
|
455
|
+
Typography
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
// src/index.tsx
|
|
459
|
+
var SystemDesign = {
|
|
460
|
+
Components
|
|
461
|
+
};
|
|
462
|
+
var index_default = SystemDesign;
|
|
463
|
+
export {
|
|
464
|
+
index_default as default
|
|
465
|
+
};
|
|
466
|
+
//# sourceMappingURL=index.js.map
|