@bigtablet/design-system 1.2.3 → 1.2.4
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.css +0 -139
- package/dist/index.d.ts +1 -10
- package/dist/index.js +19 -47
- package/package.json +2 -3
package/dist/index.css
CHANGED
|
@@ -409,145 +409,6 @@
|
|
|
409
409
|
border-color: #000000;
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
/* src/ui/form/markdown/style.scss */
|
|
413
|
-
.md {
|
|
414
|
-
display: grid;
|
|
415
|
-
gap: 0.5rem;
|
|
416
|
-
}
|
|
417
|
-
.md__label {
|
|
418
|
-
font-size: 0.875rem;
|
|
419
|
-
font-weight: 400;
|
|
420
|
-
line-height: 1.5;
|
|
421
|
-
color: #6B7280;
|
|
422
|
-
}
|
|
423
|
-
.md__grid {
|
|
424
|
-
display: grid;
|
|
425
|
-
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
426
|
-
align-items: stretch;
|
|
427
|
-
column-gap: 1.5rem;
|
|
428
|
-
row-gap: 0.75rem;
|
|
429
|
-
}
|
|
430
|
-
@media (max-width: 960px) {
|
|
431
|
-
.md__grid {
|
|
432
|
-
grid-template-columns: 1fr;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
.md__input,
|
|
436
|
-
.md__preview {
|
|
437
|
-
min-width: 0;
|
|
438
|
-
box-sizing: border-box;
|
|
439
|
-
max-width: 100%;
|
|
440
|
-
overflow: auto;
|
|
441
|
-
}
|
|
442
|
-
.md__input {
|
|
443
|
-
width: 100%;
|
|
444
|
-
min-height: 300px;
|
|
445
|
-
border: 1px solid #e5e5e5;
|
|
446
|
-
border-radius: 8px;
|
|
447
|
-
padding: 0.75rem;
|
|
448
|
-
background: #ffffff;
|
|
449
|
-
font-size: 0.9375rem;
|
|
450
|
-
font-weight: 400;
|
|
451
|
-
line-height: 1.5;
|
|
452
|
-
color: #3B3B3B;
|
|
453
|
-
line-height: 1.75;
|
|
454
|
-
resize: vertical;
|
|
455
|
-
transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
|
|
456
|
-
}
|
|
457
|
-
.md__input:hover {
|
|
458
|
-
border-color: rgba(0, 0, 0, 0.08);
|
|
459
|
-
}
|
|
460
|
-
.md__input:focus {
|
|
461
|
-
border-color: #000000;
|
|
462
|
-
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
|
|
463
|
-
outline: none;
|
|
464
|
-
}
|
|
465
|
-
.md__preview {
|
|
466
|
-
min-height: 300px;
|
|
467
|
-
border: 1px solid #e5e5e5;
|
|
468
|
-
border-radius: 8px;
|
|
469
|
-
background: #ffffff;
|
|
470
|
-
padding: 0.75rem;
|
|
471
|
-
}
|
|
472
|
-
.markdown-body {
|
|
473
|
-
font-size: 0.9375rem;
|
|
474
|
-
font-weight: 400;
|
|
475
|
-
line-height: 1.5;
|
|
476
|
-
color: #3B3B3B;
|
|
477
|
-
line-height: 1.7;
|
|
478
|
-
word-break: break-word;
|
|
479
|
-
overflow-wrap: anywhere;
|
|
480
|
-
}
|
|
481
|
-
.markdown-body img,
|
|
482
|
-
.markdown-body video {
|
|
483
|
-
max-width: 100%;
|
|
484
|
-
height: auto;
|
|
485
|
-
display: block;
|
|
486
|
-
}
|
|
487
|
-
.markdown-body h1,
|
|
488
|
-
.markdown-body h2,
|
|
489
|
-
.markdown-body h3,
|
|
490
|
-
.markdown-body h4,
|
|
491
|
-
.markdown-body h5,
|
|
492
|
-
.markdown-body h6 {
|
|
493
|
-
font-size: 1.25rem;
|
|
494
|
-
font-weight: 600;
|
|
495
|
-
line-height: 1.3;
|
|
496
|
-
color: #1F2937;
|
|
497
|
-
margin: 1rem 0 0.5rem;
|
|
498
|
-
}
|
|
499
|
-
.markdown-body p {
|
|
500
|
-
margin: 0.5rem 0;
|
|
501
|
-
}
|
|
502
|
-
.markdown-body a {
|
|
503
|
-
color: #000000;
|
|
504
|
-
text-decoration: underline;
|
|
505
|
-
}
|
|
506
|
-
.markdown-body ul,
|
|
507
|
-
.markdown-body ol {
|
|
508
|
-
margin: 0.5rem 0 0.5rem 1rem;
|
|
509
|
-
}
|
|
510
|
-
.markdown-body blockquote {
|
|
511
|
-
border-left: 4px solid #e5e5e5;
|
|
512
|
-
padding-left: 0.75rem;
|
|
513
|
-
color: #6B7280;
|
|
514
|
-
margin: 0.5rem 0;
|
|
515
|
-
}
|
|
516
|
-
.markdown-body table {
|
|
517
|
-
width: 100%;
|
|
518
|
-
border-collapse: collapse;
|
|
519
|
-
margin: 0.75rem 0;
|
|
520
|
-
}
|
|
521
|
-
.markdown-body table th,
|
|
522
|
-
.markdown-body table td {
|
|
523
|
-
border: 1px solid #e5e5e5;
|
|
524
|
-
padding: 0.5rem 0.75rem;
|
|
525
|
-
text-align: left;
|
|
526
|
-
}
|
|
527
|
-
.markdown-body table th {
|
|
528
|
-
background: #fafafa;
|
|
529
|
-
}
|
|
530
|
-
.markdown-body code {
|
|
531
|
-
background: #fafafa;
|
|
532
|
-
padding: 2px 6px;
|
|
533
|
-
border-radius: 6px;
|
|
534
|
-
font-family:
|
|
535
|
-
ui-monospace,
|
|
536
|
-
SFMono-Regular,
|
|
537
|
-
Menlo,
|
|
538
|
-
monospace;
|
|
539
|
-
}
|
|
540
|
-
.markdown-body pre {
|
|
541
|
-
background: #fafafa;
|
|
542
|
-
padding: 0.75rem;
|
|
543
|
-
border-radius: 8px;
|
|
544
|
-
overflow: auto;
|
|
545
|
-
}
|
|
546
|
-
.markdown-body pre code {
|
|
547
|
-
background: transparent;
|
|
548
|
-
padding: 0;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
412
|
/* src/ui/form/radio/style.scss */
|
|
552
413
|
.radio {
|
|
553
414
|
display: inline-flex;
|
package/dist/index.d.ts
CHANGED
|
@@ -81,15 +81,6 @@ interface FileInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
81
81
|
}
|
|
82
82
|
declare const FileInput: ({ label, onFiles, className, ...props }: FileInputProps) => react_jsx_runtime.JSX.Element;
|
|
83
83
|
|
|
84
|
-
type MarkdownEditorProps = {
|
|
85
|
-
label?: string;
|
|
86
|
-
placeholder?: string;
|
|
87
|
-
value: string;
|
|
88
|
-
onChangeAction: (val: string) => void;
|
|
89
|
-
rows?: number;
|
|
90
|
-
};
|
|
91
|
-
declare const MarkdownEditor: ({ label, placeholder, value, onChangeAction, rows, }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
92
|
-
|
|
93
84
|
interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
94
85
|
label?: React.ReactNode;
|
|
95
86
|
size?: "sm" | "md" | "lg";
|
|
@@ -165,4 +156,4 @@ declare const SkeletonCard: () => react_jsx_runtime.JSX.Element;
|
|
|
165
156
|
|
|
166
157
|
declare const SkeletonList: () => react_jsx_runtime.JSX.Element;
|
|
167
158
|
|
|
168
|
-
export { Alert, AlertProvider, Button, Card, Checkbox, FileInput, Loading,
|
|
159
|
+
export { Alert, AlertProvider, Button, Card, Checkbox, FileInput, Loading, Modal, Pagination, Radio, Select, SkeletonCard, SkeletonList, Switch, TextField, ToastProvider, useAlert, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './index.css';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import * as
|
|
4
|
+
import * as React3 from 'react';
|
|
5
5
|
import { createContext, useContext, useState, useCallback } from 'react';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
7
7
|
import { ToastContainer, Slide, toast } from 'react-toastify';
|
|
8
8
|
import 'react-toastify/dist/ReactToastify.css';
|
|
9
|
-
import ReactMarkdown from 'react-markdown';
|
|
10
|
-
import remarkGfm from 'remark-gfm';
|
|
11
9
|
import { ChevronDown, Check } from 'lucide-react';
|
|
12
10
|
|
|
13
11
|
// src/ui/display/card/index.tsx
|
|
@@ -253,8 +251,8 @@ var Checkbox = ({
|
|
|
253
251
|
className,
|
|
254
252
|
...props
|
|
255
253
|
}) => {
|
|
256
|
-
const ref =
|
|
257
|
-
|
|
254
|
+
const ref = React3.useRef(null);
|
|
255
|
+
React3.useEffect(() => {
|
|
258
256
|
if (ref.current) ref.current.indeterminate = !!indeterminate;
|
|
259
257
|
}, [indeterminate]);
|
|
260
258
|
return /* @__PURE__ */ jsxs(
|
|
@@ -275,7 +273,7 @@ var FileInput = ({
|
|
|
275
273
|
className,
|
|
276
274
|
...props
|
|
277
275
|
}) => {
|
|
278
|
-
const id =
|
|
276
|
+
const id = React3.useId();
|
|
279
277
|
return /* @__PURE__ */ jsxs("div", { className: ["file", className].filter(Boolean).join(" "), children: [
|
|
280
278
|
/* @__PURE__ */ jsx(
|
|
281
279
|
"input",
|
|
@@ -290,32 +288,6 @@ var FileInput = ({
|
|
|
290
288
|
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "file__label", children: label })
|
|
291
289
|
] });
|
|
292
290
|
};
|
|
293
|
-
var MarkdownEditor = ({
|
|
294
|
-
label,
|
|
295
|
-
placeholder,
|
|
296
|
-
value,
|
|
297
|
-
onChangeAction,
|
|
298
|
-
rows = 14
|
|
299
|
-
}) => {
|
|
300
|
-
const id = React4.useId();
|
|
301
|
-
return /* @__PURE__ */ jsxs("div", { className: "md", children: [
|
|
302
|
-
label && /* @__PURE__ */ jsx("label", { className: "md__label", htmlFor: id, children: label }),
|
|
303
|
-
/* @__PURE__ */ jsxs("div", { className: "md__grid", children: [
|
|
304
|
-
/* @__PURE__ */ jsx(
|
|
305
|
-
"textarea",
|
|
306
|
-
{
|
|
307
|
-
id,
|
|
308
|
-
className: "md__input",
|
|
309
|
-
rows,
|
|
310
|
-
value,
|
|
311
|
-
placeholder,
|
|
312
|
-
onChange: (e) => onChangeAction(e.target.value)
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
/* @__PURE__ */ jsx("div", { className: "md__preview markdown-body", children: /* @__PURE__ */ jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: value || "\uBBF8\uB9AC\uBCF4\uAE30 \uC601\uC5ED\uC785\uB2C8\uB2E4. \uB9C8\uD06C\uB2E4\uC6B4\uC744 \uC785\uB825\uD558\uC138\uC694." }) })
|
|
316
|
-
] })
|
|
317
|
-
] });
|
|
318
|
-
};
|
|
319
291
|
var Radio = ({
|
|
320
292
|
label,
|
|
321
293
|
size = "md",
|
|
@@ -348,20 +320,20 @@ function Select({
|
|
|
348
320
|
fullWidth,
|
|
349
321
|
className
|
|
350
322
|
}) {
|
|
351
|
-
const internalId =
|
|
323
|
+
const internalId = React3.useId();
|
|
352
324
|
const selectId = id ?? internalId;
|
|
353
325
|
const isControlled = value !== void 0;
|
|
354
|
-
const [internal, setInternal] =
|
|
326
|
+
const [internal, setInternal] = React3.useState(defaultValue);
|
|
355
327
|
const currentValue = isControlled ? value ?? null : internal;
|
|
356
|
-
const [open, setOpen] =
|
|
357
|
-
const [activeIndex, setActiveIndex] =
|
|
358
|
-
const wrapperRef =
|
|
359
|
-
const listRef =
|
|
360
|
-
const currentOption =
|
|
328
|
+
const [open, setOpen] = React3.useState(false);
|
|
329
|
+
const [activeIndex, setActiveIndex] = React3.useState(-1);
|
|
330
|
+
const wrapperRef = React3.useRef(null);
|
|
331
|
+
const listRef = React3.useRef(null);
|
|
332
|
+
const currentOption = React3.useMemo(
|
|
361
333
|
() => options.find((o) => o.value === currentValue) ?? null,
|
|
362
334
|
[options, currentValue]
|
|
363
335
|
);
|
|
364
|
-
const setValue =
|
|
336
|
+
const setValue = React3.useCallback(
|
|
365
337
|
(next) => {
|
|
366
338
|
const opt = options.find((o) => o.value === next) ?? null;
|
|
367
339
|
if (!isControlled) setInternal(next);
|
|
@@ -369,7 +341,7 @@ function Select({
|
|
|
369
341
|
},
|
|
370
342
|
[isControlled, onChange, options]
|
|
371
343
|
);
|
|
372
|
-
|
|
344
|
+
React3.useEffect(() => {
|
|
373
345
|
const onDocClick = (e) => {
|
|
374
346
|
if (!wrapperRef.current) return;
|
|
375
347
|
if (!wrapperRef.current.contains(e.target)) setOpen(false);
|
|
@@ -438,7 +410,7 @@ function Select({
|
|
|
438
410
|
break;
|
|
439
411
|
}
|
|
440
412
|
};
|
|
441
|
-
|
|
413
|
+
React3.useEffect(() => {
|
|
442
414
|
if (open) {
|
|
443
415
|
const idx = Math.max(
|
|
444
416
|
0,
|
|
@@ -536,7 +508,7 @@ var Switch = ({
|
|
|
536
508
|
...props
|
|
537
509
|
}) => {
|
|
538
510
|
const controlled = checked !== void 0;
|
|
539
|
-
const [inner, setInner] =
|
|
511
|
+
const [inner, setInner] = React3.useState(!!defaultChecked);
|
|
540
512
|
const on = controlled ? !!checked : inner;
|
|
541
513
|
const toggle = () => {
|
|
542
514
|
if (disabled) return;
|
|
@@ -564,7 +536,7 @@ var Switch = ({
|
|
|
564
536
|
}
|
|
565
537
|
);
|
|
566
538
|
};
|
|
567
|
-
var TextField =
|
|
539
|
+
var TextField = React3.forwardRef(
|
|
568
540
|
({
|
|
569
541
|
id,
|
|
570
542
|
label,
|
|
@@ -580,7 +552,7 @@ var TextField = React4.forwardRef(
|
|
|
580
552
|
onChangeAction,
|
|
581
553
|
...props
|
|
582
554
|
}, ref) => {
|
|
583
|
-
const inputId = id ??
|
|
555
|
+
const inputId = id ?? React3.useId();
|
|
584
556
|
const helperId = helperText ? `${inputId}-help` : void 0;
|
|
585
557
|
const classNames = [
|
|
586
558
|
"tf__input",
|
|
@@ -656,7 +628,7 @@ var Modal = ({
|
|
|
656
628
|
children,
|
|
657
629
|
...props
|
|
658
630
|
}) => {
|
|
659
|
-
|
|
631
|
+
React3.useEffect(() => {
|
|
660
632
|
const onKey = (e) => e.key === "Escape" && onClose?.();
|
|
661
633
|
if (open) document.addEventListener("keydown", onKey);
|
|
662
634
|
return () => document.removeEventListener("keydown", onKey);
|
|
@@ -705,4 +677,4 @@ var SkeletonList = () => /* @__PURE__ */ jsxs("div", { className: "request-item
|
|
|
705
677
|
/* @__PURE__ */ jsx("div", { className: "request-item__dday", children: /* @__PURE__ */ jsx("span", { className: "skeleton__dday" }) })
|
|
706
678
|
] });
|
|
707
679
|
|
|
708
|
-
export { Alert, AlertProvider, Button, Card, Checkbox, FileInput, Loading,
|
|
680
|
+
export { Alert, AlertProvider, Button, Card, Checkbox, FileInput, Loading, Modal, Pagination, Radio, Select, card_default as SkeletonCard, SkeletonList, Switch, TextField, ToastProvider, useAlert, useToast };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigtablet/design-system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Bigtablet Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -67,14 +67,13 @@
|
|
|
67
67
|
"@types/react": "^19",
|
|
68
68
|
"@types/react-dom": "^19",
|
|
69
69
|
"chromatic": "^13.3.3",
|
|
70
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
70
71
|
"esbuild-sass-plugin": "^3",
|
|
71
72
|
"lucide-react": "^0.552.0",
|
|
72
73
|
"next": "16.0.1",
|
|
73
74
|
"react": "19.2.0",
|
|
74
75
|
"react-dom": "19.2.0",
|
|
75
|
-
"react-markdown": "^10.1.0",
|
|
76
76
|
"react-toastify": "^11.0.5",
|
|
77
|
-
"remark-gfm": "^4.0.1",
|
|
78
77
|
"sass-embedded": "^1.93.3",
|
|
79
78
|
"semantic-release": "^25.0.1",
|
|
80
79
|
"storybook": "8.6.14",
|