@lotte-innovate/ui-component-test 0.2.81 → 0.2.83

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { ComponentPropsWithoutRef } from 'react';
2
+ import React from 'react';
3
3
  import { DayPicker } from 'react-day-picker';
4
4
  import { IColor } from '../../../lib/types';
5
5
  export interface CalendarProps extends VariantProps<typeof calendarVariants> {
@@ -8,8 +8,5 @@ export interface CalendarProps extends VariantProps<typeof calendarVariants> {
8
8
  declare const calendarVariants: (props?: ({
9
9
  radius?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
10
10
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
- export declare const Calendar: {
12
- ({ className, classNames, showOutsideDays, color, radius, ...props }: ComponentPropsWithoutRef<typeof DayPicker> & CalendarProps): import("react/jsx-runtime").JSX.Element;
13
- displayName: string;
14
- };
11
+ export declare const Calendar: React.ForwardRefExoticComponent<(React.ComponentPropsWithoutRef<typeof DayPicker> & CalendarProps) & React.RefAttributes<never>>;
15
12
  export default Calendar;
@@ -24,12 +24,14 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
25
  import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
26
26
  import { cva } from 'class-variance-authority';
27
+ import { forwardRef } from 'react';
27
28
  import { MAIN_COLOR } from '../../../lib/color/constants';
28
29
  import { radiusVariants } from '../../../lib/constants';
29
30
  import { DayPicker } from 'react-day-picker';
30
31
  import { cn } from '../../../lib/utils/utils';
31
32
  import { ko } from 'date-fns/locale';
32
33
  import { useTheme } from '../../../lib/theme';
34
+ import { format } from 'date-fns';
33
35
  var calendarVariants = cva('', {
34
36
  variants: {
35
37
  radius: __assign({}, radiusVariants['base']),
@@ -38,7 +40,7 @@ var calendarVariants = cva('', {
38
40
  radius: 'medium',
39
41
  },
40
42
  });
41
- export var Calendar = function (_a) {
43
+ export var Calendar = forwardRef(function (_a, ref) {
42
44
  var _b, _c;
43
45
  var className = _a.className, classNames = _a.classNames, _d = _a.showOutsideDays, showOutsideDays = _d === void 0 ? true : _d, color = _a.color, radius = _a.radius, props = __rest(_a, ["className", "classNames", "showOutsideDays", "color", "radius"]);
44
46
  var theme = useTheme().theme;
@@ -46,16 +48,20 @@ export var Calendar = function (_a) {
46
48
  radius: (_b = radius !== null && radius !== void 0 ? radius : theme.themeRadius) !== null && _b !== void 0 ? _b : 'medium',
47
49
  color: (_c = color !== null && color !== void 0 ? color : theme.themeColor) !== null && _c !== void 0 ? _c : MAIN_COLOR,
48
50
  };
49
- return (_jsx(DayPicker, __assign({ locale: ko, showOutsideDays: showOutsideDays, className: cn('w-[280px] p-3 text-slate-12 dark:text-slateDark-12', className), classNames: __assign({ months: 'flex flex-row space-y-4 sm:space-x-4 sm:space-y-0 place-content-center', month: 'space-y-4', caption: 'flex justify-center pt-1 relative items-center', caption_label: 'text-sm font-semibold', nav: 'space-x-1 flex items-center', nav_button: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input h-10 px-4 py-2 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100", nav_button_previous: 'absolute left-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3', nav_button_next: 'absolute right-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3', table: 'w-full border-collapse space-y-1', head_row: 'flex', head_cell: 'text-slateA-10 dark:text-slateDarkA-10 rounded-md w-9 font-normal text-[0.8rem]', row: 'flex w-full mt-2', cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20', day: "inline-flex items-center justify-center gap-2 whitespace-nowrap ".concat(calendarVariants(contextValue), " text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-").concat(contextValue.color, "A-3 dark:hover:bg-").concat(contextValue.color, "DarkA-3 h-10 px-4 py-2 h-9 w-9 p-0 font-medium aria-selected:opacity-100 aria-selected:bg-").concat(contextValue.color, "-9 dark:aria-selected:bg-").concat(contextValue.color, "Dark-9 aria-selected:hover:bg-").concat(contextValue.color, "-9 dark:aria-selected:hover:bg-").concat(contextValue.color, "Dark-9"), day_range_end: 'day-range-end', day_selected: "bg-".concat(contextValue.color, "-9 dark:bg-").concat(contextValue.color, "Dark-9 text-white"), day_today: "bg-".concat(contextValue.color, "A-3 dark:bg-").concat(contextValue.color, "DarkA-3"), day_outside: "cursor-default text-slateA-10 dark:text-slateDarkA-10 hover:bg-transparent", day_disabled: 'text-slateA-10 dark:text-slateDarkA-10 opacity-50', day_hidden: 'invisible' }, classNames), components: {
50
- IconLeft: function (_a) {
51
- var props = __rest(_a, []);
52
- return _jsx(ChevronLeftIcon, { className: "h-4 w-4" });
53
- },
54
- IconRight: function (_a) {
55
- var props = __rest(_a, []);
56
- return _jsx(ChevronRightIcon, { className: "h-4 w-4" });
57
- },
58
- } }, props)));
59
- };
51
+ var CustomCaption = function (props) {
52
+ return (_jsx("div", { className: "text-sm font-semibold", children: format(props.displayMonth, 'yyyy년 M월', { locale: ko }) }));
53
+ };
54
+ return (_jsx("div", { ref: ref, children: _jsx(DayPicker, __assign({ locale: ko, showOutsideDays: showOutsideDays, className: cn('w-[280px] p-3 text-slate-12 dark:text-slateDark-12', className), classNames: __assign({ months: 'flex flex-row space-y-4 sm:space-x-4 sm:space-y-0 place-content-center', month: 'space-y-4', caption: 'flex justify-center pt-1 relative items-center', caption_label: 'text-sm font-semibold', nav: 'space-x-1 flex items-center', nav_button: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input h-10 px-4 py-2 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100", nav_button_previous: 'absolute left-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3', nav_button_next: 'absolute right-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3', table: 'w-full border-collapse space-y-1', head_row: 'flex', head_cell: 'text-slateA-10 dark:text-slateDarkA-10 rounded-md w-9 font-normal text-[0.8rem]', row: 'flex w-full mt-2', cell: 'h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20', day: "inline-flex items-center justify-center gap-2 whitespace-nowrap ".concat(calendarVariants(contextValue), " text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-").concat(contextValue.color, "A-3 dark:hover:bg-").concat(contextValue.color, "DarkA-3 h-10 px-4 py-2 h-9 w-9 p-0 font-medium aria-selected:opacity-100 aria-selected:bg-").concat(contextValue.color, "-9 dark:aria-selected:bg-").concat(contextValue.color, "Dark-9 aria-selected:hover:bg-").concat(contextValue.color, "-9 dark:aria-selected:hover:bg-").concat(contextValue.color, "Dark-9"), day_range_end: 'day-range-end', day_selected: "bg-".concat(contextValue.color, "-9 dark:bg-").concat(contextValue.color, "Dark-9 text-white"), day_today: "bg-".concat(contextValue.color, "A-3 dark:bg-").concat(contextValue.color, "DarkA-3"), day_outside: "cursor-default text-slateA-10 dark:text-slateDarkA-10 hover:bg-transparent", day_disabled: 'text-slateA-10 dark:text-slateDarkA-10 opacity-50', day_hidden: 'invisible' }, classNames), components: {
55
+ CaptionLabel: CustomCaption,
56
+ IconLeft: function (_a) {
57
+ var props = __rest(_a, []);
58
+ return _jsx(ChevronLeftIcon, { className: "h-4 w-4" });
59
+ },
60
+ IconRight: function (_a) {
61
+ var props = __rest(_a, []);
62
+ return _jsx(ChevronRightIcon, { className: "h-4 w-4" });
63
+ },
64
+ } }, props)) }));
65
+ });
60
66
  Calendar.displayName = 'Calendar';
61
67
  export default Calendar;
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as e}from"react/jsx-runtime";import{ChevronLeftIcon as t,ChevronRightIcon as r}from"@radix-ui/react-icons";import{cva as a}from"class-variance-authority";import{MAIN_COLOR as o}from"../../color/constants.mjs";import{radiusVariants as s}from"../../constants.mjs";import{DayPicker as n}from"react-day-picker";import{cn as i}from"../../utils/utils.mjs";import{useTheme as l}from"../../theme/ThemeProvider.mjs";import c from"../../node_modules/date-fns/esm/locale/ko/index.mjs";var d=function(){return d=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)},m=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r},u=a("",{variants:{radius:d({},s.base)},defaultVariants:{radius:"medium"}}),p=function(a){var s,p,f=a.className,b=a.classNames,v=a.showOutsideDays,h=void 0===v||v,g=a.color,y=a.radius,x=m(a,["className","classNames","showOutsideDays","color","radius"]),k=l().theme,w={radius:null!==(s=null!=y?y:k.themeRadius)&&void 0!==s?s:"medium",color:null!==(p=null!=g?g:k.themeColor)&&void 0!==p?p:o};return e(n,d({locale:c,showOutsideDays:h,className:i("w-[280px] p-3 text-slate-12 dark:text-slateDark-12",f),classNames:d({months:"flex flex-row space-y-4 sm:space-x-4 sm:space-y-0 place-content-center",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-semibold",nav:"space-x-1 flex items-center",nav_button:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input h-10 px-4 py-2 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",nav_button_previous:"absolute left-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3",nav_button_next:"absolute right-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-slateA-10 dark:text-slateDarkA-10 rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:"inline-flex items-center justify-center gap-2 whitespace-nowrap ".concat(u(w)," text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-").concat(w.color,"A-3 dark:hover:bg-").concat(w.color,"DarkA-3 h-10 px-4 py-2 h-9 w-9 p-0 font-medium aria-selected:opacity-100 aria-selected:bg-").concat(w.color,"-9 dark:aria-selected:bg-").concat(w.color,"Dark-9 aria-selected:hover:bg-").concat(w.color,"-9 dark:aria-selected:hover:bg-").concat(w.color,"Dark-9"),day_range_end:"day-range-end",day_selected:"bg-".concat(w.color,"-9 dark:bg-").concat(w.color,"Dark-9 text-white"),day_today:"bg-".concat(w.color,"A-3 dark:bg-").concat(w.color,"DarkA-3"),day_outside:"cursor-default text-slateA-10 dark:text-slateDarkA-10 hover:bg-transparent",day_disabled:"text-slateA-10 dark:text-slateDarkA-10 opacity-50",day_hidden:"invisible"},b),components:{IconLeft:function(r){return m(r,[]),e(t,{className:"h-4 w-4"})},IconRight:function(t){return m(t,[]),e(r,{className:"h-4 w-4"})}}},x))};p.displayName="Calendar";export{p as Calendar,p as default};
2
+ import{jsx as e}from"react/jsx-runtime";import{ChevronLeftIcon as t,ChevronRightIcon as r}from"@radix-ui/react-icons";import{cva as a}from"class-variance-authority";import{forwardRef as o}from"react";import{MAIN_COLOR as s}from"../../color/constants.mjs";import{radiusVariants as n}from"../../constants.mjs";import{DayPicker as i}from"react-day-picker";import{cn as l}from"../../utils/utils.mjs";import{useTheme as c}from"../../theme/ThemeProvider.mjs";import{format as d}from"date-fns";import m from"../../node_modules/date-fns/esm/locale/ko/index.mjs";var u=function(){return u=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)},f=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]])}return r},p=a("",{variants:{radius:u({},n.base)},defaultVariants:{radius:"medium"}}),b=o((function(a,o){var n,b,v=a.className,h=a.classNames,y=a.showOutsideDays,g=void 0===y||y,x=a.color,k=a.radius,w=f(a,["className","classNames","showOutsideDays","color","radius"]),_=c().theme,j={radius:null!==(n=null!=k?k:_.themeRadius)&&void 0!==n?n:"medium",color:null!==(b=null!=x?x:_.themeColor)&&void 0!==b?b:s};return e("div",{ref:o,children:e(i,u({locale:m,showOutsideDays:g,className:l("w-[280px] p-3 text-slate-12 dark:text-slateDark-12",v),classNames:u({months:"flex flex-row space-y-4 sm:space-x-4 sm:space-y-0 place-content-center",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-semibold",nav:"space-x-1 flex items-center",nav_button:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input h-10 px-4 py-2 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",nav_button_previous:"absolute left-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3",nav_button_next:"absolute right-1 hover:bg-slateA-3 dark:hover:bg-slateDarkA-3",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-slateA-10 dark:text-slateDarkA-10 rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:"inline-flex items-center justify-center gap-2 whitespace-nowrap ".concat(p(j)," text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-").concat(j.color,"A-3 dark:hover:bg-").concat(j.color,"DarkA-3 h-10 px-4 py-2 h-9 w-9 p-0 font-medium aria-selected:opacity-100 aria-selected:bg-").concat(j.color,"-9 dark:aria-selected:bg-").concat(j.color,"Dark-9 aria-selected:hover:bg-").concat(j.color,"-9 dark:aria-selected:hover:bg-").concat(j.color,"Dark-9"),day_range_end:"day-range-end",day_selected:"bg-".concat(j.color,"-9 dark:bg-").concat(j.color,"Dark-9 text-white"),day_today:"bg-".concat(j.color,"A-3 dark:bg-").concat(j.color,"DarkA-3"),day_outside:"cursor-default text-slateA-10 dark:text-slateDarkA-10 hover:bg-transparent",day_disabled:"text-slateA-10 dark:text-slateDarkA-10 opacity-50",day_hidden:"invisible"},h),components:{CaptionLabel:function(t){return e("div",{className:"text-sm font-semibold",children:d(t.displayMonth,"yyyy년 M월",{locale:m})})},IconLeft:function(r){return f(r,[]),e(t,{className:"h-4 w-4"})},IconRight:function(t){return f(t,[]),e(r,{className:"h-4 w-4"})}}},w))})}));b.displayName="Calendar";export{b as Calendar,b as default};
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, Dispatch, SetStateAction } from 'react';
2
- import { DayPicker, DateRange } from 'react-day-picker';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import { DateRange } from 'react-day-picker';
3
3
  import { IColor, IScaling, IRadius } from '../../../lib/types';
4
4
  export interface DatepickerProps {
5
5
  mode?: 'single' | 'range';
@@ -12,8 +12,5 @@ export interface DatepickerProps {
12
12
  selected?: Date | DateRange | undefined;
13
13
  onSelect?: any;
14
14
  }
15
- export declare const Datepicker: {
16
- ({ className, classNames, isOpen, setIsOpen, selected, onSelect, showOutsideDays, placeholder, scaling, radius, color, mode, ...props }: ComponentPropsWithoutRef<typeof DayPicker> & DatepickerProps): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
15
+ export declare const Datepicker: React.ForwardRefExoticComponent<((import("react-day-picker").DayPickerDefaultProps & DatepickerProps) | (import("react-day-picker").DayPickerSingleProps & DatepickerProps) | (import("react-day-picker").DayPickerRangeProps & DatepickerProps)) & React.RefAttributes<never>>;
19
16
  export default Datepicker;
@@ -22,15 +22,16 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  return t;
23
23
  };
24
24
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
+ import { forwardRef, } from 'react';
25
26
  import { CalendarIcon } from '@radix-ui/react-icons';
26
27
  import Calendar from '../../../lib/components/Calendar';
27
28
  import Popover from '../../../lib/components/Popover';
28
29
  import Button from '../../../lib/components/Button';
29
30
  import { cn } from '../../../lib/utils/utils';
30
31
  import { format } from 'date-fns';
31
- export var Datepicker = function (_a) {
32
+ export var Datepicker = forwardRef(function (_a, ref) {
32
33
  var className = _a.className, classNames = _a.classNames, isOpen = _a.isOpen, setIsOpen = _a.setIsOpen, selected = _a.selected, onSelect = _a.onSelect, _b = _a.showOutsideDays, showOutsideDays = _b === void 0 ? true : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '날짜를 선택해주세요' : _c, scaling = _a.scaling, radius = _a.radius, color = _a.color, mode = _a.mode, props = __rest(_a, ["className", "classNames", "isOpen", "setIsOpen", "selected", "onSelect", "showOutsideDays", "placeholder", "scaling", "radius", "color", "mode"]);
33
- return mode === 'range' ? (_jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, scaling: scaling, radius: radius, children: [_jsx(Popover.Trigger, { className: cn('w-[280px] text-slateA-9 dark:text-slateDarkA-9', className), children: _jsxs(Button, { appearance: 'outline', color: color, scaling: scaling, radius: radius, className: cn('justify-start gap-2 text-left font-normal'), children: [_jsx(CalendarIcon, {}), (selected === null || selected === void 0 ? void 0 : selected.from) ? (selected.to ? (_jsxs(_Fragment, { children: [format(selected.from, 'yyyy-MM-dd'), " - ", format(selected.to, 'yyyy-MM-dd')] })) : (format(selected.from, 'yyyy-MM-dd'))) : (placeholder)] }) }), _jsx(Popover.Content, { className: "w-auto max-w-[600px] p-0", align: "start", children: _jsx(Calendar, __assign({ mode: "range", color: color, radius: radius, selected: selected, onSelect: onSelect, numberOfMonths: 2, defaultMonth: selected === null || selected === void 0 ? void 0 : selected.from, showOutsideDays: showOutsideDays, className: 'w-full', classNames: classNames }, props)) })] })) : (_jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, scaling: scaling, radius: radius, children: [_jsx(Popover.Trigger, { className: cn('w-[280px] text-slateA-9 dark:text-slateDarkA-9', className), children: _jsxs(Button, { color: color, radius: radius, scaling: scaling, appearance: 'outline', className: cn('justify-start gap-2 text-left font-normal'), children: [_jsx(CalendarIcon, {}), selected ? format(selected, 'yyyy-MM-dd') : placeholder] }) }), _jsx(Popover.Content, { className: "w-auto p-0", children: _jsx(Calendar, __assign({ mode: mode, color: color, radius: radius, selected: selected, onSelect: onSelect, defaultMonth: selected, showOutsideDays: showOutsideDays, className: 'w-full', classNames: classNames }, props)) })] }));
34
- };
34
+ return mode === 'range' ? (_jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, scaling: scaling, radius: radius, children: [_jsx(Popover.Trigger, { className: cn('w-[280px] text-slateA-9 dark:text-slateDarkA-9', className), children: _jsxs(Button, { appearance: 'outline', color: color, scaling: scaling, radius: radius, className: cn('justify-start gap-2 text-left font-normal'), children: [_jsx(CalendarIcon, {}), _jsx("span", { className: "overflow-hidden text-clip whitespace-nowrap", children: (selected === null || selected === void 0 ? void 0 : selected.from) ? (selected.to ? (_jsxs(_Fragment, { children: [format(selected.from, 'yyyy-MM-dd'), " ~ ", format(selected.to, 'yyyy-MM-dd')] })) : (format(selected.from, 'yyyy-MM-dd'))) : (placeholder) })] }) }), _jsx(Popover.Content, { className: "w-auto max-w-[600px] p-0", align: "start", children: _jsx(Calendar, __assign({ ref: ref, mode: "range", color: color, radius: radius, selected: selected, onSelect: onSelect, numberOfMonths: 2, defaultMonth: selected === null || selected === void 0 ? void 0 : selected.from, showOutsideDays: showOutsideDays, className: 'w-full', classNames: classNames }, props)) })] })) : (_jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, scaling: scaling, radius: radius, children: [_jsx(Popover.Trigger, { className: cn('w-[280px] text-slateA-9 dark:text-slateDarkA-9', className), children: _jsxs(Button, { color: color, radius: radius, scaling: scaling, appearance: 'outline', className: cn('justify-start gap-2 text-left font-normal'), children: [_jsx(CalendarIcon, {}), _jsx("span", { className: "overflow-hidden text-clip whitespace-nowrap", children: selected ? format(selected, 'yyyy-MM-dd') : placeholder })] }) }), _jsx(Popover.Content, { className: "w-auto p-0", children: _jsx(Calendar, __assign({ ref: ref, mode: mode, color: color, radius: radius, selected: selected, onSelect: onSelect, defaultMonth: selected, showOutsideDays: showOutsideDays, className: 'w-full', classNames: classNames }, props)) })] }));
35
+ });
35
36
  Datepicker.displayName = 'Datepicker';
36
37
  export default Datepicker;
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{CalendarIcon as r}from"@radix-ui/react-icons";import{Calendar as o}from"../Calendar/index.mjs";import s from"../Popover/index.mjs";import{Button as l}from"../Button/index.mjs";import{cn as n}from"../../utils/utils.mjs";import{format as i}from"date-fns";var c=function(){return c=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var o in t=arguments[a])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)},d=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]])}return a},m=function(m){var p=m.className,u=m.classNames,f=m.isOpen,y=m.setIsOpen,h=m.selected,O=m.onSelect,g=m.showOutsideDays,x=void 0===g||g,w=m.placeholder,N=void 0===w?"날짜를 선택해주세요":w,j=m.scaling,v=m.radius,M=m.color,b=m.mode,D=d(m,["className","classNames","isOpen","setIsOpen","selected","onSelect","showOutsideDays","placeholder","scaling","radius","color","mode"]);return e(s.Root,"range"===b?{open:f,onOpenChange:y,scaling:j,radius:v,children:[t(s.Trigger,{className:n("w-[280px] text-slateA-9 dark:text-slateDarkA-9",p),children:e(l,{appearance:"outline",color:M,scaling:j,radius:v,className:n("justify-start gap-2 text-left font-normal"),children:[t(r,{}),(null==h?void 0:h.from)?h.to?e(a,{children:[i(h.from,"yyyy-MM-dd")," - ",i(h.to,"yyyy-MM-dd")]}):i(h.from,"yyyy-MM-dd"):N]})}),t(s.Content,{className:"w-auto max-w-[600px] p-0",align:"start",children:t(o,c({mode:"range",color:M,radius:v,selected:h,onSelect:O,numberOfMonths:2,defaultMonth:null==h?void 0:h.from,showOutsideDays:x,className:"w-full",classNames:u},D))})]}:{open:f,onOpenChange:y,scaling:j,radius:v,children:[t(s.Trigger,{className:n("w-[280px] text-slateA-9 dark:text-slateDarkA-9",p),children:e(l,{color:M,radius:v,scaling:j,appearance:"outline",className:n("justify-start gap-2 text-left font-normal"),children:[t(r,{}),h?i(h,"yyyy-MM-dd"):N]})}),t(s.Content,{className:"w-auto p-0",children:t(o,c({mode:b,color:M,radius:v,selected:h,onSelect:O,defaultMonth:h,showOutsideDays:x,className:"w-full",classNames:u},D))})]})};m.displayName="Datepicker";export{m as Datepicker,m as default};
2
+ import{jsxs as e,jsx as a,Fragment as t}from"react/jsx-runtime";import{forwardRef as r}from"react";import{CalendarIcon as o}from"@radix-ui/react-icons";import{Calendar as s}from"../Calendar/index.mjs";import l from"../Popover/index.mjs";import{Button as n}from"../Button/index.mjs";import{cn as i}from"../../utils/utils.mjs";import{format as c}from"date-fns";var d=function(){return d=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var o in a=arguments[t])Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);return e},d.apply(this,arguments)},p=function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)a.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t},m=r((function(r,m){var f=r.className,u=r.classNames,y=r.isOpen,h=r.setIsOpen,O=r.selected,g=r.onSelect,w=r.showOutsideDays,x=void 0===w||w,N=r.placeholder,v=void 0===N?"날짜를 선택해주세요":N,j=r.scaling,M=r.radius,b=r.color,D=r.mode,S=p(r,["className","classNames","isOpen","setIsOpen","selected","onSelect","showOutsideDays","placeholder","scaling","radius","color","mode"]);return e(l.Root,"range"===D?{open:y,onOpenChange:h,scaling:j,radius:M,children:[a(l.Trigger,{className:i("w-[280px] text-slateA-9 dark:text-slateDarkA-9",f),children:e(n,{appearance:"outline",color:b,scaling:j,radius:M,className:i("justify-start gap-2 text-left font-normal"),children:[a(o,{}),a("span",{className:"overflow-hidden text-clip whitespace-nowrap",children:(null==O?void 0:O.from)?O.to?e(t,{children:[c(O.from,"yyyy-MM-dd")," ~ ",c(O.to,"yyyy-MM-dd")]}):c(O.from,"yyyy-MM-dd"):v})]})}),a(l.Content,{className:"w-auto max-w-[600px] p-0",align:"start",children:a(s,d({ref:m,mode:"range",color:b,radius:M,selected:O,onSelect:g,numberOfMonths:2,defaultMonth:null==O?void 0:O.from,showOutsideDays:x,className:"w-full",classNames:u},S))})]}:{open:y,onOpenChange:h,scaling:j,radius:M,children:[a(l.Trigger,{className:i("w-[280px] text-slateA-9 dark:text-slateDarkA-9",f),children:e(n,{color:b,radius:M,scaling:j,appearance:"outline",className:i("justify-start gap-2 text-left font-normal"),children:[a(o,{}),a("span",{className:"overflow-hidden text-clip whitespace-nowrap",children:O?c(O,"yyyy-MM-dd"):v})]})}),a(l.Content,{className:"w-auto p-0",children:a(s,d({ref:m,mode:D,color:b,radius:M,selected:O,onSelect:g,defaultMonth:O,showOutsideDays:x,className:"w-full",classNames:u},S))})]})}));m.displayName="Datepicker";export{m as Datepicker,m as default};
3
3
  //# sourceMappingURL=index.mjs.map
@@ -54,8 +54,8 @@ function NumberingPagination(_a) {
54
54
  table.options.setPagination &&
55
55
  table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));
56
56
  setNowPage('1');
57
- }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }));
58
- pageNumbers.push(_jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }), _jsx(Button, { size: size, appearance: "ghost", onClick: function () {
57
+ }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }, 'ellipsisButton-1'));
58
+ pageNumbers.push(_jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }, 'ellipsisButton-2'), _jsx(Button, { size: size, appearance: "ghost", onClick: function () {
59
59
  table.setPageIndex(table.getPageCount() - 1);
60
60
  table.options.setPagination &&
61
61
  table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));
@@ -64,7 +64,7 @@ function NumberingPagination(_a) {
64
64
  }
65
65
  else if (currentInx - 3 <= 0) {
66
66
  pageNumbers = pageNumbers.slice(0, 7);
67
- pageNumbers.push(_jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }), _jsx(Button, { size: size, appearance: "ghost", onClick: function () {
67
+ pageNumbers.push(_jsx(Button, { appearance: "ghost", disabled: true, size: size, children: "..." }, 'ellipsisButton-3'), _jsx(Button, { size: size, appearance: "ghost", onClick: function () {
68
68
  table.setPageIndex(table.getPageCount() - 1);
69
69
  table.options.setPagination &&
70
70
  table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));
@@ -78,7 +78,7 @@ function NumberingPagination(_a) {
78
78
  table.options.setPagination &&
79
79
  table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));
80
80
  setNowPage('1');
81
- }, color: currentInx === 0 ? color : 'slate', radius: radius, 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: "..." }, 'ellipsisButton-4'));
82
82
  }
83
83
  }
84
84
  return pageNumbers;
@@ -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 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};
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 p from"../Select/index.mjs";import{MAIN_COLOR as r}from"../../color/constants.mjs";import{Button as l}from"../Button/index.mjs";import c 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:r,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(p.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(p.Trigger,{}),n(p.Content,{children:[10,20,30,50,100].map((function(e){return n(p.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(l,{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(l,{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(l,{appearance:"ghost",disabled:!0,size:S,children:"..."},"ellipsisButton-1")),e.push(n(l,{appearance:"ghost",disabled:!0,size:S,children:"..."},"ellipsisButton-2"),n(l,{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(l,{appearance:"ghost",disabled:!0,size:S,children:"..."},"ellipsisButton-3"),n(l,{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(l,{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(l,{appearance:"ghost",disabled:!0,size:S,children:"..."},"ellipsisButton-4"))),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(c.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(l,{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
@@ -1 +1 @@
1
- {"version":3,"file":"NumberingPagination.mjs","sources":["../../../lib/components/Grid/NumberingPagination.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};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useState } from 'react';\nimport IconButton from '../IconButton';\nimport { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons';\nimport Select from '../Select';\nimport { MAIN_COLOR } from '../../../lib/color/constants';\nimport Button from '../Button';\nimport TextField from '../TextField';\nimport Text from '../../Typography/Text';\nfunction NumberingPagination(_a) {\n var _b, _c, _d;\n var table = _a.table;\n var _e = useState('1'), nowPage = _e[0], setNowPage = _e[1];\n var color = (_b = table.options.color) !== null && _b !== void 0 ? _b : MAIN_COLOR;\n var radius = (_c = table.options.radius) !== null && _c !== void 0 ? _c : 'medium';\n var size = table.options.size == 'x-small' ? 'small' : table.options.size;\n var currentPage = table.options.pagination\n ? table.options.pagination.pageIndex\n : table.getState().pagination.pageIndex;\n var renderPageNumbers = function () {\n var pageNumbers = [];\n var currentInx = table.options.pagination\n ? table.options.pagination.pageIndex\n : table.getState().pagination.pageIndex;\n var _loop_1 = function (i) {\n pageNumbers.push(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n if (currentInx !== i) {\n table.setPageIndex(i);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: i }));\n setNowPage(String(i + 1));\n }\n }, color: currentInx === i ? color : 'slate', radius: radius, children: i + 1 }, i));\n };\n for (var i = 0; i < table.getPageCount(); i++) {\n _loop_1(i);\n }\n if (pageNumbers.length > 10) {\n if (currentInx - 3 > 0 && currentInx + 3 < table.getPageCount()) {\n pageNumbers = pageNumbers.slice(currentInx - 2, currentInx + 3);\n pageNumbers.unshift(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(0);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }));\n pageNumbers.push(_jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }), _jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(table.getPageCount() - 1);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n setNowPage(String(table.getPageCount()));\n }, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));\n }\n else if (currentInx - 3 <= 0) {\n pageNumbers = pageNumbers.slice(0, 7);\n pageNumbers.push(_jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }), _jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(table.getPageCount() - 1);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n setNowPage(String(table.getPageCount()));\n }, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));\n }\n else {\n pageNumbers = pageNumbers.slice(table.getPageCount() - 7, table.getPageCount());\n pageNumbers.unshift(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(0);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }));\n }\n }\n return pageNumbers;\n };\n 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) {\n table.options.setPagination &&\n table.options.setPagination({\n pageIndex: 0,\n pageSize: Number(e),\n });\n table.setPageSize(Number(e));\n setNowPage('1');\n table.setPageIndex(0);\n }, 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 () {\n table.firstPage();\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, disabled: currentPage === 0, children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { size: size, appearance: \"ghost\", className: \"border p-1\", color: color, radius: radius, onClick: function () {\n table.previousPage();\n setNowPage(String(table.getState().pagination.pageIndex));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex - 1 }));\n }, 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 () {\n table.nextPage();\n setNowPage(String(table.getState().pagination.pageIndex + 2));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex + 1 }));\n }, disabled: currentPage === table.getPageCount() - 1, children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { size: size, appearance: \"ghost\", className: \"border p-1\", color: color, radius: radius, onClick: function () {\n table.lastPage();\n setNowPage(String(table.getPageCount()));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n }, 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) {\n setNowPage(e.target.value);\n }, 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\" })] }))] }));\n}\nexport default NumberingPagination;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","NumberingPagination","_a","_b","_c","_d","table","_e","useState","nowPage","setNowPage","color","options","MAIN_COLOR","radius","size","currentPage","pagination","pageIndex","getState","_jsxs","children","className","Select","Root","value","String","pageSize","defaultValue","onValueChange","e","setPagination","Number","setPageSize","setPageIndex","_jsx","Trigger","Content","map","Item","IconButton","appearance","onClick","firstPage","disabled","DoubleArrowLeftIcon","previousPage","ChevronLeftIcon","pageNumbers","currentInx","_loop_1","push","Button","getPageCount","slice","unshift","renderPageNumbers","nextPage","ChevronRightIcon","lastPage","DoubleArrowRightIcon","disableInputPagination","TextField","type","min","max","onChange","target","Text"],"mappings":"6eAAA,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,EAUA,SAASQ,EAAoBC,GACzB,IAAIC,EAAIC,EAAIC,EACRC,EAAQJ,EAAGI,MACXC,EAAKC,EAAS,KAAMC,EAAUF,EAAG,GAAIG,EAAaH,EAAG,GACrDI,EAAuC,QAA9BR,EAAKG,EAAMM,QAAQD,aAA0B,IAAPR,EAAgBA,EAAKU,EACpEC,EAAyC,QAA/BV,EAAKE,EAAMM,QAAQE,cAA2B,IAAPV,EAAgBA,EAAK,SACtEW,EAA6B,WAAtBT,EAAMM,QAAQG,KAAoB,QAAUT,EAAMM,QAAQG,KACjEC,EAAcV,EAAMM,QAAQK,WAC1BX,EAAMM,QAAQK,WAAWC,UACzBZ,EAAMa,WAAWF,WAAWC,UAwDlC,OAAQE,EAAM,MAAO,CAAEC,SAAU,CAACD,EAAM,MAAO,CAAEE,UAAW,yCAA0CD,SAAU,CAACD,EAAMG,EAAOC,KAAM,CAAET,KAAMA,EAAMJ,MAAOA,EAAOG,OAAQA,EAAQW,MAAOC,OAAOpB,EAAMa,WAAWF,WAAWU,UAAWC,aAAcF,OAAOpB,EAAMa,WAAWF,WAAWU,UAAWE,cAAe,SAAUC,GAClSxB,EAAMM,QAAQmB,eACVzB,EAAMM,QAAQmB,cAAc,CACxBb,UAAW,EACXS,SAAUK,OAAOF,KAEzBxB,EAAM2B,YAAYD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OpC,EAAM4B,aAAazB,EAAUuB,OAAOvB,GAAW,EAAI,IAAOE,MAAOA,EAAOG,OAAQA,EAAQO,SAAU,YAChR"}
1
+ {"version":3,"file":"NumberingPagination.mjs","sources":["../../../lib/components/Grid/NumberingPagination.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};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useState } from 'react';\nimport IconButton from '../IconButton';\nimport { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from '@radix-ui/react-icons';\nimport Select from '../Select';\nimport { MAIN_COLOR } from '../../../lib/color/constants';\nimport Button from '../Button';\nimport TextField from '../TextField';\nimport Text from '../../Typography/Text';\nfunction NumberingPagination(_a) {\n var _b, _c, _d;\n var table = _a.table;\n var _e = useState('1'), nowPage = _e[0], setNowPage = _e[1];\n var color = (_b = table.options.color) !== null && _b !== void 0 ? _b : MAIN_COLOR;\n var radius = (_c = table.options.radius) !== null && _c !== void 0 ? _c : 'medium';\n var size = table.options.size == 'x-small' ? 'small' : table.options.size;\n var currentPage = table.options.pagination\n ? table.options.pagination.pageIndex\n : table.getState().pagination.pageIndex;\n var renderPageNumbers = function () {\n var pageNumbers = [];\n var currentInx = table.options.pagination\n ? table.options.pagination.pageIndex\n : table.getState().pagination.pageIndex;\n var _loop_1 = function (i) {\n pageNumbers.push(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n if (currentInx !== i) {\n table.setPageIndex(i);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: i }));\n setNowPage(String(i + 1));\n }\n }, color: currentInx === i ? color : 'slate', radius: radius, children: i + 1 }, i));\n };\n for (var i = 0; i < table.getPageCount(); i++) {\n _loop_1(i);\n }\n if (pageNumbers.length > 10) {\n if (currentInx - 3 > 0 && currentInx + 3 < table.getPageCount()) {\n pageNumbers = pageNumbers.slice(currentInx - 2, currentInx + 3);\n pageNumbers.unshift(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(0);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }, 'ellipsisButton-1'));\n pageNumbers.push(_jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }, 'ellipsisButton-2'), _jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(table.getPageCount() - 1);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n setNowPage(String(table.getPageCount()));\n }, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));\n }\n else if (currentInx - 3 <= 0) {\n pageNumbers = pageNumbers.slice(0, 7);\n pageNumbers.push(_jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }, 'ellipsisButton-3'), _jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(table.getPageCount() - 1);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n setNowPage(String(table.getPageCount()));\n }, color: currentInx === table.getPageCount() - 1 ? color : 'slate', radius: radius, children: table.getPageCount() }, table.getPageCount() - 1));\n }\n else {\n pageNumbers = pageNumbers.slice(table.getPageCount() - 7, table.getPageCount());\n pageNumbers.unshift(_jsx(Button, { size: size, appearance: \"ghost\", onClick: function () {\n table.setPageIndex(0);\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, color: currentInx === 0 ? color : 'slate', radius: radius, children: 1 }, 0), _jsx(Button, { appearance: \"ghost\", disabled: true, size: size, children: \"...\" }, 'ellipsisButton-4'));\n }\n }\n return pageNumbers;\n };\n 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) {\n table.options.setPagination &&\n table.options.setPagination({\n pageIndex: 0,\n pageSize: Number(e),\n });\n table.setPageSize(Number(e));\n setNowPage('1');\n table.setPageIndex(0);\n }, 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 () {\n table.firstPage();\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: 0 }));\n setNowPage('1');\n }, disabled: currentPage === 0, children: _jsx(DoubleArrowLeftIcon, {}) }), _jsx(IconButton, { size: size, appearance: \"ghost\", className: \"border p-1\", color: color, radius: radius, onClick: function () {\n table.previousPage();\n setNowPage(String(table.getState().pagination.pageIndex));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex - 1 }));\n }, 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 () {\n table.nextPage();\n setNowPage(String(table.getState().pagination.pageIndex + 2));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.options.pagination.pageIndex + 1 }));\n }, disabled: currentPage === table.getPageCount() - 1, children: _jsx(ChevronRightIcon, {}) }), _jsx(IconButton, { size: size, appearance: \"ghost\", className: \"border p-1\", color: color, radius: radius, onClick: function () {\n table.lastPage();\n setNowPage(String(table.getPageCount()));\n table.options.setPagination &&\n table.options.setPagination(__assign(__assign({}, table.options.pagination), { pageIndex: table.getPageCount() - 1 }));\n }, 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) {\n setNowPage(e.target.value);\n }, 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\" })] }))] }));\n}\nexport default NumberingPagination;\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","NumberingPagination","_a","_b","_c","_d","table","_e","useState","nowPage","setNowPage","color","options","MAIN_COLOR","radius","size","currentPage","pagination","pageIndex","getState","_jsxs","children","className","Select","Root","value","String","pageSize","defaultValue","onValueChange","e","setPagination","Number","setPageSize","setPageIndex","_jsx","Trigger","Content","map","Item","IconButton","appearance","onClick","firstPage","disabled","DoubleArrowLeftIcon","previousPage","ChevronLeftIcon","pageNumbers","currentInx","_loop_1","push","Button","getPageCount","slice","unshift","renderPageNumbers","nextPage","ChevronRightIcon","lastPage","DoubleArrowRightIcon","disableInputPagination","TextField","type","min","max","onChange","target","Text"],"mappings":"6eAAA,IAAIA,EAAsC,WAStC,OARAA,EAAWC,OAAOC,QAAU,SAASC,GACj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.apply(this, arguments);
12
12
  };
13
13
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { useState } from 'react';
14
15
  import { flexRender } from '@tanstack/react-table';
15
16
  // import './index.css';
16
17
  import Table from '../Table';
@@ -31,9 +32,10 @@ export var GridVariants = cva("", {
31
32
  function Grid(_a) {
32
33
  var _b, _c, _d, _e;
33
34
  var table = _a.table;
35
+ var _f = useState(), clicked = _f[0], setClicked = _f[1];
34
36
  return (_jsxs("div", { style: { direction: table.options.columnResizeDirection }, children: [_jsxs(Table.Root, { size: (_b = table.options) === null || _b === void 0 ? void 0 : _b.size, appearance: (_c = table.options) === null || _c === void 0 ? void 0 : _c.appearance, radius: table.options.radius, className: cn("", (_d = table.options) === null || _d === void 0 ? void 0 : _d.tableRootClassName), children: [_jsx(Table.Header, { children: table
35
37
  .getHeaderGroups()
36
- .map(function (headerGroup) {
38
+ .map(function (headerGroup, index) {
37
39
  return (_jsx(Table.Row, { children: headerGroup.headers.map(function (header, index) {
38
40
  var _a;
39
41
  return (_jsxs(Table.ColumnHeaderCell, { colSpan: header.colSpan,
@@ -61,21 +63,20 @@ function Grid(_a) {
61
63
  ? "translateX(".concat((table.options.columnResizeDirection === 'rtl' ? -1 : 1) *
62
64
  ((_a = table.getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0), "px)")
63
65
  : '',
64
- } })] }, header.id));
65
- }) }, headerGroup.id));
66
- }) }), _jsx(Table.Body, { className: "border-b border-b-slateA-5 dark:border-b-slateDarkA-5", children: table
67
- .getRowModel()
68
- .rows.map(function (row) { return (_jsx(Table.Row, { onClick: function () {
69
- row.toggleSelected();
66
+ } })] }, index));
67
+ }) }, index));
68
+ }) }), _jsx(Table.Body, { className: "border-b border-b-slateA-5 dark:border-b-slateDarkA-5", children: table.getRowModel().rows.map(function (row, index) { return (_jsx(Table.Row, { onClick: function () {
69
+ if (!table.options.enableRowSelection)
70
+ setClicked(row.id);
70
71
  table.options.onRowClick && table.options.onRowClick(row);
71
72
  }, onDoubleClick: function () {
72
73
  return table.options.onRowDoubleClick && table.options.onRowDoubleClick(row);
73
- }, className: "hover:bg-slateA-3 dark:hover:bg-slateDarkA-3 ".concat(row.getIsSelected() ? 'bg-gray-200 dark:bg-gray-700' : ''), children: row.getVisibleCells().map(function (cell, index) {
74
+ }, className: "hover:bg-slateA-3 dark:hover:bg-slateDarkA-3 ".concat(row.getIsSelected() || clicked === row.id ? 'bg-gray-200 dark:bg-gray-700' : ''), children: row.getVisibleCells().map(function (cell, index) {
74
75
  var _a, _b;
75
76
  return (_jsx(Table.Cell, __assign({ style: {
76
77
  width: cell.column.getSize(),
77
78
  borderLeftWidth: index === 0 ? 0 : 1,
78
- } }, cell.column.columnDef.meta, { className: cn('border-l-slateA-5 dark:border-l-slateDarkA-5', (_b = (_a = cell.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ''), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
79
- }) }, row.id)); }) })] }), ((_e = table.options) === null || _e === void 0 ? void 0 : _e.enableRowPagination) && (_jsx(_Fragment, { children: _jsx("div", { className: cn('py-[6px]'), children: _jsx(NumberingPagination, { table: table }) }) }))] }));
79
+ } }, cell.column.columnDef.meta, { className: cn('border-l-slateA-5 dark:border-l-slateDarkA-5', (_b = (_a = cell.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ''), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), index));
80
+ }) }, index)); }) })] }), ((_e = table.options) === null || _e === void 0 ? void 0 : _e.enableRowPagination) && (_jsx(_Fragment, { children: _jsx("div", { className: cn('py-[6px]'), children: _jsx(NumberingPagination, { table: table }) }) }))] }));
80
81
  }
81
82
  export default Grid;
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{flexRender as n}from"@tanstack/react-table";import r from"../Table/index.mjs";import{ChevronUpIcon as l,ChevronDownIcon as i}from"@radix-ui/react-icons";import{cn as a}from"../../utils/utils.mjs";import{bgColorStyle as s,radiusVariants as c}from"../../constants.mjs";import{cva as d}from"class-variance-authority";import u from"./NumberingPagination.mjs";var m=function(){return m=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++)for(var r in o=arguments[t])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e},m.apply(this,arguments)},g=d("",{variants:{color:s(),radius:m({},c.large)},defaultVariants:{radius:"medium"}});function p(s){var c,d,p,f,b=s.table;return e("div",{style:{direction:b.options.columnResizeDirection},children:[e(r.Root,{size:null===(c=b.options)||void 0===c?void 0:c.size,appearance:null===(d=b.options)||void 0===d?void 0:d.appearance,radius:b.options.radius,className:a("",null===(p=b.options)||void 0===p?void 0:p.tableRootClassName),children:[o(r.Header,{children:b.getHeaderGroups().map((function(t){return o(r.Row,{children:t.headers.map((function(t,s){var c;return e(r.ColumnHeaderCell,{colSpan:t.colSpan,style:{width:t.getSize(),borderLeftWidth:0===s?0:1},className:"border-l-slateA-5 dark:border-l-slateDarkA-5",children:[t.isPlaceholder?null:e("div",{className:t.column.getCanSort()?"flex cursor-pointer select-none items-center justify-between":"h-full w-full flex-1",onClick:t.column.getToggleSortingHandler(),title:t.column.getCanSort()?"asc"===t.column.getNextSortingOrder()?"Sort ascending":"desc"===t.column.getNextSortingOrder()?"Sort descending":"Clear sort":void 0,children:[n(t.column.columnDef.header,t.getContext()),"asc"==t.column.getIsSorted()?o(l,{}):"desc"==t.column.getIsSorted()?o(i,{}):null]}),o("div",{onDoubleClick:function(){return t.column.resetSize()},onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:a("absolute top-0 h-full w-[3px] bg-slateA-3 cursor-col-resize select-none touch-none right-0 opacity-0 hover:opacity-100",b.options.columnResizeDirection,t.column.getIsResizing()?g({color:b.options.color}):""),style:{transform:t.column.getIsResizing()?"translateX(".concat(("rtl"===b.options.columnResizeDirection?-1:1)*(null!==(c=b.getState().columnSizingInfo.deltaOffset)&&void 0!==c?c:0),"px)"):""}})]},t.id)}))},t.id)}))}),o(r.Body,{className:"border-b border-b-slateA-5 dark:border-b-slateDarkA-5",children:b.getRowModel().rows.map((function(e){return o(r.Row,{onClick:function(){e.toggleSelected(),b.options.onRowClick&&b.options.onRowClick(e)},onDoubleClick:function(){return b.options.onRowDoubleClick&&b.options.onRowDoubleClick(e)},className:"hover:bg-slateA-3 dark:hover:bg-slateDarkA-3 ".concat(e.getIsSelected()?"bg-gray-200 dark:bg-gray-700":""),children:e.getVisibleCells().map((function(e,t){var l,i;return o(r.Cell,m({style:{width:e.column.getSize(),borderLeftWidth:0===t?0:1}},e.column.columnDef.meta,{className:a("border-l-slateA-5 dark:border-l-slateDarkA-5",null!==(i=null===(l=e.column.columnDef.meta)||void 0===l?void 0:l.className)&&void 0!==i?i:""),children:n(e.column.columnDef.cell,e.getContext())}),e.id)}))},e.id)}))})]}),(null===(f=b.options)||void 0===f?void 0:f.enableRowPagination)&&o(t,{children:o("div",{className:a("py-[6px]"),children:o(u,{table:b})})})]})}export{g as GridVariants,p as default};
2
+ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{useState as n}from"react";import{flexRender as r}from"@tanstack/react-table";import l from"../Table/index.mjs";import{ChevronUpIcon as i,ChevronDownIcon as a}from"@radix-ui/react-icons";import{cn as s}from"../../utils/utils.mjs";import{bgColorStyle as c,radiusVariants as d}from"../../constants.mjs";import{cva as u}from"class-variance-authority";import m from"./NumberingPagination.mjs";var p=function(){return p=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++)for(var r in o=arguments[t])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e},p.apply(this,arguments)},g=u("",{variants:{color:c(),radius:p({},d.large)},defaultVariants:{radius:"medium"}});function f(c){var d,u,f,b,h=c.table,v=n(),S=v[0],k=v[1];return e("div",{style:{direction:h.options.columnResizeDirection},children:[e(l.Root,{size:null===(d=h.options)||void 0===d?void 0:d.size,appearance:null===(u=h.options)||void 0===u?void 0:u.appearance,radius:h.options.radius,className:s("",null===(f=h.options)||void 0===f?void 0:f.tableRootClassName),children:[o(l.Header,{children:h.getHeaderGroups().map((function(t,n){return o(l.Row,{children:t.headers.map((function(t,n){var c;return e(l.ColumnHeaderCell,{colSpan:t.colSpan,style:{width:t.getSize(),borderLeftWidth:0===n?0:1},className:"border-l-slateA-5 dark:border-l-slateDarkA-5",children:[t.isPlaceholder?null:e("div",{className:t.column.getCanSort()?"flex cursor-pointer select-none items-center justify-between":"h-full w-full flex-1",onClick:t.column.getToggleSortingHandler(),title:t.column.getCanSort()?"asc"===t.column.getNextSortingOrder()?"Sort ascending":"desc"===t.column.getNextSortingOrder()?"Sort descending":"Clear sort":void 0,children:[r(t.column.columnDef.header,t.getContext()),"asc"==t.column.getIsSorted()?o(i,{}):"desc"==t.column.getIsSorted()?o(a,{}):null]}),o("div",{onDoubleClick:function(){return t.column.resetSize()},onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:s("absolute top-0 h-full w-[3px] bg-slateA-3 cursor-col-resize select-none touch-none right-0 opacity-0 hover:opacity-100",h.options.columnResizeDirection,t.column.getIsResizing()?g({color:h.options.color}):""),style:{transform:t.column.getIsResizing()?"translateX(".concat(("rtl"===h.options.columnResizeDirection?-1:1)*(null!==(c=h.getState().columnSizingInfo.deltaOffset)&&void 0!==c?c:0),"px)"):""}})]},n)}))},n)}))}),o(l.Body,{className:"border-b border-b-slateA-5 dark:border-b-slateDarkA-5",children:h.getRowModel().rows.map((function(e,t){return o(l.Row,{onClick:function(){h.options.enableRowSelection||k(e.id),h.options.onRowClick&&h.options.onRowClick(e)},onDoubleClick:function(){return h.options.onRowDoubleClick&&h.options.onRowDoubleClick(e)},className:"hover:bg-slateA-3 dark:hover:bg-slateDarkA-3 ".concat(e.getIsSelected()||S===e.id?"bg-gray-200 dark:bg-gray-700":""),children:e.getVisibleCells().map((function(e,t){var n,i;return o(l.Cell,p({style:{width:e.column.getSize(),borderLeftWidth:0===t?0:1}},e.column.columnDef.meta,{className:s("border-l-slateA-5 dark:border-l-slateDarkA-5",null!==(i=null===(n=e.column.columnDef.meta)||void 0===n?void 0:n.className)&&void 0!==i?i:""),children:r(e.column.columnDef.cell,e.getContext())}),t)}))},t)}))})]}),(null===(b=h.options)||void 0===b?void 0:b.enableRowPagination)&&o(t,{children:o("div",{className:s("py-[6px]"),children:o(m,{table:h})})})]})}export{g as GridVariants,f as default};
3
3
  //# sourceMappingURL=index.mjs.map
@@ -97,7 +97,7 @@ export var useGrid = function (_a) {
97
97
  sorting: sorting,
98
98
  rowSelection: (_c = props.rowSelection) !== null && _c !== void 0 ? _c : defaultRowSelection,
99
99
  expanded: (_d = props.expanded) !== null && _d !== void 0 ? _d : defaultExpanded,
100
- } }, props), { data: props.data, columns: columnsData, color: (_e = props.color) !== null && _e !== void 0 ? _e : theme.themeColor, paginateExpandedRows: true, enableExpanding: !!props.enableExpanding, enableMultiRowSelection: !!props.enableRowSelection, getSubRows: function (row) { return row.subRows; }, onExpandedChange: function (e) {
100
+ } }, props), { data: props.data, columns: columnsData, color: (_e = props.color) !== null && _e !== void 0 ? _e : theme.themeColor, paginateExpandedRows: true, enableExpanding: !!props.enableExpanding, enableMultiRowSelection: !!props.enableRowSelection, enableRowSelection: !!props.enableRowSelection, getSubRows: function (row) { return row.subRows; }, onExpandedChange: function (e) {
101
101
  setDefaultExpanded(e);
102
102
  props.onExpandedChange && props.onExpandedChange(e);
103
103
  }, onSortingChange: setSorting, onRowSelectionChange: function (e) {
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createColumnHelper as o,getSortedRowModel as t,getCoreRowModel as l,getExpandedRowModel as r,getPaginationRowModel as i,useReactTable as a}from"@tanstack/react-table";import d,{useRef as c}from"react";import{IconButton as s}from"../IconButton/index.mjs";import{ChevronDownIcon as u,ChevronRightIcon as m}from"@radix-ui/react-icons";import{Checkbox as g}from"../Checkbox/index.mjs";import{useTheme as f}from"../../theme/ThemeProvider.mjs";var h=function(){return h=Object.assign||function(e){for(var n,o=1,t=arguments.length;o<t;o++)for(var l in n=arguments[o])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},h.apply(this,arguments)},p=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(o[t[l]]=e[t[l]])}return o};function v(e){var o=e.indeterminate,t=e.checked,l=e.disabled,r=e.onChange,i=e.size,a=e.color,s=e.radius,u=c();return d.useEffect((function(){"boolean"==typeof o&&(u.current.indeterminate=t&&o)}),[u,o]),n(g,{ref:u,id:"checkbox",checked:t,disabled:l,size:i,onCheckedChange:function(e){return r&&r({target:{value:e}})},indeterminate:o,className:"mr-0",color:a,radius:s})}var x=function(c){var g,x,w,S,b=p(c,[]),R=f().theme,C=d.useState([]),y=C[0],j=C[1],E=d.useState({}),O=E[0],I=E[1],z=d.useState({}),k=z[0],N=z[1],P=o(),M=null===(g=null==b?void 0:b.columns)||void 0===g?void 0:g.map((function(e){return P.accessor(e.id,h({},e))}));if(b.enableExpanding){var A=M[0].cell;M[0]=h(h({},M[0]),{cell:function(o){var t;return e("div",{className:"flex cursor-pointer items-center",style:{paddingLeft:"".concat(20*o.row.depth,"px")},onClick:o.row.getToggleExpandedHandler(),children:[o.row.getCanExpand()?n(s,{appearance:"ghost",size:"small",className:"mr-1 h-3 w-3",color:null!==(t=o.color)&&void 0!==t?t:R.themeColor,children:o.row.getIsExpanded()?n(u,{}):n(m,{})}):n("div",{className:"mr-2"}),n("div",{children:A?A(o):o.getValue()})]})}})}b.enableIndexing&&!b.enableExpanding&&(null==M||M.unshift({id:"index",size:50,header:function(){return n("div",{className:"flex justify-center",children:"NO"})},cell:function(e){var o=e.row;return n("div",{className:"flex justify-center",children:o.index+1})}})),b.enableRowSelection&&(null==M||M.unshift({id:"select",size:20,header:function(e){var o,t,l=e.table;return n("div",{className:"flex h-full w-full items-center justify-center px-1",children:n(v,{checked:l.getIsAllRowsSelected()||l.getIsSomeRowsSelected(),indeterminate:l.getIsSomeRowsSelected(),onChange:l.getToggleAllRowsSelectedHandler(),size:"x-small"==(null==b?void 0:b.size)?"small":null==b?void 0:b.size,color:null!==(o=b.color)&&void 0!==o?o:R.themeColor,radius:null!==(t=b.radius)&&void 0!==t?t:R.themeRadius})})},cell:function(e){var o,t,l=e.row;return n("div",{className:"flex h-full w-full items-center justify-center px-1",children:n(v,{checked:l.getIsSelected()||l.getIsSomeSelected()||l.getIsAllSubRowsSelected(),indeterminate:l.getIsSomeSelected()&&!l.getIsAllSubRowsSelected(),onChange:l.getToggleSelectedHandler(),size:"x-small"==(null==b?void 0:b.size)?"small":null==b?void 0:b.size,color:null!==(o=b.color)&&void 0!==o?o:R.themeColor,radius:null!==(t=b.radius)&&void 0!==t?t:R.themeRadius})})}}));var T=h(h({state:{sorting:y,rowSelection:null!==(x=b.rowSelection)&&void 0!==x?x:k,expanded:null!==(w=b.expanded)&&void 0!==w?w:O}},b),{data:b.data,columns:M,color:null!==(S=b.color)&&void 0!==S?S:R.themeColor,paginateExpandedRows:!0,enableExpanding:!!b.enableExpanding,enableMultiRowSelection:!!b.enableRowSelection,getSubRows:function(e){return e.subRows},onExpandedChange:function(e){I(e),b.onExpandedChange&&b.onExpandedChange(e)},onSortingChange:j,onRowSelectionChange:function(e){N(e),b.onChangeRowSelection&&b.onChangeRowSelection(e)},getSortedRowModel:t(),getCoreRowModel:l(),getExpandedRowModel:r(),manualPagination:!1});return b.enableRowPagination&&(T.getPaginationRowModel=i()),a(T)};export{x as useGrid};
2
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createColumnHelper as o,getSortedRowModel as t,getCoreRowModel as l,getExpandedRowModel as r,getPaginationRowModel as i,useReactTable as a}from"@tanstack/react-table";import c,{useRef as d}from"react";import{IconButton as s}from"../IconButton/index.mjs";import{ChevronDownIcon as u,ChevronRightIcon as m}from"@radix-ui/react-icons";import{Checkbox as g}from"../Checkbox/index.mjs";import{useTheme as f}from"../../theme/ThemeProvider.mjs";var h=function(){return h=Object.assign||function(e){for(var n,o=1,t=arguments.length;o<t;o++)for(var l in n=arguments[o])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},h.apply(this,arguments)},p=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(o[t[l]]=e[t[l]])}return o};function v(e){var o=e.indeterminate,t=e.checked,l=e.disabled,r=e.onChange,i=e.size,a=e.color,s=e.radius,u=d();return c.useEffect((function(){"boolean"==typeof o&&(u.current.indeterminate=t&&o)}),[u,o]),n(g,{ref:u,id:"checkbox",checked:t,disabled:l,size:i,onCheckedChange:function(e){return r&&r({target:{value:e}})},indeterminate:o,className:"mr-0",color:a,radius:s})}var w=function(d){var g,w,x,S,b=p(d,[]),R=f().theme,C=c.useState([]),y=C[0],j=C[1],E=c.useState({}),O=E[0],I=E[1],z=c.useState({}),k=z[0],N=z[1],P=o(),M=null===(g=null==b?void 0:b.columns)||void 0===g?void 0:g.map((function(e){return P.accessor(e.id,h({},e))}));if(b.enableExpanding){var A=M[0].cell;M[0]=h(h({},M[0]),{cell:function(o){var t;return e("div",{className:"flex cursor-pointer items-center",style:{paddingLeft:"".concat(20*o.row.depth,"px")},onClick:o.row.getToggleExpandedHandler(),children:[o.row.getCanExpand()?n(s,{appearance:"ghost",size:"small",className:"mr-1 h-3 w-3",color:null!==(t=o.color)&&void 0!==t?t:R.themeColor,children:o.row.getIsExpanded()?n(u,{}):n(m,{})}):n("div",{className:"mr-2"}),n("div",{children:A?A(o):o.getValue()})]})}})}b.enableIndexing&&!b.enableExpanding&&(null==M||M.unshift({id:"index",size:50,header:function(){return n("div",{className:"flex justify-center",children:"NO"})},cell:function(e){var o=e.row;return n("div",{className:"flex justify-center",children:o.index+1})}})),b.enableRowSelection&&(null==M||M.unshift({id:"select",size:20,header:function(e){var o,t,l=e.table;return n("div",{className:"flex h-full w-full items-center justify-center px-1",children:n(v,{checked:l.getIsAllRowsSelected()||l.getIsSomeRowsSelected(),indeterminate:l.getIsSomeRowsSelected(),onChange:l.getToggleAllRowsSelectedHandler(),size:"x-small"==(null==b?void 0:b.size)?"small":null==b?void 0:b.size,color:null!==(o=b.color)&&void 0!==o?o:R.themeColor,radius:null!==(t=b.radius)&&void 0!==t?t:R.themeRadius})})},cell:function(e){var o,t,l=e.row;return n("div",{className:"flex h-full w-full items-center justify-center px-1",children:n(v,{checked:l.getIsSelected()||l.getIsSomeSelected()||l.getIsAllSubRowsSelected(),indeterminate:l.getIsSomeSelected()&&!l.getIsAllSubRowsSelected(),onChange:l.getToggleSelectedHandler(),size:"x-small"==(null==b?void 0:b.size)?"small":null==b?void 0:b.size,color:null!==(o=b.color)&&void 0!==o?o:R.themeColor,radius:null!==(t=b.radius)&&void 0!==t?t:R.themeRadius})})}}));var T=h(h({state:{sorting:y,rowSelection:null!==(w=b.rowSelection)&&void 0!==w?w:k,expanded:null!==(x=b.expanded)&&void 0!==x?x:O}},b),{data:b.data,columns:M,color:null!==(S=b.color)&&void 0!==S?S:R.themeColor,paginateExpandedRows:!0,enableExpanding:!!b.enableExpanding,enableMultiRowSelection:!!b.enableRowSelection,enableRowSelection:!!b.enableRowSelection,getSubRows:function(e){return e.subRows},onExpandedChange:function(e){I(e),b.onExpandedChange&&b.onExpandedChange(e)},onSortingChange:j,onRowSelectionChange:function(e){N(e),b.onChangeRowSelection&&b.onChangeRowSelection(e)},getSortedRowModel:t(),getCoreRowModel:l(),getExpandedRowModel:r(),manualPagination:!1});return b.enableRowPagination&&(T.getPaginationRowModel=i()),a(T)};export{w as useGrid};
3
3
  //# sourceMappingURL=useGrid.mjs.map
@@ -26,10 +26,9 @@ import { forwardRef, useContext } from 'react';
26
26
  import { scalingVariants } from '../../../lib/constants';
27
27
  import { Popover as PopoverTheme } from '@radix-ui/themes';
28
28
  import { cva } from 'class-variance-authority';
29
- import { Portal } from '@radix-ui/react-portal';
30
29
  import { PopoverContext } from './PopoverRoot';
31
30
  import { cn } from '../../../lib/utils/utils';
32
- export var popoverContentVariants = cva('flex gap-2 bg-white dark:bg-slateDark-1 border-slateA-6 dark:border-slateDarkA-6', {
31
+ export var popoverContentVariants = cva('flex gap-2 bg-white dark:bg-slateDark-1 border-slateA-6 dark:border-slateDarkA-6 z-10', {
33
32
  variants: {
34
33
  radius: {
35
34
  none: 'rounded-none',
@@ -62,6 +61,6 @@ export var PopoverContent = forwardRef(function (_a, ref) {
62
61
  sizeTheme = '3';
63
62
  if (size === 'x-large')
64
63
  sizeTheme = '4';
65
- return (_jsx(Portal, { children: _jsx(PopoverTheme.Content, __assign({ ref: ref, size: sizeTheme, className: cn(popoverContentVariants({ size: size, radius: radius, scaling: scaling }), className) }, props, { children: children })) }));
64
+ return (_jsx(PopoverTheme.Content, __assign({ ref: ref, size: sizeTheme, className: cn(popoverContentVariants({ size: size, radius: radius, scaling: scaling }), className) }, props, { children: children })));
66
65
  });
67
66
  PopoverContent.displayName = 'Popover.Content';
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,useContext as t}from"react";import{scalingVariants as a}from"../../constants.mjs";import{Popover as o}from"@radix-ui/themes";import{cva as i}from"class-variance-authority";import{Portal as n}from"@radix-ui/react-portal";import{PopoverContext as s}from"./PopoverRoot.mjs";import{cn as l}from"../../utils/utils.mjs";var m=function(){return m=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},m.apply(this,arguments)},d=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=i("flex gap-2 bg-white dark:bg-slateDark-1 border-slateA-6 dark:border-slateDarkA-6",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"text-xs w-[250px]",medium:"text-sm w-[300px]",large:"text-base w-[350px]","x-large":"text-lg w-[400px]"},scaling:m({},a)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),u=e((function(e,a){var i=e.className,u=e.children,c=d(e,["className","children"]),f=t(s),x=f.radius,g=f.size,b=f.scaling,y="2";return"small"===g&&(y="1"),"large"===g&&(y="3"),"x-large"===g&&(y="4"),r(n,{children:r(o.Content,m({ref:a,size:y,className:l(p({size:g,radius:x,scaling:b}),i)},c,{children:u}))})}));u.displayName="Popover.Content";export{u as PopoverContent,p as popoverContentVariants};
2
+ import{jsx as r}from"react/jsx-runtime";import{forwardRef as e,useContext as t}from"react";import{scalingVariants as a}from"../../constants.mjs";import{Popover as o}from"@radix-ui/themes";import{cva as n}from"class-variance-authority";import{PopoverContext as i}from"./PopoverRoot.mjs";import{cn as s}from"../../utils/utils.mjs";var l=function(){return l=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},l.apply(this,arguments)},m=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},d=n("flex gap-2 bg-white dark:bg-slateDark-1 border-slateA-6 dark:border-slateDarkA-6 z-10",{variants:{radius:{none:"rounded-none",small:"rounded-[3px]",medium:"rounded",large:"rounded-md",full:"rounded-md"},size:{small:"text-xs w-[250px]",medium:"text-sm w-[300px]",large:"text-base w-[350px]","x-large":"text-lg w-[400px]"},scaling:l({},a)},defaultVariants:{radius:"medium",size:"medium",scaling:"100%"}}),p=e((function(e,a){var n=e.className,p=e.children,u=m(e,["className","children"]),c=t(i),f=c.radius,g=c.size,x=c.scaling,b="2";return"small"===g&&(b="1"),"large"===g&&(b="3"),"x-large"===g&&(b="4"),r(o.Content,l({ref:a,size:b,className:s(d({size:g,radius:f,scaling:x}),n)},u,{children:p}))}));p.displayName="Popover.Content";export{p as PopoverContent,d as popoverContentVariants};
3
3
  //# sourceMappingURL=PopoverContent.mjs.map