@lotte-innovate/ui-component-test 0.2.72 → 0.2.74
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +225 -225
- package/dist/globals.css +4 -4
- package/dist/lib/Typography/Text/index.mjs +1 -1
- package/dist/lib/color/constants.mjs +1 -1
- package/dist/lib/color/constants.mjs.map +1 -1
- package/dist/lib/color/dark.mjs +2 -0
- package/dist/lib/color/dark.mjs.map +1 -0
- package/dist/lib/color/index.d.ts +5 -0
- package/dist/lib/color/index.js +5 -0
- package/dist/lib/color/krdsColors.mjs +2 -0
- package/dist/lib/color/krdsColors.mjs.map +1 -0
- package/dist/lib/color/light.mjs +1 -1
- package/dist/lib/color/light.mjs.map +1 -1
- package/dist/lib/components/Calendar/index.js +1 -1
- package/dist/lib/components/Calendar/index.mjs +1 -1
- package/dist/lib/components/Datepicker/index.js +4 -2
- package/dist/lib/components/Datepicker/index.mjs +1 -1
- package/dist/lib/components/Dialog/DialogAction.js +1 -1
- package/dist/lib/components/Dialog/DialogAction.mjs +1 -1
- package/dist/lib/components/Dialog/DialogCancel.js +1 -1
- package/dist/lib/components/Dialog/DialogCancel.mjs +1 -1
- package/dist/lib/components/Dialog/DialogContent.js +1 -1
- package/dist/lib/components/Dialog/DialogContent.mjs +1 -1
- package/dist/lib/components/Dialog/DialogTrigger.js +1 -0
- package/dist/lib/components/Dialog/DialogTrigger.mjs +1 -0
- package/dist/lib/components/Dialog/DialogTrigger.mjs.map +1 -1
- package/dist/lib/components/Dialog/index.js +16 -16
- package/dist/lib/components/Dialog/index.mjs.map +1 -1
- package/dist/lib/components/DoughnutChart/index.d.ts +4 -2
- package/dist/lib/components/DoughnutChart/index.js +1 -1
- package/dist/lib/components/DoughnutChart/index.mjs +1 -1
- package/dist/lib/components/Editor/index.d.ts +0 -1
- package/dist/lib/components/Editor/index.js +105 -27
- package/dist/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/components/Gnb/GnbLogo.mjs +1 -1
- package/dist/lib/components/Gnb/GnbLogo.mjs.map +1 -1
- package/dist/lib/components/Gnb/GnbRoot.d.ts +3 -0
- package/dist/lib/components/Gnb/GnbRoot.js +8 -3
- package/dist/lib/components/Gnb/GnbRoot.mjs +1 -1
- package/dist/lib/components/Grid/NumberingPagination.js +15 -14
- package/dist/lib/components/Grid/NumberingPagination.mjs +1 -1
- package/dist/lib/components/Grid/NumberingPagination.mjs.map +1 -1
- package/dist/lib/components/Grid/index.js +9 -9
- package/dist/lib/components/Grid/index.mjs +1 -1
- package/dist/lib/components/Grid/useGrid.js +10 -4
- package/dist/lib/components/Grid/useGrid.mjs +1 -1
- package/dist/lib/components/LineChart/index.js +11 -1
- package/dist/lib/components/LineChart/index.mjs +1 -1
- package/dist/lib/components/Modal/ModalAction.js +1 -2
- package/dist/lib/components/Modal/ModalAction.mjs +1 -1
- package/dist/lib/components/Modal/ModalCancel.js +1 -2
- package/dist/lib/components/Modal/ModalCancel.mjs +1 -1
- package/dist/lib/components/Modal/ModalContent.js +2 -2
- package/dist/lib/components/Modal/ModalContent.mjs +1 -1
- package/dist/lib/components/Modal/ModalTitle.js +1 -1
- package/dist/lib/components/Modal/ModalTitle.mjs +1 -1
- package/dist/lib/components/PieChart/index.d.ts +4 -2
- package/dist/lib/components/PieChart/index.js +1 -1
- package/dist/lib/components/PieChart/index.mjs +1 -1
- package/dist/lib/components/Radio/index.js +2 -1
- package/dist/lib/components/Radio/index.mjs +1 -1
- package/dist/lib/components/Table/index.js +15 -2
- package/dist/lib/components/Table/index.mjs +1 -1
- package/dist/lib/components/TextField/index.mjs +1 -1
- package/dist/lib/components/Timeline/TimelineDescription.js +1 -1
- package/dist/lib/components/Timeline/TimelineDescription.mjs +1 -1
- package/dist/lib/components/Timeline/TimelineDescription.mjs.map +1 -1
- package/dist/lib/components/Tree/index.d.ts +1 -0
- package/dist/lib/components/Tree/index.js +22 -1
- package/dist/lib/components/Tree/index.mjs +2 -1
- package/dist/lib/components/Tree/index.mjs.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/types.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +150 -150
@@ -1,2 +1,3 @@
|
|
1
|
+
"use client";
|
1
2
|
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Dialog as t}from"@radix-ui/themes";var n=function(){return n=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},n.apply(this,arguments)},o=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t},a=e((function(e,a){var i=e.children,c=e.className,l=o(e,["children","className"]);return r(t.Trigger,n({ref:a,className:c},l,{children:i}))}));a.displayName="Dialog.Trigger";export{a as DialogTrigger};
|
2
3
|
//# sourceMappingURL=DialogTrigger.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DialogTrigger.mjs","sources":[
|
1
|
+
{"version":3,"file":"DialogTrigger.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -1,19 +1,19 @@
|
|
1
|
-
import { DialogRoot } from './DialogRoot';
|
2
|
-
import { DialogTrigger } from './DialogTrigger';
|
3
|
-
import { DialogContent } from './DialogContent';
|
4
|
-
import { DialogTitle } from './DialogTitle';
|
5
|
-
import { DialogDescription } from './DialogDescription';
|
6
|
-
import { DialogSlot } from './DialogSlot';
|
7
|
-
import { DialogCancel } from './DialogCancel';
|
8
|
-
import { DialogAction } from './DialogAction';
|
1
|
+
import { DialogRoot as Root } from './DialogRoot';
|
2
|
+
import { DialogTrigger as Trigger } from './DialogTrigger';
|
3
|
+
import { DialogContent as Content } from './DialogContent';
|
4
|
+
import { DialogTitle as Title } from './DialogTitle';
|
5
|
+
import { DialogDescription as Description } from './DialogDescription';
|
6
|
+
import { DialogSlot as Slot } from './DialogSlot';
|
7
|
+
import { DialogCancel as Cancel } from './DialogCancel';
|
8
|
+
import { DialogAction as Action } from './DialogAction';
|
9
9
|
var Dialog = {
|
10
|
-
Root:
|
11
|
-
Trigger:
|
12
|
-
Content:
|
13
|
-
Title:
|
14
|
-
Description:
|
15
|
-
Slot:
|
16
|
-
Cancel:
|
17
|
-
Action:
|
10
|
+
Root: Root,
|
11
|
+
Trigger: Trigger,
|
12
|
+
Content: Content,
|
13
|
+
Title: Title,
|
14
|
+
Description: Description,
|
15
|
+
Slot: Slot,
|
16
|
+
Cancel: Cancel,
|
17
|
+
Action: Action,
|
18
18
|
};
|
19
19
|
export default Dialog;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Dialog/index.js"],"sourcesContent":["import { DialogRoot } from './DialogRoot';\nimport { DialogTrigger } from './DialogTrigger';\nimport { DialogContent } from './DialogContent';\nimport { DialogTitle } from './DialogTitle';\nimport { DialogDescription } from './DialogDescription';\nimport { DialogSlot } from './DialogSlot';\nimport { DialogCancel } from './DialogCancel';\nimport { DialogAction } from './DialogAction';\nvar Dialog = {\n Root:
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../lib/components/Dialog/index.js"],"sourcesContent":["import { DialogRoot as Root } from './DialogRoot';\nimport { DialogTrigger as Trigger } from './DialogTrigger';\nimport { DialogContent as Content } from './DialogContent';\nimport { DialogTitle as Title } from './DialogTitle';\nimport { DialogDescription as Description } from './DialogDescription';\nimport { DialogSlot as Slot } from './DialogSlot';\nimport { DialogCancel as Cancel } from './DialogCancel';\nimport { DialogAction as Action } from './DialogAction';\nvar Dialog = {\n Root: Root,\n Trigger: Trigger,\n Content: Content,\n Title: Title,\n Description: Description,\n Slot: Slot,\n Cancel: Cancel,\n Action: Action,\n};\nexport default Dialog;\n"],"names":["Dialog","Root","Trigger","Content","Title","Description","Slot","Cancel","Action"],"mappings":"oZAQG,IAACA,EAAS,CACTC,KAAMA,EACNC,QAASA,EACTC,QAASA,EACTC,MAAOA,EACPC,YAAaA,EACbC,KAAMA,EACNC,OAAQA,EACRC,OAAQA"}
|
@@ -7,10 +7,12 @@ export interface DoughnutChartProps extends VariantProps<typeof doughnutVariants
|
|
7
7
|
className?: string;
|
8
8
|
title?: IChartTitle;
|
9
9
|
legend?: IChartLegend;
|
10
|
-
datasets: IChartDatasets
|
10
|
+
datasets: (IChartDatasets & {
|
11
11
|
data: number[];
|
12
|
-
}[];
|
12
|
+
})[];
|
13
13
|
datalabels?: IChartDataLabels;
|
14
|
+
width?: number;
|
15
|
+
height?: number;
|
14
16
|
}
|
15
17
|
declare const doughnutVariants: (props?: ({
|
16
18
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
@@ -52,7 +52,7 @@ var DoughnutChart = function (_a) {
|
|
52
52
|
}
|
53
53
|
};
|
54
54
|
datasets.forEach(function (dataset, index) {
|
55
|
-
datasets[index] = __assign(
|
55
|
+
datasets[index] = __assign({ backgroundColor: getChartColor(isColorMixed, appearance), borderColor: getChartColor(isColorMixed, 'solid') }, dataset);
|
56
56
|
});
|
57
57
|
return (_jsx(Doughnut, __assign({ data: { labels: labels, datasets: datasets }, options: {
|
58
58
|
plugins: {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{Doughnut as a}from"react-chartjs-2";import{Chart as r,ArcElement as e,Tooltip as o,Legend as s,plugins as l}from"chart.js/auto";import i from"chartjs-plugin-datalabels";import{cn as n}from"../../utils/utils.mjs";import{cva as c}from"class-variance-authority";import{scalingVariants as p}from"../../constants.mjs";import{chartColorList as d,chartAlphaColorList as m}from"../../color/constants.mjs";var f=function(){return f=Object.assign||function(t){for(var a,r=1,e=arguments.length;r<e;r++)for(var o in a=arguments[r])Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o]);return t},f.apply(this,arguments)},u=function(t,a){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&a.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(t);o<e.length;o++)a.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(r[e[o]]=t[e[o]])}return r};r.register(e,o,s,l,i),r.defaults.set("plugins.datalabels",{display:!1});var g=c("",{variants:{scaling:f({},p)},defaultVariants:{scaling:"100%"}}),b=function(r){var e=r.labels,o=r.title,s=r.legend,l=r.datasets,i=r.datalabels,c=r.scaling,p=r.className,b=r.appearance,y=void 0===b?"solid":b,j=r.isColorMixed,v=void 0===j||j,h=u(r,["labels","title","legend","datasets","datalabels","scaling","className","appearance","isColorMixed"]),O=function(t,a){return"solid"===a?t?d.mixed:d.sorting:"soft"===a?t?m.mixed:m.sorting:void 0};return l.forEach((function(t,a){l[a]=f(
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{Doughnut as a}from"react-chartjs-2";import{Chart as r,ArcElement as e,Tooltip as o,Legend as s,plugins as l}from"chart.js/auto";import i from"chartjs-plugin-datalabels";import{cn as n}from"../../utils/utils.mjs";import{cva as c}from"class-variance-authority";import{scalingVariants as p}from"../../constants.mjs";import{chartColorList as d,chartAlphaColorList as m}from"../../color/constants.mjs";var f=function(){return f=Object.assign||function(t){for(var a,r=1,e=arguments.length;r<e;r++)for(var o in a=arguments[r])Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o]);return t},f.apply(this,arguments)},u=function(t,a){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&a.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(t);o<e.length;o++)a.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(r[e[o]]=t[e[o]])}return r};r.register(e,o,s,l,i),r.defaults.set("plugins.datalabels",{display:!1});var g=c("",{variants:{scaling:f({},p)},defaultVariants:{scaling:"100%"}}),b=function(r){var e=r.labels,o=r.title,s=r.legend,l=r.datasets,i=r.datalabels,c=r.scaling,p=r.className,b=r.appearance,y=void 0===b?"solid":b,j=r.isColorMixed,v=void 0===j||j,h=u(r,["labels","title","legend","datasets","datalabels","scaling","className","appearance","isColorMixed"]),O=function(t,a){return"solid"===a?t?d.mixed:d.sorting:"soft"===a?t?m.mixed:m.sorting:void 0};return l.forEach((function(t,a){l[a]=f({backgroundColor:O(v,y),borderColor:O(v,"solid")},t)})),t(a,f({data:{labels:e,datasets:l},options:{plugins:{title:o,legend:s,datalabels:i}},className:n(g({scaling:c}),p)},h))};b.displayName="DoughnutChart";export{b as default};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IAllProps } from '@tinymce/tinymce-react';
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
4
|
-
import 'tinymce/skins/ui/oxide/skin.css';
|
5
4
|
export interface EditorProps extends VariantProps<typeof editorVariants> {
|
6
5
|
language?: 'ko_KR' | 'zh_CN' | 'ja' | 'it' | 'vi';
|
7
6
|
}
|
@@ -10,6 +10,42 @@ var __assign = (this && this.__assign) || function () {
|
|
10
10
|
};
|
11
11
|
return __assign.apply(this, arguments);
|
12
12
|
};
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
20
|
+
});
|
21
|
+
};
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
26
|
+
function step(op) {
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
31
|
+
switch (op[0]) {
|
32
|
+
case 0: case 1: t = op; break;
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
36
|
+
default:
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
41
|
+
if (t[2]) _.ops.pop();
|
42
|
+
_.trys.pop(); continue;
|
43
|
+
}
|
44
|
+
op = body.call(thisArg, _);
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
47
|
+
}
|
48
|
+
};
|
13
49
|
var __rest = (this && this.__rest) || function (s, e) {
|
14
50
|
var t = {};
|
15
51
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
@@ -21,18 +57,23 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
57
|
}
|
22
58
|
return t;
|
23
59
|
};
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
60
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
25
61
|
import { useState, forwardRef, useEffect, useRef, } from 'react';
|
26
62
|
import { Editor as EditorUI } from '@tinymce/tinymce-react';
|
27
63
|
import { cva } from 'class-variance-authority';
|
28
64
|
import { loadTinymce } from '../../../lib/utils/useLoadTinyMCE';
|
65
|
+
import { useDarkMode } from '../../../lib/utils/useDarkMode';
|
29
66
|
import { scalingVariants, radiusVariants } from '../../../lib/constants';
|
67
|
+
import { Spinner } from '../../../lib/components/Spinner/index';
|
30
68
|
import { cn } from '../../../lib/utils/utils';
|
31
69
|
import { useTheme } from '../../../lib/theme';
|
32
70
|
import { marked } from 'marked';
|
33
|
-
import 'tinymce/skins/ui/oxide/skin.css';
|
71
|
+
// import 'tinymce/skins/ui/oxide/skin.css';
|
72
|
+
// import 'tinymce/skins/ui/oxide-dark/skin.css';
|
34
73
|
import contentUiSkinCss from '!!raw-loader!tinymce/skins/ui/oxide/content.css';
|
35
74
|
import contentCss from '!!raw-loader!tinymce/skins/content/default/content.css';
|
75
|
+
import contentUiDarkSkinCss from '!!raw-loader!tinymce/skins/ui/oxide-dark/content.css';
|
76
|
+
import contentDarkCss from '!!raw-loader!tinymce/skins/content/dark/content.css';
|
36
77
|
var editorVariants = cva('', {
|
37
78
|
variants: {
|
38
79
|
radius: __assign({}, radiusVariants['base']),
|
@@ -52,13 +93,45 @@ var editorVariants = cva('', {
|
|
52
93
|
export var Editor = forwardRef(function (_a, ref) {
|
53
94
|
var className = _a.className, size = _a.size, scaling = _a.scaling, radius = _a.radius, init = _a.init, _b = _a.language, language = _b === void 0 ? 'en' : _b, props = __rest(_a, ["className", "size", "scaling", "radius", "init", "language"]);
|
54
95
|
var _c = useState(false), isClient = _c[0], setIsClient = _c[1];
|
96
|
+
var _d = useDarkMode(), isDark = _d[0], defaultScales = _d[1];
|
55
97
|
var editorRef = useRef(null);
|
98
|
+
var _e = useState(0), editorKey = _e[0], setEditorKey = _e[1];
|
99
|
+
var _f = useState(true), isLoading = _f[0], setIsLoading = _f[1];
|
100
|
+
var _g = useState(false), isEditorInit = _g[0], setIsEditorInit = _g[1];
|
56
101
|
var theme = useTheme().theme;
|
57
102
|
var editorStyle = {
|
58
103
|
radius: radius !== null && radius !== void 0 ? radius : theme.themeRadius,
|
59
104
|
scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
|
60
105
|
size: size,
|
61
106
|
};
|
107
|
+
useEffect(function () {
|
108
|
+
var loadSkin = function () { return __awaiter(void 0, void 0, void 0, function () {
|
109
|
+
return __generator(this, function (_a) {
|
110
|
+
switch (_a.label) {
|
111
|
+
case 0:
|
112
|
+
if (!isDark) return [3 /*break*/, 2];
|
113
|
+
return [4 /*yield*/, import('tinymce/skins/ui/oxide-dark/skin.css')];
|
114
|
+
case 1:
|
115
|
+
_a.sent();
|
116
|
+
return [3 /*break*/, 4];
|
117
|
+
case 2: return [4 /*yield*/, import('tinymce/skins/ui/oxide/skin.css')];
|
118
|
+
case 3:
|
119
|
+
_a.sent();
|
120
|
+
_a.label = 4;
|
121
|
+
case 4:
|
122
|
+
// 에디터를 다시 로드하기 위해 key 변경
|
123
|
+
setEditorKey(function (prevKey) { return prevKey + 1; });
|
124
|
+
return [2 /*return*/];
|
125
|
+
}
|
126
|
+
});
|
127
|
+
}); };
|
128
|
+
loadSkin();
|
129
|
+
}, [isDark]);
|
130
|
+
var getContentStyle = function () {
|
131
|
+
var baseStyle = "".concat(contentUiSkinCss, "\n").concat(contentCss, "\n body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }");
|
132
|
+
var darkStyle = "".concat(contentUiDarkSkinCss, "\n").concat(contentDarkCss, "\n body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }");
|
133
|
+
return isDark ? baseStyle : baseStyle;
|
134
|
+
};
|
62
135
|
var radiusTheme = '8px';
|
63
136
|
if (editorStyle.radius === 'none')
|
64
137
|
radiusTheme = '0px';
|
@@ -84,32 +157,37 @@ export var Editor = forwardRef(function (_a, ref) {
|
|
84
157
|
if (!isClient) {
|
85
158
|
return null;
|
86
159
|
}
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
160
|
+
var handleEditorInit = function (evt, editor) {
|
161
|
+
editorRef.current = editor;
|
162
|
+
setIsLoading(false);
|
163
|
+
setIsEditorInit(true);
|
164
|
+
};
|
165
|
+
return (_jsxs("div", { className: cn(editorVariants(editorStyle), 'flex items-center justify-center', className), ref: ref, children: [isLoading && _jsx(Spinner, {}), isEditorInit && (_jsx(EditorUI, __assign({ onInit: handleEditorInit, init: __assign({ language: language, width: '100%', height: '100%', promotion: false, plugins: 'preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount charmap accordion', menubar: 'file edit view insert format tools table', toolbar: 'undo redo | accordion accordionremove | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl', autosave_ask_before_unload: true, autosave_interval: '30s', autosave_restore_when_empty: false, autosave_retention: '2m', image_advtab: true, image_caption: true, quickbars_selection_toolbar: '', toolbar_mode: 'sliding', skin: false, content_css: false, content_style: getContentStyle(), setup: function (editor) {
|
166
|
+
editor.ui.registry.addButton('inlinecode', {
|
167
|
+
icon: 'sourcecode',
|
168
|
+
tooltip: 'Inline code',
|
169
|
+
onAction: function () {
|
170
|
+
editor.formatter.toggle('code');
|
171
|
+
},
|
172
|
+
});
|
173
|
+
editor.on('init', function () {
|
174
|
+
editor.formatter.register('code', {
|
175
|
+
inline: 'code',
|
176
|
+
remove: 'all',
|
177
|
+
});
|
178
|
+
});
|
179
|
+
editor.ui.registry.addButton('markdown', {
|
180
|
+
text: 'Markdown',
|
181
|
+
onAction: function () {
|
182
|
+
var content = editor.getContent({ format: 'text' });
|
183
|
+
var html = marked(content);
|
184
|
+
editor.setContent(html);
|
185
|
+
},
|
186
|
+
});
|
187
|
+
editor.on('init', function () {
|
188
|
+
editor.getContainer().style.borderRadius = radiusTheme;
|
99
189
|
});
|
100
|
-
});
|
101
|
-
editor.ui.registry.addButton('markdown', {
|
102
|
-
text: 'Markdown',
|
103
|
-
onAction: function () {
|
104
|
-
var content = editor.getContent({ format: 'text' });
|
105
|
-
var html = marked(content);
|
106
|
-
editor.setContent(html);
|
107
|
-
},
|
108
|
-
});
|
109
|
-
editor.on('init', function () {
|
110
|
-
editor.getContainer().style.borderRadius = radiusTheme;
|
111
|
-
});
|
112
|
-
} }, init) }, props)) }));
|
190
|
+
} }, init) }, props), editorKey))] }));
|
113
191
|
});
|
114
192
|
Editor.displayName = 'Editor';
|
115
193
|
export default Editor;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as n,useState as r,useRef as i,useEffect as o}from"react";import{Editor as a}from"@tinymce/tinymce-react";import{cva as s}from"class-variance-authority";import{loadTinymce as c}from"../../utils/useLoadTinyMCE.mjs";import{useDarkMode as l}from"../../utils/useDarkMode.mjs";import{radiusVariants as u,scalingVariants as m}from"../../constants.mjs";import{Spinner as d}from"../Spinner/index.mjs";import{cn as f}from"../../utils/utils.mjs";import{useTheme as p}from"../../theme/ThemeProvider.mjs";import{marked as h}from"marked";import y from"!!raw-loader!tinymce/skins/ui/oxide/content.css";import b from"!!raw-loader!tinymce/skins/content/default/content.css";import"!!raw-loader!tinymce/skins/ui/oxide-dark/content.css";import"!!raw-loader!tinymce/skins/content/dark/content.css";var v=function(){return v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},v.apply(this,arguments)},g=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},k=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},x=s("",{variants:{radius:v({},u.base),scaling:v({},m),size:{small:"w-[650px] h-[350px]",medium:"w-[700px] h-[400px]",large:"w-[750px] h-[450px]"}},defaultVariants:{radius:"medium",scaling:"100%",size:"medium"}}),_=n((function(n,s){var u=n.className,m=n.size,_=n.scaling,j=n.radius,O=n.init,S=n.language,N=void 0===S?"en":S,z=w(n,["className","size","scaling","radius","init","language"]),P=r(!1),C=P[0],E=P[1],R=l()[0],I=i(null),M=r(0),T=M[0],A=M[1],B=r(!0),H=B[0],q=B[1],D=r(!1),G=D[0],K=D[1],L=p().theme,V={radius:null!=j?j:L.themeRadius,scaling:null!=_?_:L.themeScaling,size:m};o((function(){g(void 0,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return R?[4,import("tinymce/skins/ui/oxide-dark/skin.css")]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,import("tinymce/skins/ui/oxide/skin.css")];case 3:e.sent(),e.label=4;case 4:return A((function(e){return e+1})),[2]}}))}))}),[R]);var F="8px";if("none"===V.radius&&(F="0px"),"small"===V.radius&&(F="4px"),"large"===V.radius&&(F="12px"),"full"===V.radius&&(F="16px"),o((function(){c().then((function(){E(!0)}))}),[]),o((function(){if(I.current){var e=I.current.getContainer();e&&(e.style.borderRadius="".concat(F))}}),[F]),!C)return null;var J;return e("div",{className:f(x(V),"flex items-center justify-center",u),ref:s,children:[H&&t(d,{}),G&&t(a,v({onInit:function(e,t){I.current=t,q(!1),K(!0)},init:v({language:N,width:"100%",height:"100%",promotion:!1,plugins:"preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount charmap accordion",menubar:"file edit view insert format tools table",toolbar:"undo redo | accordion accordionremove | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",autosave_ask_before_unload:!0,autosave_interval:"30s",autosave_restore_when_empty:!1,autosave_retention:"2m",image_advtab:!0,image_caption:!0,quickbars_selection_toolbar:"",toolbar_mode:"sliding",skin:!1,content_css:!1,content_style:(J="".concat(y,"\n").concat(b,"\n body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }"),J),setup:function(e){e.ui.registry.addButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){e.formatter.toggle("code")}}),e.on("init",(function(){e.formatter.register("code",{inline:"code",remove:"all"})})),e.ui.registry.addButton("markdown",{text:"Markdown",onAction:function(){var t=e.getContent({format:"text"}),n=h(t);e.setContent(n)}}),e.on("init",(function(){e.getContainer().style.borderRadius=F}))}},O)},z),T)]})}));_.displayName="Editor";export{_ as Editor,_ as default};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,useContext as t}from"react";import{cva as a}from"class-variance-authority";import{GnbContext as o}from"./GnbRoot.mjs";import{cn as n}from"../../utils/utils.mjs";import"../../Typography/Header/index.mjs";import i
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,useContext as t}from"react";import{cva as a}from"class-variance-authority";import{GnbContext as o}from"./GnbRoot.mjs";import{cn as n}from"../../utils/utils.mjs";import"../../Typography/Header/index.mjs";import{Text as i}from"../../Typography/Text/index.mjs";var s=function(){return s=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},s.apply(this,arguments)},l=function(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(r);o<a.length;o++)e.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(r,a[o])&&(t[a[o]]=r[a[o]])}return t},p=a("mr-4 flex items-center text-slate-12 dark:text-slateDark-12",{variants:{size:{small:"text-xs w-[140px] h-[15px]",medium:"text-sm w-[150px] h-[20px]",large:"text-base w-[160px] h-[25px]"}},defaultVariants:{size:"medium"}}),m=e((function(e,a){var m=e.children,c=e.className,f=e.href,x=l(e,["children","className","href"]),u=t(o).size;return r("a",s({href:f,className:n(p({size:u}),c)},x,{children:null!=m?m:r(i,{children:"LOGO 영역"})}))}));m.displayName="Gnb.Logo";export{m as GnbLogo};
|
2
2
|
//# sourceMappingURL=GnbLogo.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GnbLogo.mjs","sources":["../../../lib/components/Gnb/GnbLogo.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef, useContext } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { GnbContext } from './GnbRoot';\nimport { cn } from '../../../lib/utils/utils';\nimport { Text } from '../../../lib/Typography';\nvar gnbLogoVariants = cva('mr-4 flex items-center text-slate-12 dark:text-slateDark-12', {\n variants: {\n size: {\n small: 'text-xs w-[140px] h-[15px]',\n medium: 'text-sm w-[150px] h-[20px]',\n large: 'text-base w-[160px] h-[25px]',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var GnbLogo = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, href = _a.href, props = __rest(_a, [\"children\", \"className\", \"href\"]);\n var size = useContext(GnbContext).size;\n return (_jsx(\"a\", __assign({ href: href, className: cn(gnbLogoVariants({ size: size }), className) }, props, { children: children !== null && children !== void 0 ? children : _jsx(Text, { children: \"LOGO \\uC601\\uC5ED\" }) })));\n});\nGnbLogo.displayName = 'Gnb.Logo';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","gnbLogoVariants","cva","variants","size","small","medium","large","defaultVariants","GnbLogo","forwardRef","_a","ref","children","className","href","props","useContext","GnbContext","_jsx","cn","Text","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"GnbLogo.mjs","sources":["../../../lib/components/Gnb/GnbLogo.js"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef, useContext } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { GnbContext } from './GnbRoot';\nimport { cn } from '../../../lib/utils/utils';\nimport { Text } from '../../../lib/Typography';\nvar gnbLogoVariants = cva('mr-4 flex items-center text-slate-12 dark:text-slateDark-12', {\n variants: {\n size: {\n small: 'text-xs w-[140px] h-[15px]',\n medium: 'text-sm w-[150px] h-[20px]',\n large: 'text-base w-[160px] h-[25px]',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n});\nexport var GnbLogo = forwardRef(function (_a, ref) {\n var children = _a.children, className = _a.className, href = _a.href, props = __rest(_a, [\"children\", \"className\", \"href\"]);\n var size = useContext(GnbContext).size;\n return (_jsx(\"a\", __assign({ href: href, className: cn(gnbLogoVariants({ size: size }), className) }, props, { children: children !== null && children !== void 0 ? children : _jsx(Text, { children: \"LOGO \\uC601\\uC5ED\" }) })));\n});\nGnbLogo.displayName = 'Gnb.Logo';\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","gnbLogoVariants","cva","variants","size","small","medium","large","defaultVariants","GnbLogo","forwardRef","_a","ref","children","className","href","props","useContext","GnbContext","_jsx","cn","Text","displayName"],"mappings":"iUAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EACIQ,EAAkC,SAAUX,EAAGY,GAC/C,IAAIb,EAAI,CAAA,EACR,IAAK,IAAIM,KAAKL,EAAOH,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,IAAMO,EAAEC,QAAQR,GAAK,IAC9EN,EAAEM,GAAKL,EAAEK,IACb,GAAS,MAALL,GAAqD,mBAAjCH,OAAOiB,sBACtB,KAAIb,EAAI,EAAb,IAAgBI,EAAIR,OAAOiB,sBAAsBd,GAAIC,EAAII,EAAED,OAAQH,IAC3DW,EAAEC,QAAQR,EAAEJ,IAAM,GAAKJ,OAAOS,UAAUS,qBAAqBP,KAAKR,EAAGK,EAAEJ,MACvEF,EAAEM,EAAEJ,IAAMD,EAAEK,EAAEJ,IAF4B,CAItD,OAAOF,CACX,EAOIiB,EAAkBC,EAAI,8DAA+D,CACrFC,SAAU,CACNC,KAAM,CACFC,MAAO,6BACPC,OAAQ,6BACRC,MAAO,iCAGfC,gBAAiB,CACbJ,KAAM,YAGHK,EAAUC,GAAW,SAAUC,EAAIC,GAC1C,IAAIC,EAAWF,EAAGE,SAAUC,EAAYH,EAAGG,UAAWC,EAAOJ,EAAGI,KAAMC,EAAQpB,EAAOe,EAAI,CAAC,WAAY,YAAa,SAC/GP,EAAOa,EAAWC,GAAYd,KAClC,OAAQe,EAAK,IAAKtC,EAAS,CAAEkC,KAAMA,EAAMD,UAAWM,EAAGnB,EAAgB,CAAEG,KAAMA,IAASU,IAAcE,EAAO,CAAEH,SAAUA,QAA2CA,EAAWM,EAAKE,EAAM,CAAER,SAAU,cAC1M,IACAJ,EAAQa,YAAc"}
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
3
|
+
import { IColor } from '../../../lib/types';
|
3
4
|
export interface GnbProps extends VariantProps<typeof GnbVariants> {
|
5
|
+
color?: IColor;
|
4
6
|
}
|
5
7
|
declare const GnbVariants: (props?: ({
|
6
8
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
7
9
|
size?: "small" | "medium" | "large" | null | undefined;
|
10
|
+
color?: string | null | undefined;
|
8
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
9
12
|
export declare const GnbContext: React.Context<GnbProps>;
|
10
13
|
export declare const Gnb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & GnbProps & React.RefAttributes<HTMLElement>>;
|
@@ -24,7 +24,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
25
25
|
import { forwardRef, createContext } from 'react';
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
|
-
import { scalingVariants } from '../../../lib/constants';
|
27
|
+
import { scalingVariants, bgColorStyle } from '../../../lib/constants';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
29
|
import { useTheme } from '../../../lib/theme';
|
30
30
|
var GnbVariants = cva('sticky top-0 z-50 w-full px-8 backdrop-blur flex items-center', {
|
@@ -35,6 +35,7 @@ var GnbVariants = cva('sticky top-0 z-50 w-full px-8 backdrop-blur flex items-ce
|
|
35
35
|
medium: 'text-sm h-14',
|
36
36
|
large: 'text-base h-16',
|
37
37
|
},
|
38
|
+
color: bgColorStyle(),
|
38
39
|
},
|
39
40
|
defaultVariants: {
|
40
41
|
scaling: '100%',
|
@@ -45,9 +46,13 @@ export var GnbContext = createContext({
|
|
45
46
|
size: 'medium',
|
46
47
|
});
|
47
48
|
export var Gnb = forwardRef(function (_a, ref) {
|
48
|
-
var children = _a.children, className = _a.className, size = _a.size, scaling = _a.scaling, props = __rest(_a, ["children", "className", "size", "scaling"]);
|
49
|
+
var children = _a.children, className = _a.className, size = _a.size, scaling = _a.scaling, color = _a.color, props = __rest(_a, ["children", "className", "size", "scaling", "color"]);
|
49
50
|
var theme = useTheme().theme;
|
50
|
-
var contextValue = {
|
51
|
+
var contextValue = {
|
52
|
+
size: size,
|
53
|
+
scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
|
54
|
+
color: color !== null && color !== void 0 ? color : theme.themeColor,
|
55
|
+
};
|
51
56
|
return (_jsx(GnbContext.Provider, { value: contextValue, children: _jsx("header", __assign({ className: cn(GnbVariants(contextValue), className), ref: ref }, props, { children: children })) }));
|
52
57
|
});
|
53
58
|
Gnb.displayName = 'Gnb.Root';
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{createContext as r,forwardRef as t}from"react";import{cva as
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as r,forwardRef as t}from"react";import{cva as o}from"class-variance-authority";import{scalingVariants as i,bgColorStyle as l}from"../../constants.mjs";import{cn as a}from"../../utils/utils.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var s=function(){return s=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},s.apply(this,arguments)},c=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)r.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t},m=o("sticky top-0 z-50 w-full px-8 backdrop-blur flex items-center",{variants:{scaling:s({},i),size:{small:"text-xs h-12",medium:"text-sm h-14",large:"text-base h-16"},color:l()},defaultVariants:{scaling:"100%",size:"medium"}}),p=r({size:"medium"}),u=t((function(r,t){var o=r.children,i=r.className,l=r.size,u=r.scaling,f=r.color,h=c(r,["children","className","size","scaling","color"]),d=n().theme,y={size:l,scaling:null!=u?u:d.themeScaling,color:null!=f?f:d.themeColor};return e(p.Provider,{value:y,children:e("header",s({className:a(m(y),i),ref:t},h,{children:o}))})}));u.displayName="Gnb.Root";export{u as Gnb,p as GnbContext};
|
3
3
|
//# sourceMappingURL=GnbRoot.mjs.map
|
@@ -19,10 +19,11 @@ import Button from '../Button';
|
|
19
19
|
import TextField from '../TextField';
|
20
20
|
import Text from '../../Typography/Text';
|
21
21
|
function NumberingPagination(_a) {
|
22
|
-
var _b, _c;
|
22
|
+
var _b, _c, _d;
|
23
23
|
var table = _a.table;
|
24
|
-
var
|
24
|
+
var _e = useState('1'), nowPage = _e[0], setNowPage = _e[1];
|
25
25
|
var color = (_b = table.options.color) !== null && _b !== void 0 ? _b : MAIN_COLOR;
|
26
|
+
var radius = (_c = table.options.radius) !== null && _c !== void 0 ? _c : 'medium';
|
26
27
|
var size = table.options.size == 'x-small' ? 'small' : table.options.size;
|
27
28
|
var currentPage = table.options.pagination
|
28
29
|
? table.options.pagination.pageIndex
|
@@ -40,7 +41,7 @@ function NumberingPagination(_a) {
|
|
40
41
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: i }));
|
41
42
|
setNowPage(String(i + 1));
|
42
43
|
}
|
43
|
-
}, color: currentInx === i ? color : 'slate', children: i + 1 }, i));
|
44
|
+
}, color: currentInx === i ? color : 'slate', radius: radius, children: i + 1 }, i));
|
44
45
|
};
|
45
46
|
for (var i = 0; i < table.getPageCount(); i++) {
|
46
47
|
_loop_1(i);
|
@@ -53,13 +54,13 @@ function NumberingPagination(_a) {
|
|
53
54
|
table.options.setPagination &&
|
54
55
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));
|
55
56
|
setNowPage('1');
|
56
|
-
}, color: currentInx === 0 ? color : 'slate', children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }));
|
57
|
+
}, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }));
|
57
58
|
pageNumbers.push(_jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }), _jsx(Button, { size: size, appearance: "ghost", onClick: function () {
|
58
59
|
table.setPageIndex(table.getPageCount() - 1);
|
59
60
|
table.options.setPagination &&
|
60
61
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));
|
61
62
|
setNowPage(String(table.getPageCount()));
|
62
|
-
}, color: currentInx === table.getPageCount() - 1 ? color : 'slate', children: table.getPageCount() }, table.getPageCount() - 1));
|
63
|
+
}, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));
|
63
64
|
}
|
64
65
|
else if (currentInx - 3 <= 0) {
|
65
66
|
pageNumbers = pageNumbers.slice(0, 7);
|
@@ -68,7 +69,7 @@ function NumberingPagination(_a) {
|
|
68
69
|
table.options.setPagination &&
|
69
70
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));
|
70
71
|
setNowPage(String(table.getPageCount()));
|
71
|
-
}, color: currentInx === table.getPageCount() - 1 ? color : 'slate', children: table.getPageCount() }, table.getPageCount() - 1));
|
72
|
+
}, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));
|
72
73
|
}
|
73
74
|
else {
|
74
75
|
pageNumbers = pageNumbers.slice(table.getPageCount() - 7, table.getPageCount());
|
@@ -77,12 +78,12 @@ function NumberingPagination(_a) {
|
|
77
78
|
table.options.setPagination &&
|
78
79
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));
|
79
80
|
setNowPage('1');
|
80
|
-
}, color: currentInx === 0 ? color : 'slate', children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }));
|
81
|
+
}, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }));
|
81
82
|
}
|
82
83
|
}
|
83
84
|
return pageNumbers;
|
84
85
|
};
|
85
|
-
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsxs(Select.Root, { size: size, color: color, value: String(table.getState().pagination.pageSize), defaultValue: String(table.getState().pagination.pageSize), onValueChange: function (e) {
|
86
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsxs(Select.Root, { size: size, color: color, radius: radius, value: String(table.getState().pagination.pageSize), defaultValue: String(table.getState().pagination.pageSize), onValueChange: function (e) {
|
86
87
|
table.options.setPagination &&
|
87
88
|
table.options.setPagination({
|
88
89
|
pageIndex: 0,
|
@@ -91,28 +92,28 @@ function NumberingPagination(_a) {
|
|
91
92
|
table.setPageSize(Number(e));
|
92
93
|
setNowPage('1');
|
93
94
|
table.setPageIndex(0);
|
94
|
-
}, children: [_jsx(Select.Trigger, {}), _jsx(Select.Content, { children: [10, 20, 30, 50, 100].map(function (pageSize) { return (_jsx(Select.Item, { value: String(pageSize), children: pageSize }, pageSize)); }) })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(IconButton, { size: size, appearance: "ghost", className: "
|
95
|
+
}, children: [_jsx(Select.Trigger, {}), _jsx(Select.Content, { children: [10, 20, 30, 50, 100].map(function (pageSize) { return (_jsx(Select.Item, { value: String(pageSize), children: pageSize }, pageSize)); }) })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(IconButton, { size: size, appearance: "ghost", className: "border p-1", color: color, radius: radius, onClick: function () {
|
95
96
|
table.firstPage();
|
96
97
|
table.options.setPagination &&
|
97
98
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));
|
98
99
|
setNowPage('1');
|
99
|
-
}, disabled: currentPage === 0, children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { size: size, appearance: "ghost", className: "
|
100
|
+
}, disabled: currentPage === 0, children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { size: size, appearance: "ghost", className: "border p-1", color: color, radius: radius, onClick: function () {
|
100
101
|
table.previousPage();
|
101
102
|
setNowPage(String(table.getState().pagination.pageIndex));
|
102
103
|
table.options.setPagination &&
|
103
104
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex - 1 }));
|
104
|
-
}, disabled: currentPage === 0, children: _jsx(ChevronLeftIcon, {}) })] }), _jsx("div", { children: renderPageNumbers() }), _jsxs("div", { className: "flex gap-2", children: [_jsx(IconButton, { size: size, appearance: "ghost", className: "
|
105
|
+
}, disabled: currentPage === 0, children: _jsx(ChevronLeftIcon, {}) })] }), _jsx("div", { children: renderPageNumbers() }), _jsxs("div", { className: "flex gap-2", children: [_jsx(IconButton, { size: size, appearance: "ghost", className: "border p-1", color: color, radius: radius, onClick: function () {
|
105
106
|
table.nextPage();
|
106
107
|
setNowPage(String(table.getState().pagination.pageIndex + 2));
|
107
108
|
table.options.setPagination &&
|
108
109
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex + 1 }));
|
109
|
-
}, disabled: currentPage === table.getPageCount() - 1, children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { size: size, appearance: "ghost", className: "
|
110
|
+
}, disabled: currentPage === table.getPageCount() - 1, children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { size: size, appearance: "ghost", className: "border p-1", color: color, radius: radius, onClick: function () {
|
110
111
|
table.lastPage();
|
111
112
|
setNowPage(String(table.getPageCount()));
|
112
113
|
table.options.setPagination &&
|
113
114
|
table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));
|
114
|
-
}, disabled: currentPage === table.getPageCount() - 1, children: _jsx(DoubleArrowRightIcon, {}) })] })] }), !((
|
115
|
+
}, disabled: currentPage === table.getPageCount() - 1, children: _jsx(DoubleArrowRightIcon, {}) })] })] }), !((_d = table.options) === null || _d === void 0 ? void 0 : _d.disableInputPagination) && (_jsxs("div", { className: "mt-4 flex items-center justify-center gap-2", children: [_jsx(TextField.Root, { size: size, type: "number", color: color, radius: radius, min: "1", max: table.getPageCount(), value: nowPage, onChange: function (e) {
|
115
116
|
setNowPage(e.target.value);
|
116
|
-
}, className: "w-[50px]
|
117
|
+
}, className: "w-[50px] border" }), _jsxs(Text, { children: ["/ ", table.getPageCount()] }), _jsx(Button, { size: size, onClick: function () { return table.setPageIndex(nowPage ? Number(nowPage) - 1 : 0); }, color: color, radius: radius, children: "\uC774\uB3D9" })] }))] }));
|
117
118
|
}
|
118
119
|
export default NumberingPagination;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as t}from"react";import{IconButton as
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as t}from"react";import{IconButton as i}from"../IconButton/index.mjs";import{DoubleArrowLeftIcon as a,ChevronLeftIcon as o,ChevronRightIcon as s,DoubleArrowRightIcon as g}from"@radix-ui/react-icons";import r from"../Select/index.mjs";import{MAIN_COLOR as p}from"../../color/constants.mjs";import{Button as c}from"../Button/index.mjs";import l from"../TextField/index.mjs";import{Text as d}from"../../Typography/Text/index.mjs";var u=function(){return u=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var a in n=arguments[t])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e},u.apply(this,arguments)};function P(P){var h,m,x,f=P.table,C=t("1"),I=C[0],z=C[1],b=null!==(h=f.options.color)&&void 0!==h?h:p,v=null!==(m=f.options.radius)&&void 0!==m?m:"medium",S="x-small"==f.options.size?"small":f.options.size,N=f.options.pagination?f.options.pagination.pageIndex:f.getState().pagination.pageIndex;return e("div",{children:[e("div",{className:"flex items-center justify-center gap-2",children:[e(r.Root,{size:S,color:b,radius:v,value:String(f.getState().pagination.pageSize),defaultValue:String(f.getState().pagination.pageSize),onValueChange:function(e){f.options.setPagination&&f.options.setPagination({pageIndex:0,pageSize:Number(e)}),f.setPageSize(Number(e)),z("1"),f.setPageIndex(0)},children:[n(r.Trigger,{}),n(r.Content,{children:[10,20,30,50,100].map((function(e){return n(r.Item,{value:String(e),children:e},e)}))})]}),e("div",{className:"flex gap-2",children:[n(i,{size:S,appearance:"ghost",className:"border p-1",color:b,radius:v,onClick:function(){f.firstPage(),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:0})),z("1")},disabled:0===N,children:n(a,{})}),n(i,{size:S,appearance:"ghost",className:"border p-1",color:b,radius:v,onClick:function(){f.previousPage(),z(String(f.getState().pagination.pageIndex)),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:f.options.pagination.pageIndex-1}))},disabled:0===N,children:n(o,{})})]}),n("div",{children:function(){for(var e=[],t=f.options.pagination?f.options.pagination.pageIndex:f.getState().pagination.pageIndex,i=function(i){e.push(n(c,{size:S,appearance:"ghost",onClick:function(){t!==i&&(f.setPageIndex(i),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:i})),z(String(i+1)))},color:t===i?b:"slate",radius:v,children:i+1},i))},a=0;a<f.getPageCount();a++)i(a);return e.length>10&&(t-3>0&&t+3<f.getPageCount()?((e=e.slice(t-2,t+3)).unshift(n(c,{size:S,appearance:"ghost",onClick:function(){f.setPageIndex(0),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:0})),z("1")},color:0===t?b:"slate",radius:v,children:1},0),n(c,{appearance:"ghost",disabled:!0,size:S,children:"..."})),e.push(n(c,{appearance:"ghost",disabled:!0,size:S,children:"..."}),n(c,{size:S,appearance:"ghost",onClick:function(){f.setPageIndex(f.getPageCount()-1),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:f.getPageCount()-1})),z(String(f.getPageCount()))},color:t===f.getPageCount()-1?b:"slate",radius:v,children:f.getPageCount()},f.getPageCount()-1))):t-3<=0?(e=e.slice(0,7)).push(n(c,{appearance:"ghost",disabled:!0,size:S,children:"..."}),n(c,{size:S,appearance:"ghost",onClick:function(){f.setPageIndex(f.getPageCount()-1),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:f.getPageCount()-1})),z(String(f.getPageCount()))},color:t===f.getPageCount()-1?b:"slate",radius:v,children:f.getPageCount()},f.getPageCount()-1)):(e=e.slice(f.getPageCount()-7,f.getPageCount())).unshift(n(c,{size:S,appearance:"ghost",onClick:function(){f.setPageIndex(0),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:0})),z("1")},color:0===t?b:"slate",radius:v,children:1},0),n(c,{appearance:"ghost",disabled:!0,size:S,children:"..."}))),e}()}),e("div",{className:"flex gap-2",children:[n(i,{size:S,appearance:"ghost",className:"border p-1",color:b,radius:v,onClick:function(){f.nextPage(),z(String(f.getState().pagination.pageIndex+2)),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:f.options.pagination.pageIndex+1}))},disabled:N===f.getPageCount()-1,children:n(s,{})}),n(i,{size:S,appearance:"ghost",className:"border p-1",color:b,radius:v,onClick:function(){f.lastPage(),z(String(f.getPageCount())),f.options.setPagination&&f.options.setPagination(u(u({},f.options.pagination),{pageIndex:f.getPageCount()-1}))},disabled:N===f.getPageCount()-1,children:n(g,{})})]})]}),!(null===(x=f.options)||void 0===x?void 0:x.disableInputPagination)&&e("div",{className:"mt-4 flex items-center justify-center gap-2",children:[n(l.Root,{size:S,type:"number",color:b,radius:v,min:"1",max:f.getPageCount(),value:I,onChange:function(e){z(e.target.value)},className:"w-[50px] border"}),e(d,{children:["/ ",f.getPageCount()]}),n(c,{size:S,onClick:function(){return f.setPageIndex(I?Number(I)-1:0)},color:b,radius:v,children:"이동"})]})]})}export{P as default};
|
2
2
|
//# sourceMappingURL=NumberingPagination.mjs.map
|