@lotte-innovate/ui-component-test 0.1.69-beta.6 → 0.1.69-beta.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ import { forwardRef } from 'react';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { scalingVariants, textColorStyle } from '../../../lib/constants';
28
28
  import { cn } from '../../../lib/utils/utils';
29
+ import { useTheme } from '../../../lib/theme';
29
30
  export var FooterVariants = cva("py-3 px-8 container flex flex-col items-center justify-between gap-4 ", {
30
31
  variants: {
31
32
  scaling: __assign({}, scalingVariants),
@@ -44,7 +45,13 @@ export var FooterVariants = cva("py-3 px-8 container flex flex-col items-center
44
45
  });
45
46
  export var Footer = forwardRef(function (_a, ref) {
46
47
  var className = _a.className, children = _a.children, scaling = _a.scaling, size = _a.size, color = _a.color, props = __rest(_a, ["className", "children", "scaling", "size", "color"]);
47
- return (_jsx("footer", __assign({ ref: ref }, props, { children: _jsx("div", { className: cn(FooterVariants({ scaling: scaling, size: size, color: color }), className), children: _jsx("p", { className: "text-center leading-loose", children: children }) }) })));
48
+ var theme = useTheme().theme;
49
+ var contextValue = {
50
+ scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling,
51
+ color: color !== null && color !== void 0 ? color : theme.themeColor,
52
+ size: size,
53
+ };
54
+ return (_jsx("footer", __assign({ ref: ref }, props, { children: _jsx("div", { className: cn(FooterVariants(contextValue), className), children: _jsx("p", { className: "text-center leading-loose", children: children }) }) })));
48
55
  });
49
56
  Footer.displayName = 'Footer';
50
57
  export default Footer;
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{cva as t}from"class-variance-authority";import{scalingVariants as o,textColorStyle as a}from"../../constants.mjs";import{cn as n}from"../../utils/utils.mjs";var l=function(){return l=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},l.apply(this,arguments)},i=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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t},s=t("py-3 px-8 container flex flex-col items-center justify-between gap-4 ",{variants:{scaling:l({},o),size:{small:"text-xs",medium:"text-sm",large:"text-base"},color:a()},defaultVariants:{scaling:"100%",size:"medium",color:"black"}}),c=r((function(r,t){var o=r.className,a=r.children,c=r.scaling,m=r.size,p=r.color,f=i(r,["className","children","scaling","size","color"]);return e("footer",l({ref:t},f,{children:e("div",{className:n(s({scaling:c,size:m,color:p}),o),children:e("p",{className:"text-center leading-loose",children:a})})}))}));c.displayName="Footer";export{c as Footer,s as FooterVariants,c as default};
2
+ import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{cva as t}from"class-variance-authority";import{scalingVariants as o,textColorStyle as l}from"../../constants.mjs";import{cn as a}from"../../utils/utils.mjs";import{useTheme as n}from"../../theme/ThemeProvider.mjs";var i=function(){return i=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var l in r=arguments[t])Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);return e},i.apply(this,arguments)},s=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 l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)r.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(t[o[l]]=e[o[l]])}return t},c=t("py-3 px-8 container flex flex-col items-center justify-between gap-4 ",{variants:{scaling:i({},o),size:{small:"text-xs",medium:"text-sm",large:"text-base"},color:l()},defaultVariants:{scaling:"100%",size:"medium",color:"black"}}),m=r((function(r,t){var o=r.className,l=r.children,m=r.scaling,p=r.size,f=r.color,u=s(r,["className","children","scaling","size","color"]),h=n().theme,y={scaling:null!=m?m:h.themeScaling,color:null!=f?f:h.themeColor,size:p};return e("footer",i({ref:t},u,{children:e("div",{className:a(c(y),o),children:e("p",{className:"text-center leading-loose",children:l})})}))}));m.displayName="Footer";export{m as Footer,c as FooterVariants,m as default};
3
3
  //# sourceMappingURL=index.mjs.map
@@ -23,10 +23,9 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { forwardRef, useContext } from 'react';
25
25
  import { cva } from 'class-variance-authority';
26
- import LogoImage from 'stories/assets/logo.png';
27
26
  import { GnbContext } from './GnbRoot';
28
27
  import { cn } from '../../../lib/utils/utils';
29
- import Image from 'next/image';
28
+ import { Text } from '../../../lib/Typography';
30
29
  var gnbLogoVariants = cva('mr-4 flex items-center space-x-2 lg:mr-6', {
31
30
  variants: {
32
31
  size: {
@@ -42,6 +41,6 @@ var gnbLogoVariants = cva('mr-4 flex items-center space-x-2 lg:mr-6', {
42
41
  export var GnbLogo = forwardRef(function (_a, ref) {
43
42
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
44
43
  var size = useContext(GnbContext).size;
45
- return (_jsx("a", __assign({ href: "/", className: cn(gnbLogoVariants({ size: size }), className) }, props, { children: children !== null && children !== void 0 ? children : _jsx(Image, { src: LogoImage, alt: "logo" }) })));
44
+ return (_jsx("a", __assign({ href: "/", className: cn(gnbLogoVariants({ size: size }), className) }, props, { children: children !== null && children !== void 0 ? children : _jsx(Text, { children: "LOGO \uC601\uC5ED" }) })));
46
45
  });
47
46
  GnbLogo.displayName = 'Gnb.Logo';
@@ -1,2 +1,2 @@
1
- import{jsx as r}from"react/jsx-runtime";import{forwardRef as t,useContext as e}from"react";import{cva as o}from"class-variance-authority";import a from"stories/assets/logo.png";import{GnbContext as s}from"./GnbRoot.mjs";import{cn as i}from"../../utils/utils.mjs";import n from"../../../../_virtual/image.mjs";var l=function(){return l=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var a in t=arguments[e])Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]);return r},l.apply(this,arguments)},m=function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(r);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(e[o[a]]=r[o[a]])}return e},p=o("mr-4 flex items-center space-x-2 lg:mr-6",{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"}}),c=t((function(t,o){var c=t.children,f=t.className,u=m(t,["children","className"]),x=e(s).size;return r("a",l({href:"/",className:i(p({size:x}),f)},u,{children:null!=c?c:r(n,{src:a,alt:"logo"})}))}));c.displayName="Gnb.Logo";export{c as GnbLogo};
1
+ import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,useContext as t}from"react";import{cva as o}from"class-variance-authority";import{GnbContext as a}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,o=arguments.length;t<o;t++)for(var a in e=arguments[t])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},s.apply(this,arguments)},p=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(r);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(r,o[a])&&(t[o[a]]=r[o[a]])}return t},m=o("mr-4 flex items-center space-x-2 lg:mr-6",{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"}}),l=e((function(e,o){var l=e.children,c=e.className,f=p(e,["children","className"]),u=t(a).size;return r("a",s({href:"/",className:n(m({size:u}),c)},f,{children:null!=l?l:r(i,{children:"LOGO 영역"})}))}));l.displayName="Gnb.Logo";export{l 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 LogoImage from 'stories/assets/logo.png';\nimport { GnbContext } from './GnbRoot';\nimport { cn } from '../../../lib/utils/utils';\nimport Image from 'next/image';\nvar gnbLogoVariants = cva('mr-4 flex items-center space-x-2 lg:mr-6', {\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, props = __rest(_a, [\"children\", \"className\"]);\n var size = useContext(GnbContext).size;\n return (_jsx(\"a\", __assign({ href: \"/\", className: cn(gnbLogoVariants({ size: size }), className) }, props, { children: children !== null && children !== void 0 ? children : _jsx(Image, { src: LogoImage, alt: \"logo\" }) })));\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","props","useContext","GnbContext","_jsx","href","cn","Image","src","LogoImage","alt","displayName"],"mappings":"qTAAA,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,EAQIiB,EAAkBC,EAAI,2CAA4C,CAClEC,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,EAAQnB,EAAOe,EAAI,CAAC,WAAY,cAClFP,EAAOY,EAAWC,GAAYb,KAClC,OAAQc,EAAK,IAAKrC,EAAS,CAAEsC,KAAM,IAAKL,UAAWM,EAAGnB,EAAgB,CAAEG,KAAMA,IAASU,IAAcC,EAAO,CAAEF,SAAUA,QAA2CA,EAAWK,EAAKG,EAAO,CAAEC,IAAKC,EAAWC,IAAK,WACrN,IACAf,EAAQgB,YAAc"}
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 space-x-2 lg:mr-6', {\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, props = __rest(_a, [\"children\", \"className\"]);\n var size = useContext(GnbContext).size;\n return (_jsx(\"a\", __assign({ 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","props","useContext","GnbContext","_jsx","href","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,2CAA4C,CAClEC,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,EAAQnB,EAAOe,EAAI,CAAC,WAAY,cAClFP,EAAOY,EAAWC,GAAYb,KAClC,OAAQc,EAAK,IAAKrC,EAAS,CAAEsC,KAAM,IAAKL,UAAWM,EAAGnB,EAAgB,CAAEG,KAAMA,IAASU,IAAcC,EAAO,CAAEF,SAAUA,QAA2CA,EAAWK,EAAKG,EAAM,CAAER,SAAU,cACzM,IACAJ,EAAQa,YAAc"}
@@ -26,6 +26,7 @@ import { forwardRef, createContext } from 'react';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { scalingVariants } from '../../../lib/constants';
28
28
  import { cn } from '../../../lib/utils/utils';
29
+ import { useTheme } from '../../../lib/theme';
29
30
  var GnbVariants = cva('sticky top-0 z-50 w-full px-8 backdrop-blur flex items-center', {
30
31
  variants: {
31
32
  scaling: __assign({}, scalingVariants),
@@ -45,7 +46,8 @@ export var GnbContext = createContext({
45
46
  });
46
47
  export var Gnb = forwardRef(function (_a, ref) {
47
48
  var children = _a.children, className = _a.className, size = _a.size, scaling = _a.scaling, props = __rest(_a, ["children", "className", "size", "scaling"]);
48
- var contextValue = { size: size };
49
- return (_jsx(GnbContext.Provider, { value: contextValue, children: _jsx("header", __assign({ className: cn(GnbVariants({ size: size, scaling: scaling }), className), ref: ref }, props, { children: children })) }));
49
+ var theme = useTheme().theme;
50
+ var contextValue = { size: size, scaling: scaling !== null && scaling !== void 0 ? scaling : theme.themeScaling };
51
+ return (_jsx(GnbContext.Provider, { value: contextValue, children: _jsx("header", __assign({ className: cn(GnbVariants(contextValue), className), ref: ref }, props, { children: children })) }));
50
52
  });
51
53
  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 i}from"class-variance-authority";import{scalingVariants as a}from"../../constants.mjs";import{cn as n}from"../../utils/utils.mjs";var s=function(){return s=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},s.apply(this,arguments)},o=function(e,r){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(t[i[a]]=e[i[a]])}return t},l=i("sticky top-0 z-50 w-full px-8 backdrop-blur flex items-center",{variants:{scaling:s({},a),size:{small:"text-xs h-12",medium:"text-sm h-14",large:"text-base h-16"}},defaultVariants:{scaling:"100%",size:"medium"}}),c=r({size:"medium"}),m=t((function(r,t){var i=r.children,a=r.className,m=r.size,p=r.scaling,f=o(r,["children","className","size","scaling"]),u={size:m};return e(c.Provider,{value:u,children:e("header",s({className:n(l({size:m,scaling:p}),a),ref:t},f,{children:i}))})}));m.displayName="Gnb.Root";export{m as Gnb,c as GnbContext};
2
+ import{jsx as e}from"react/jsx-runtime";import{createContext as r,forwardRef as t}from"react";import{cva as i}from"class-variance-authority";import{scalingVariants as a}from"../../constants.mjs";import{cn as n}from"../../utils/utils.mjs";import{useTheme as o}from"../../theme/ThemeProvider.mjs";var s=function(){return s=Object.assign||function(e){for(var r,t=1,i=arguments.length;t<i;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},s.apply(this,arguments)},l=function(e,r){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(t[i[a]]=e[i[a]])}return t},m=i("sticky top-0 z-50 w-full px-8 backdrop-blur flex items-center",{variants:{scaling:s({},a),size:{small:"text-xs h-12",medium:"text-sm h-14",large:"text-base h-16"}},defaultVariants:{scaling:"100%",size:"medium"}}),c=r({size:"medium"}),p=t((function(r,t){var i=r.children,a=r.className,p=r.size,f=r.scaling,u=l(r,["children","className","size","scaling"]),h=o().theme,d={size:p,scaling:null!=f?f:h.themeScaling};return e(c.Provider,{value:d,children:e("header",s({className:n(m(d),a),ref:t},u,{children:i}))})}));p.displayName="Gnb.Root";export{p as Gnb,c as GnbContext};
3
3
  //# sourceMappingURL=GnbRoot.mjs.map
@@ -0,0 +1,2 @@
1
+ declare function Pagination({ table }: any): import("react/jsx-runtime").JSX.Element;
2
+ export default Pagination;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import IconButton from '../IconButton';
3
+ import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons';
4
+ import TextField from '../TextField';
5
+ import Select from '../Select';
6
+ function Pagination(_a) {
7
+ var _b;
8
+ var table = _a.table;
9
+ var color = (_b = table.options.color) !== null && _b !== void 0 ? _b : 'red';
10
+ return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconButton, { className: "rounded border p-1", color: color, onClick: function () { return table.firstPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", color: color, onClick: function () { return table.previousPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(ChevronLeftIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", color: color, onClick: function () { return table.nextPage(); }, disabled: !table.getCanNextPage(), children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", color: color, onClick: function () { return table.lastPage(); }, disabled: !table.getCanNextPage(), children: _jsx(DoubleArrowRightIcon, {}) }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx("div", { children: "Page" }), _jsxs("strong", { children: [table.getState().pagination.pageIndex + 1, " of ", table.getPageCount().toLocaleString()] })] }), _jsxs("span", { className: "flex items-center gap-1", children: ["| Go to page:", _jsx(TextField.Root, { type: "number", color: color, min: "1", max: table.getPageCount(), defaultValue: table.getState().pagination.pageIndex + 1, onChange: function (e) {
11
+ var page = e.target.value ? Number(e.target.value) - 1 : 0;
12
+ table.setPageIndex(page);
13
+ }, className: "w-16 rounded border p-1" })] }), _jsxs(Select.Root, { color: color, value: String(table.getState().pagination.pageSize), defaultValue: String(table.getState().pagination.pageSize), onValueChange: function (e) {
14
+ table.setPageSize(Number(e));
15
+ }, children: [_jsx(Select.Trigger, {}), _jsx(Select.Content, { children: [10, 20, 30, 40, 50].map(function (pageSize) { return (_jsx(Select.Item, { value: String(pageSize), children: pageSize }, pageSize)); }) })] })] }));
16
+ }
17
+ export default Pagination;
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{IconButton as t}from"../IconButton/index.mjs";import{DoubleArrowLeftIcon as a,ChevronLeftIcon as r,ChevronRightIcon as o,DoubleArrowRightIcon as i}from"@radix-ui/react-icons";import l from"../TextField/index.mjs";import d from"../Select/index.mjs";function c(c){var g,u=c.table,s=null!==(g=u.options.color)&&void 0!==g?g:"red";return e("div",{className:"flex items-center gap-2",children:[n(t,{className:"rounded border p-1",color:s,onClick:function(){return u.firstPage()},disabled:!u.getCanPreviousPage(),children:n(a,{})}),n(t,{className:"rounded border p-1",color:s,onClick:function(){return u.previousPage()},disabled:!u.getCanPreviousPage(),children:n(r,{})}),n(t,{className:"rounded border p-1",color:s,onClick:function(){return u.nextPage()},disabled:!u.getCanNextPage(),children:n(o,{})}),n(t,{className:"rounded border p-1",color:s,onClick:function(){return u.lastPage()},disabled:!u.getCanNextPage(),children:n(i,{})}),e("span",{className:"flex items-center gap-1",children:[n("div",{children:"Page"}),e("strong",{children:[u.getState().pagination.pageIndex+1," of ",u.getPageCount().toLocaleString()]})]}),e("span",{className:"flex items-center gap-1",children:["| Go to page:",n(l.Root,{type:"number",color:s,min:"1",max:u.getPageCount(),defaultValue:u.getState().pagination.pageIndex+1,onChange:function(e){var n=e.target.value?Number(e.target.value)-1:0;u.setPageIndex(n)},className:"w-16 rounded border p-1"})]}),e(d.Root,{color:s,value:String(u.getState().pagination.pageSize),defaultValue:String(u.getState().pagination.pageSize),onValueChange:function(e){u.setPageSize(Number(e))},children:[n(d.Trigger,{}),n(d.Content,{children:[10,20,30,40,50].map((function(e){return n(d.Item,{value:String(e),children:e},e)}))})]})]})}export{c as default};
2
+ //# sourceMappingURL=Pagination.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.mjs","sources":["../../../../../lib/components/Grid/Pagination.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport IconButton from '../IconButton';\nimport { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons';\nimport TextField from '../TextField';\nimport Select from '../Select';\nfunction Pagination(_a) {\n var _b;\n var table = _a.table;\n var color = (_b = table.options.color) !== null && _b !== void 0 ? _b : 'red';\n return (_jsxs(\"div\", { className: \"flex items-center gap-2\", children: [_jsx(IconButton, { className: \"rounded border p-1\", color: color, onClick: function () { return table.firstPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { className: \"rounded border p-1\", color: color, onClick: function () { return table.previousPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(ChevronLeftIcon, {}) }), _jsx(IconButton, { className: \"rounded border p-1\", color: color, onClick: function () { return table.nextPage(); }, disabled: !table.getCanNextPage(), children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { className: \"rounded border p-1\", color: color, onClick: function () { return table.lastPage(); }, disabled: !table.getCanNextPage(), children: _jsx(DoubleArrowRightIcon, {}) }), _jsxs(\"span\", { className: \"flex items-center gap-1\", children: [_jsx(\"div\", { children: \"Page\" }), _jsxs(\"strong\", { children: [table.getState().pagination.pageIndex + 1, \" of \", table.getPageCount().toLocaleString()] })] }), _jsxs(\"span\", { className: \"flex items-center gap-1\", children: [\"| Go to page:\", _jsx(TextField.Root, { type: \"number\", color: color, min: \"1\", max: table.getPageCount(), defaultValue: table.getState().pagination.pageIndex + 1, onChange: function (e) {\n var page = e.target.value ? Number(e.target.value) - 1 : 0;\n table.setPageIndex(page);\n }, className: \"w-16 rounded border p-1\" })] }), _jsxs(Select.Root, { color: color, value: String(table.getState().pagination.pageSize), defaultValue: String(table.getState().pagination.pageSize), onValueChange: function (e) {\n table.setPageSize(Number(e));\n }, children: [_jsx(Select.Trigger, {}), _jsx(Select.Content, { children: [10, 20, 30, 40, 50].map(function (pageSize) { return (_jsx(Select.Item, { value: String(pageSize), children: pageSize }, pageSize)); }) })] })] }));\n}\nexport default Pagination;\n"],"names":["Pagination","_a","_b","table","color","options","_jsxs","className","children","_jsx","IconButton","onClick","firstPage","disabled","getCanPreviousPage","DoubleArrowLeftIcon","previousPage","ChevronLeftIcon","nextPage","getCanNextPage","ChevronRightIcon","lastPage","DoubleArrowRightIcon","getState","pagination","pageIndex","getPageCount","toLocaleString","TextField","Root","type","min","max","defaultValue","onChange","e","page","target","value","Number","setPageIndex","Select","String","pageSize","onValueChange","setPageSize","Trigger","Content","map","Item"],"mappings":"iTAKA,SAASA,EAAWC,GAChB,IAAIC,EACAC,EAAQF,EAAGE,MACXC,EAAuC,QAA9BF,EAAKC,EAAME,QAAQD,aAA0B,IAAPF,EAAgBA,EAAK,MACxE,OAAQI,EAAM,MAAO,CAAEC,UAAW,0BAA2BC,SAAU,CAACC,EAAKC,EAAY,CAAEH,UAAW,qBAAsBH,MAAOA,EAAOO,QAAS,WAAc,OAAOR,EAAMS,WAAc,EAAEC,UAAWV,EAAMW,qBAAsBN,SAAUC,EAAKM,EAAqB,MAAQN,EAAKC,EAAY,CAAEH,UAAW,qBAAsBH,MAAOA,EAAOO,QAAS,WAAc,OAAOR,EAAMa,cAAe,EAAIH,UAAWV,EAAMW,qBAAsBN,SAAUC,EAAKQ,EAAiB,CAAE,KAAMR,EAAKC,EAAY,CAAEH,UAAW,qBAAsBH,MAAOA,EAAOO,QAAS,WAAc,OAAOR,EAAMe,YAAeL,UAAWV,EAAMgB,iBAAkBX,SAAUC,EAAKW,EAAkB,CAAE,KAAMX,EAAKC,EAAY,CAAEH,UAAW,qBAAsBH,MAAOA,EAAOO,QAAS,WAAc,OAAOR,EAAMkB,YAAeR,UAAWV,EAAMgB,iBAAkBX,SAAUC,EAAKa,EAAsB,CAAA,KAAQhB,EAAM,OAAQ,CAAEC,UAAW,0BAA2BC,SAAU,CAACC,EAAK,MAAO,CAAED,SAAU,SAAWF,EAAM,SAAU,CAAEE,SAAU,CAACL,EAAMoB,WAAWC,WAAWC,UAAY,EAAG,OAAQtB,EAAMuB,eAAeC,uBAA0BrB,EAAM,OAAQ,CAAEC,UAAW,0BAA2BC,SAAU,CAAC,gBAAiBC,EAAKmB,EAAUC,KAAM,CAAEC,KAAM,SAAU1B,MAAOA,EAAO2B,IAAK,IAAKC,IAAK7B,EAAMuB,eAAgBO,aAAc9B,EAAMoB,WAAWC,WAAWC,UAAY,EAAGS,SAAU,SAAUC,GACnyC,IAAIC,EAAOD,EAAEE,OAAOC,MAAQC,OAAOJ,EAAEE,OAAOC,OAAS,EAAI,EACzDnC,EAAMqC,aAAaJ,EACtB,EAAE7B,UAAW,+BAAkCD,EAAMmC,EAAOZ,KAAM,CAAEzB,MAAOA,EAAOkC,MAAOI,OAAOvC,EAAMoB,WAAWC,WAAWmB,UAAWV,aAAcS,OAAOvC,EAAMoB,WAAWC,WAAWmB,UAAWC,cAAe,SAAUT,GACjOhC,EAAM0C,YAAYN,OAAOJ,GAC7C,EAAmB3B,SAAU,CAACC,EAAKgC,EAAOK,QAAS,CAAE,GAAGrC,EAAKgC,EAAOM,QAAS,CAAEvC,SAAU,CAAC,GAAI,GAAI,GAAI,GAAI,IAAIwC,KAAI,SAAUL,GAAY,OAAQlC,EAAKgC,EAAOQ,KAAM,CAAEX,MAAOI,OAAOC,GAAWnC,SAAUmC,GAAYA,EAAa,WAChO"}
@@ -1,5 +1,4 @@
1
- import './index.css';
2
1
  declare function Grid({ table }: {
3
2
  table: any;
4
3
  }): import("react/jsx-runtime").JSX.Element;
5
- export { Grid };
4
+ export default Grid;
@@ -1,52 +1,45 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { flexRender } from '@tanstack/react-table';
3
- import './index.css';
4
+ // import './index.css';
4
5
  import Table from '../Table';
5
- import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons';
6
- import IconButton from '../IconButton';
7
- import Select from '../Select';
8
- import TextField from '../TextField';
6
+ import { ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';
7
+ import Pagination from './Pagination';
8
+ import { cn } from '../../../lib/utils/utils';
9
9
  function Grid(_a) {
10
+ var _b, _c, _d;
10
11
  var table = _a.table;
11
- return (_jsx("div", { className: "p-2", children: _jsx("div", { style: { direction: table.options.columnResizeDirection }, children: _jsxs("div", { className: "overflow-x-auto", children: [_jsxs(Table.Root, { style: {
12
- width: table.getCenterTotalSize(),
13
- }, children: [_jsx(Table.Header, { children: table
14
- .getHeaderGroups()
15
- .map(function (headerGroup) {
16
- return (_jsx(Table.Row, { children: headerGroup.headers.map(function (header) {
17
- var _a, _b;
18
- return (_jsxs(Table.ColumnHeaderCell, { colSpan: header.colSpan,
19
- style: {
20
- width: header.getSize(),
21
- }, children: [header.isPlaceholder ? null : (_jsxs("div", { className: header.column.getCanSort() ? 'cursor-pointer select-none' : '', onClick: header.column.getToggleSortingHandler(), title: header.column.getCanSort()
22
- ? header.column.getNextSortingOrder() === 'asc'
23
- ? 'Sort ascending'
24
- : header.column.getNextSortingOrder() === 'desc'
25
- ? 'Sort descending'
26
- : 'Clear sort'
27
- : undefined, children: [flexRender(header.column.columnDef.header, header.getContext()), (_a = {
28
- asc: ' 🔼',
29
- desc: ' 🔽',
30
- }[header.column.getIsSorted()]) !== null && _a !== void 0 ? _a : null] })), _jsx("div", { onDoubleClick: function () { return header.column.resetSize(); },
31
- onMouseDown: header.getResizeHandler(),
32
- onTouchStart: header.getResizeHandler(),
33
- className: "resizer ".concat(table.options.columnResizeDirection, " ").concat(header.column.getIsResizing() ? 'isResizing' : ''),
34
- style: {
35
- transform: header.column.getIsResizing()
36
- ? "translateX(".concat((table.options.columnResizeDirection === 'rtl' ? -1 : 1) *
37
- ((_b = table.getState().columnSizingInfo.deltaOffset) !== null && _b !== void 0 ? _b : 0), "px)")
38
- : '',
39
- } })] }, header.id));
40
- }) }, headerGroup.id));
41
- }) }), _jsx(Table.Body, { children: table
42
- .getRowModel()
43
- .rows.map(function (row) { return (_jsx(Table.Row, { children: row.getVisibleCells().map(function (cell) { return (_jsx(Table.Cell, { style: {
44
- width: cell.column.getSize(),
45
- }, className: "h-[30px]", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)); }) }, row.id)); }) })] }), _jsx("div", { className: "h-2" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(IconButton, { className: "rounded border p-1", onClick: function () { return table.firstPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", onClick: function () { return table.previousPage(); }, disabled: !table.getCanPreviousPage(), children: _jsx(ChevronLeftIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", onClick: function () { return table.nextPage(); }, disabled: !table.getCanNextPage(), children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { className: "rounded border p-1", onClick: function () { return table.lastPage(); }, disabled: !table.getCanNextPage(), children: _jsx(DoubleArrowRightIcon, {}) }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx("div", { children: "Page" }), _jsxs("strong", { children: [table.getState().pagination.pageIndex + 1, " of", ' ', table.getPageCount().toLocaleString()] })] }), _jsxs("span", { className: "flex items-center gap-1", children: ["| Go to page:", _jsx(TextField.Root, { type: "number", min: "1", max: table.getPageCount(), defaultValue: table.getState().pagination.pageIndex + 1, onChange: function (e) {
46
- var page = e.target.value ? Number(e.target.value) - 1 : 0;
47
- table.setPageIndex(page);
48
- }, className: "w-16 rounded border p-1" })] }), _jsxs(Select.Root, { value: String(table.getState().pagination.pageSize), defaultValue: String(table.getState().pagination.pageSize), onValueChange: function (e) {
49
- table.setPageSize(Number(e));
50
- }, children: [_jsx(Select.Trigger, {}), _jsx(Select.Content, { children: [10, 20, 30, 40, 50].map(function (pageSize) { return (_jsx(Select.Item, { value: String(pageSize), children: pageSize }, pageSize)); }) })] })] })] }) }) }));
12
+ return (_jsx("div", { style: { direction: table.options.columnResizeDirection }, children: _jsxs("div", { className: "overflow-x-auto", children: [_jsxs(Table.Root, { style: {
13
+ // width: table.getCenterTotalSize(),
14
+ }, appearance: (_b = table.options) === null || _b === void 0 ? void 0 : _b.appearance, radius: (_c = table.options) === null || _c === void 0 ? void 0 : _c.radius, children: [_jsx(Table.Header, { children: table
15
+ .getHeaderGroups()
16
+ .map(function (headerGroup) {
17
+ return (_jsx(Table.Row, { children: headerGroup.headers.map(function (header) {
18
+ var _a;
19
+ return (_jsxs(Table.ColumnHeaderCell, { colSpan: header.colSpan,
20
+ style: {
21
+ width: header.getSize(),
22
+ }, children: [header.isPlaceholder ? null : (_jsxs("div", { className: header.column.getCanSort() ? 'flex cursor-pointer select-none' : '', onClick: header.column.getToggleSortingHandler(), title: header.column.getCanSort()
23
+ ? header.column.getNextSortingOrder() === 'asc'
24
+ ? 'Sort ascending'
25
+ : header.column.getNextSortingOrder() === 'desc'
26
+ ? 'Sort descending'
27
+ : 'Clear sort'
28
+ : undefined, children: [flexRender(header.column.columnDef.header, header.getContext()), header.column.getIsSorted() == 'asc' ? (_jsx(ChevronUpIcon, {})) : header.column.getIsSorted() == 'desc' ? (_jsx(ChevronDownIcon, {})) : null] })), _jsx("div", { onDoubleClick: function () { return header.column.resetSize(); },
29
+ onMouseDown: header.getResizeHandler(),
30
+ onTouchStart: header.getResizeHandler(),
31
+ className: cn('resizer', table.options.columnResizeDirection, header.column.getIsResizing() ? 'bg-red-12' : ''),
32
+ style: {
33
+ transform: header.column.getIsResizing()
34
+ ? "translateX(".concat((table.options.columnResizeDirection === 'rtl' ? -1 : 1) *
35
+ ((_a = table.getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0), "px)")
36
+ : '',
37
+ } })] }, header.id));
38
+ }) }, headerGroup.id));
39
+ }) }), _jsx(Table.Body, { children: table
40
+ .getRowModel()
41
+ .rows.map(function (row) { return (_jsx(Table.Row, { children: row.getVisibleCells().map(function (cell) { return (_jsx(Table.Cell, { style: {
42
+ width: cell.column.getSize(),
43
+ }, className: "h-[30px]", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)); }) }, row.id)); }) })] }), _jsx("div", { className: "h-2" }), ((_d = table.options) === null || _d === void 0 ? void 0 : _d.enableRowPagination) && _jsx(Pagination, { table: table })] }) }));
51
44
  }
52
- export { Grid };
45
+ export default Grid;
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{flexRender as n}from"../../../../node_modules/@tanstack/react-table/build/lib/index.mjs";import t from"../Table/index.mjs";import{ChevronUpIcon as i,ChevronDownIcon as l}from"@radix-ui/react-icons";import r from"./Pagination.mjs";import{cn as c}from"../../utils/utils.mjs";function a(a){var s,d,u,m=a.table;return e("div",{style:{direction:m.options.columnResizeDirection},children:o("div",{className:"overflow-x-auto",children:[o(t.Root,{style:{},appearance:null===(s=m.options)||void 0===s?void 0:s.appearance,radius:null===(d=m.options)||void 0===d?void 0:d.radius,children:[e(t.Header,{children:m.getHeaderGroups().map((function(r){return e(t.Row,{children:r.headers.map((function(r){var a;return o(t.ColumnHeaderCell,{colSpan:r.colSpan,style:{width:r.getSize()},children:[r.isPlaceholder?null:o("div",{className:r.column.getCanSort()?"flex cursor-pointer select-none":"",onClick:r.column.getToggleSortingHandler(),title:r.column.getCanSort()?"asc"===r.column.getNextSortingOrder()?"Sort ascending":"desc"===r.column.getNextSortingOrder()?"Sort descending":"Clear sort":void 0,children:[n(r.column.columnDef.header,r.getContext()),"asc"==r.column.getIsSorted()?e(i,{}):"desc"==r.column.getIsSorted()?e(l,{}):null]}),e("div",{onDoubleClick:function(){return r.column.resetSize()},onMouseDown:r.getResizeHandler(),onTouchStart:r.getResizeHandler(),className:c("resizer",m.options.columnResizeDirection,r.column.getIsResizing()?"bg-red-12":""),style:{transform:r.column.getIsResizing()?"translateX(".concat(("rtl"===m.options.columnResizeDirection?-1:1)*(null!==(a=m.getState().columnSizingInfo.deltaOffset)&&void 0!==a?a:0),"px)"):""}})]},r.id)}))},r.id)}))}),e(t.Body,{children:m.getRowModel().rows.map((function(o){return e(t.Row,{children:o.getVisibleCells().map((function(o){return e(t.Cell,{style:{width:o.column.getSize()},className:"h-[30px]",children:n(o.column.columnDef.cell,o.getContext())},o.id)}))},o.id)}))})]}),e("div",{className:"h-2"}),(null===(u=m.options)||void 0===u?void 0:u.enableRowPagination)&&e(r,{table:m})]})})}export{a as default};
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,3 +1,3 @@
1
1
  export declare const useGrid: ({ ...props }: {
2
2
  [x: string]: any;
3
- }) => import("@tanstack/react-table").Table<any>;
3
+ }) => import("@tanstack/react-table").Table<unknown>;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  var __assign = (this && this.__assign) || function () {
2
3
  __assign = Object.assign || function(t) {
3
4
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -20,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
21
  }
21
22
  return t;
22
23
  };
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
25
  import { createColumnHelper, getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
25
26
  import React, { useRef } from 'react';
26
27
  import IconButton from '../IconButton';
@@ -32,19 +33,22 @@ function IndeterminateCheckbox(_a) {
32
33
  return (_jsx(Checkbox, { ref: ref, id: "checkbox", checked: checked, disabled: disabled, onCheckedChange: onChange, indeterminate: indeterminate }));
33
34
  }
34
35
  export var useGrid = function (_a) {
35
- var _b;
36
+ var _b, _c;
36
37
  var props = __rest(_a, []);
37
- var _c = React.useState([]), sorting = _c[0], setSorting = _c[1];
38
- var _d = React.useState({}), expanded = _d[0], setExpanded = _d[1];
39
- var _e = React.useState({}), rowSelection = _e[0], setRowSelection = _e[1];
38
+ var _d = React.useState([]), sorting = _d[0], setSorting = _d[1];
39
+ var _e = React.useState({}), expanded = _e[0], setExpanded = _e[1];
40
+ var _f = React.useState({}), rowSelection = _f[0], setRowSelection = _f[1];
40
41
  var columnHelper = createColumnHelper();
41
42
  var columnsData = (_b = props === null || props === void 0 ? void 0 : props.columns) === null || _b === void 0 ? void 0 : _b.map(function (el) {
42
43
  return columnHelper.accessor(el.id, __assign({}, el));
43
44
  });
44
- columnsData[0] = __assign(__assign({}, columnsData[0]), { cell: function (_a) {
45
- var row = _a.row, getValue = _a.getValue;
46
- return (_jsx("div", { className: "px-1", children: _jsxs("div", { className: "flex", children: [row.getCanExpand() ? (_jsx(IconButton, { onClick: row.getToggleExpandedHandler(), appearance: "ghost", children: row.getIsExpanded() ? _jsx(ChevronDownIcon, {}) : _jsx(ChevronRightIcon, {}) })) : (''), getValue()] }) }));
47
- } });
45
+ if (props.enableExpanding) {
46
+ var firstcell_1 = columnsData[0].cell;
47
+ columnsData[0] = __assign(__assign({}, columnsData[0]), { cell: function (props) {
48
+ var _a;
49
+ return (_jsxs("div", { className: "flex", style: { paddingLeft: "".concat(props.row.depth * 10, "px") }, children: [props.row.getCanExpand() ? (_jsx(IconButton, { onClick: props.row.getToggleExpandedHandler(), appearance: "ghost", className: "h-3 w-3", color: (_a = props.color) !== null && _a !== void 0 ? _a : 'red', children: props.row.getIsExpanded() ? _jsx(ChevronDownIcon, {}) : _jsx(ChevronRightIcon, {}) })) : (_jsx(_Fragment, {})), _jsx("div", { children: firstcell_1 ? firstcell_1(props) : props.getValue() })] }));
50
+ } });
51
+ }
48
52
  if (props.enableRowSelection) {
49
53
  columnsData === null || columnsData === void 0 ? void 0 : columnsData.unshift({
50
54
  id: 'select',
@@ -56,12 +60,16 @@ export var useGrid = function (_a) {
56
60
  },
57
61
  cell: function (_a) {
58
62
  var row = _a.row;
59
- return (_jsx("div", { className: "px-1", children: _jsx(IndeterminateCheckbox, { checked: row.getIsSelected(),
63
+ return (_jsx("div", { className: "px-1", style: { paddingLeft: "".concat(row.depth * 10, "px") }, children: _jsx(IndeterminateCheckbox, { checked: row.getIsSelected(),
60
64
  disabled: !row.getCanSelect(),
61
65
  indeterminate: row.getIsSomeSelected(),
62
66
  onChange: row.getToggleSelectedHandler() }) }));
63
67
  },
64
68
  });
65
69
  }
66
- return useReactTable(__assign(__assign({ state: { sorting: sorting, rowSelection: rowSelection, expanded: expanded } }, props), { data: props.data, columns: columnsData, getSubRows: function (row) { return row.subRows; }, enableRowSelection: props.enableRowSelection, onExpandedChange: setExpanded, onSortingChange: setSorting, onRowSelectionChange: setRowSelection, getSortedRowModel: getSortedRowModel(), getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), getExpandedRowModel: getExpandedRowModel() }));
70
+ var reactTableProps = __assign(__assign({ state: { sorting: sorting, rowSelection: rowSelection, expanded: expanded } }, props), { data: props.data, columns: columnsData, color: (_c = props.color) !== null && _c !== void 0 ? _c : 'red', paginateExpandedRows: true, enableExpanding: !!props.enableExpanding, getSubRows: function (row) { return row.subRows; }, onExpandedChange: setExpanded, onSortingChange: setSorting, onRowSelectionChange: setRowSelection, getSortedRowModel: getSortedRowModel(), getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel() });
71
+ if (props.enableRowPagination) {
72
+ reactTableProps['getPaginationRowModel'] = getPaginationRowModel();
73
+ }
74
+ return useReactTable(reactTableProps);
67
75
  };
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useReactTable as o}from"../../../../node_modules/@tanstack/react-table/build/lib/index.mjs";import r,{useRef as a}from"react";import{IconButton as l}from"../IconButton/index.mjs";import{ChevronDownIcon as d,ChevronRightIcon as i}from"@radix-ui/react-icons";import{Checkbox as c}from"../Checkbox/index.mjs";import{getSortedRowModel as s,getCoreRowModel as g,getExpandedRowModel as p,getPaginationRowModel as u,createColumnHelper as m}from"../../../../node_modules/@tanstack/table-core/build/lib/index.mjs";var f=function(){return f=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},f.apply(this,arguments)},h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]])}return t};function b(e){var t=e.indeterminate,o=e.checked,r=e.disabled,l=e.onChange,d=a();return n(c,{ref:d,id:"checkbox",checked:o,disabled:r,onCheckedChange:l,indeterminate:t})}var x=function(a){var c,x,w=h(a,[]),v=r.useState([]),S=v[0],y=v[1],R=r.useState({}),C=R[0],O=R[1],j=r.useState({}),k=j[0],E=j[1],I=m(),P=null===(c=null==w?void 0:w.columns)||void 0===c?void 0:c.map((function(e){return I.accessor(e.id,f({},e))}));if(w.enableExpanding){var M=P[0].cell;P[0]=f(f({},P[0]),{cell:function(o){var r;return e("div",{className:"flex",style:{paddingLeft:"".concat(10*o.row.depth,"px")},children:[o.row.getCanExpand()?n(l,{onClick:o.row.getToggleExpandedHandler(),appearance:"ghost",className:"h-3 w-3",color:null!==(r=o.color)&&void 0!==r?r:"red",children:o.row.getIsExpanded()?n(d,{}):n(i,{})}):n(t,{}),n("div",{children:M?M(o):o.getValue()})]})}})}w.enableRowSelection&&(null==P||P.unshift({id:"select",header:function(e){var t=e.table;return n("div",{className:"header-checkbox",children:n(b,{checked:t.getIsAllRowsSelected()||t.getIsSomeRowsSelected(),indeterminate:t.getIsSomeRowsSelected(),onChange:t.toggleAllRowsSelected})})},cell:function(e){var t=e.row;return n("div",{className:"px-1",style:{paddingLeft:"".concat(10*t.depth,"px")},children:n(b,{checked:t.getIsSelected(),disabled:!t.getCanSelect(),indeterminate:t.getIsSomeSelected(),onChange:t.getToggleSelectedHandler()})})}}));var N=f(f({state:{sorting:S,rowSelection:k,expanded:C}},w),{data:w.data,columns:P,color:null!==(x=w.color)&&void 0!==x?x:"red",paginateExpandedRows:!0,enableExpanding:!!w.enableExpanding,getSubRows:function(e){return e.subRows},onExpandedChange:O,onSortingChange:y,onRowSelectionChange:E,getSortedRowModel:s(),getCoreRowModel:g(),getExpandedRowModel:p()});return w.enableRowPagination&&(N.getPaginationRowModel=u()),o(N)};export{x as useGrid};
3
+ //# sourceMappingURL=useGrid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGrid.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -51,3 +51,5 @@ export { default as RadarChart } from './RadarChart';
51
51
  export { default as LineChart } from './LineChart';
52
52
  export { default as PieChart } from './PieChart';
53
53
  export { default as DoughnutChart } from './DoughnutChart';
54
+ export { default as Grid } from './Grid';
55
+ export { useGrid } from './Grid/useGrid';
@@ -53,3 +53,6 @@ export { default as RadarChart } from './RadarChart';
53
53
  export { default as LineChart } from './LineChart';
54
54
  export { default as PieChart } from './PieChart';
55
55
  export { default as DoughnutChart } from './DoughnutChart';
56
+ //Grid
57
+ export { default as Grid } from './Grid';
58
+ export { useGrid } from './Grid/useGrid';
@@ -1,2 +1,2 @@
1
- export{default as Accordion}from"./components/Accordion/index.mjs";export{default as AlertDialog}from"./components/AlertDialog/index.mjs";export{default as AspectRatio}from"./components/AspectRatio/index.mjs";export{default as Avatar}from"./components/Avatar/index.mjs";export{default as Badge}from"./components/Badge/index.mjs";export{default as Breadcrumb}from"./components/Breadcrumb/index.mjs";export{Button}from"./components/Button/index.mjs";export{default as Callout}from"./components/Callout/index.mjs";export{default as Card}from"./components/Card/index.mjs";export{Checkbox}from"./components/Checkbox/index.mjs";export{default as CheckboxCard}from"./components/CheckboxCard/index.mjs";export{default as CheckboxGroup}from"./components/CheckboxGroup/index.mjs";export{default as ContextMenu}from"./components/ContextMenu/index.mjs";export{default as DataList}from"./components/DataList/index.mjs";export{default as Dialog}from"./components/Dialog/index.mjs";export{default as DropdownMenu}from"./components/DropdownMenu/index.mjs";export{Footer}from"./components/Footer/index.mjs";export{default as Gnb}from"./components/Gnb/index.mjs";export{default as HoverCard}from"./components/HoverCard/index.mjs";export{IconButton}from"./components/IconButton/index.mjs";export{Inset}from"./components/Inset/index.mjs";export{Label}from"./components/Label/index.mjs";export{default as Menubar}from"./components/Menubar/index.mjs";export{default as NavigationMenu}from"./components/NavigationMenu/index.mjs";export{default as Popover}from"./components/Popover/index.mjs";export{Progress}from"./components/Progress/index.mjs";export{Radio}from"./components/Radio/index.mjs";export{default as RadioCards}from"./components/RadioCards/index.mjs";export{default as RadioGroup}from"./components/RadioGroup/index.mjs";export{ScrollArea}from"./components/ScrollArea/index.mjs";export{default as SegmentedControl}from"./components/SegmentedControl/index.mjs";export{default as Select}from"./components/Select/index.mjs";export{Separator}from"./components/Separator/index.mjs";export{Skeleton}from"./components/Skeleton/index.mjs";export{Slider}from"./components/Slider/index.mjs";export{Spinner}from"./components/Spinner/index.mjs";export{default as Table}from"./components/Table/index.mjs";export{default as TabNav}from"./components/TabNav/index.mjs";export{default as Tabs}from"./components/Tabs/index.mjs";export{TextArea}from"./components/TextArea/index.mjs";export{default as TextField}from"./components/TextField/index.mjs";export{default as Toast}from"./components/Toast/index.mjs";export{Toggle}from"./components/Toggle/index.mjs";export{ToggleWithText}from"./components/Toggle/ToggleWithText.mjs";export{default as ToggleGroup}from"./components/ToggleGroup/index.mjs";export{ToggleSwitch}from"./components/ToggleSwitch/index.mjs";export{default as Tooltip}from"./components/Tooltip/index.mjs";export{default as BarChart}from"./components/BarChart/index.mjs";export{BubbleChart}from"./components/BubbleChart/index.mjs";export{RadarChart}from"./components/RadarChart/index.mjs";export{default as LineChart}from"./components/LineChart/index.mjs";export{default as PieChart}from"./components/PieChart/index.mjs";export{default as DoughnutChart}from"./components/DoughnutChart/index.mjs";export{Header}from"./Typography/Header/index.mjs";export{Text}from"./Typography/Text/index.mjs";export{default as LuiThemeProvider,useTheme}from"./theme/ThemeProvider.mjs";
1
+ export{default as Accordion}from"./components/Accordion/index.mjs";export{default as AlertDialog}from"./components/AlertDialog/index.mjs";export{default as AspectRatio}from"./components/AspectRatio/index.mjs";export{default as Avatar}from"./components/Avatar/index.mjs";export{default as Badge}from"./components/Badge/index.mjs";export{default as Breadcrumb}from"./components/Breadcrumb/index.mjs";export{Button}from"./components/Button/index.mjs";export{default as Callout}from"./components/Callout/index.mjs";export{default as Card}from"./components/Card/index.mjs";export{Checkbox}from"./components/Checkbox/index.mjs";export{default as CheckboxCard}from"./components/CheckboxCard/index.mjs";export{default as CheckboxGroup}from"./components/CheckboxGroup/index.mjs";export{default as ContextMenu}from"./components/ContextMenu/index.mjs";export{default as DataList}from"./components/DataList/index.mjs";export{default as Dialog}from"./components/Dialog/index.mjs";export{default as DropdownMenu}from"./components/DropdownMenu/index.mjs";export{Footer}from"./components/Footer/index.mjs";export{default as Gnb}from"./components/Gnb/index.mjs";export{default as HoverCard}from"./components/HoverCard/index.mjs";export{IconButton}from"./components/IconButton/index.mjs";export{Inset}from"./components/Inset/index.mjs";export{Label}from"./components/Label/index.mjs";export{default as Menubar}from"./components/Menubar/index.mjs";export{default as NavigationMenu}from"./components/NavigationMenu/index.mjs";export{default as Popover}from"./components/Popover/index.mjs";export{Progress}from"./components/Progress/index.mjs";export{Radio}from"./components/Radio/index.mjs";export{default as RadioCards}from"./components/RadioCards/index.mjs";export{default as RadioGroup}from"./components/RadioGroup/index.mjs";export{ScrollArea}from"./components/ScrollArea/index.mjs";export{default as SegmentedControl}from"./components/SegmentedControl/index.mjs";export{default as Select}from"./components/Select/index.mjs";export{Separator}from"./components/Separator/index.mjs";export{Skeleton}from"./components/Skeleton/index.mjs";export{Slider}from"./components/Slider/index.mjs";export{Spinner}from"./components/Spinner/index.mjs";export{default as Table}from"./components/Table/index.mjs";export{default as TabNav}from"./components/TabNav/index.mjs";export{default as Tabs}from"./components/Tabs/index.mjs";export{TextArea}from"./components/TextArea/index.mjs";export{default as TextField}from"./components/TextField/index.mjs";export{default as Toast}from"./components/Toast/index.mjs";export{Toggle}from"./components/Toggle/index.mjs";export{ToggleWithText}from"./components/Toggle/ToggleWithText.mjs";export{default as ToggleGroup}from"./components/ToggleGroup/index.mjs";export{ToggleSwitch}from"./components/ToggleSwitch/index.mjs";export{default as Tooltip}from"./components/Tooltip/index.mjs";export{default as BarChart}from"./components/BarChart/index.mjs";export{BubbleChart}from"./components/BubbleChart/index.mjs";export{RadarChart}from"./components/RadarChart/index.mjs";export{default as LineChart}from"./components/LineChart/index.mjs";export{default as PieChart}from"./components/PieChart/index.mjs";export{default as DoughnutChart}from"./components/DoughnutChart/index.mjs";export{default as Grid}from"./components/Grid/index.mjs";export{useGrid}from"./components/Grid/useGrid.mjs";export{Header}from"./Typography/Header/index.mjs";export{Text}from"./Typography/Text/index.mjs";export{default as LuiThemeProvider,useTheme}from"./theme/ThemeProvider.mjs";
2
2
  //# sourceMappingURL=index.mjs.map