@mondrianai/runyourai-design-system 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +29 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -772,9 +772,11 @@ interface TabsProps<T extends string = string> {
|
|
|
772
772
|
variant?: 'pill' | 'underline';
|
|
773
773
|
/** 컨테이너를 w-full로 펼치고 각 탭 버튼을 균등 분할(flex-1)합니다 */
|
|
774
774
|
block?: boolean;
|
|
775
|
+
/** Tailwind height 클래스 (e.g. "h-[36px]"). 지정 시 내부 버튼 패딩도 자동 조정됩니다. */
|
|
776
|
+
height?: string;
|
|
775
777
|
className?: string;
|
|
776
778
|
}
|
|
777
|
-
declare function Tabs<T extends string = string>({ allTabs, current, onTabChange, variant, block, className, }: TabsProps<T>): react_jsx_runtime.JSX.Element;
|
|
779
|
+
declare function Tabs<T extends string = string>({ allTabs, current, onTabChange, variant, block, height, className, }: TabsProps<T>): react_jsx_runtime.JSX.Element;
|
|
778
780
|
|
|
779
781
|
interface ToggleProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
780
782
|
pressed?: boolean;
|
|
@@ -823,8 +825,8 @@ interface CircleIndicatorProps {
|
|
|
823
825
|
used: number;
|
|
824
826
|
/** 전체 용량 */
|
|
825
827
|
total: number;
|
|
826
|
-
/** 중앙에 표시할
|
|
827
|
-
|
|
828
|
+
/** 중앙에 표시할 콘텐츠 */
|
|
829
|
+
centerContent?: React$1.ReactNode;
|
|
828
830
|
/** hover 시 표시할 툴팁 텍스트 */
|
|
829
831
|
tooltip?: string;
|
|
830
832
|
/**
|
|
@@ -835,9 +837,13 @@ interface CircleIndicatorProps {
|
|
|
835
837
|
color?: string;
|
|
836
838
|
/** 컴포넌트 크기 (px, 기본값 44) */
|
|
837
839
|
size?: number;
|
|
840
|
+
/** stroke 두께 (px, 기본값 3) */
|
|
841
|
+
strokeWidth?: number;
|
|
842
|
+
/** stroke 끝 모양 (기본값 'round') */
|
|
843
|
+
strokeLinecap?: 'round' | 'square';
|
|
838
844
|
className?: string;
|
|
839
845
|
}
|
|
840
|
-
declare function CircleIndicator({ used, total,
|
|
846
|
+
declare function CircleIndicator({ used, total, centerContent, tooltip, color, size, strokeWidth, strokeLinecap, className, }: CircleIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
841
847
|
|
|
842
848
|
declare const Switch: React__default.ForwardRefExoticComponent<Omit<Switch$1.SwitchProps & React__default.RefAttributes<HTMLButtonElement>, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
843
849
|
interface SwitchFieldProps extends React__default.ComponentPropsWithoutRef<typeof Switch$1.Root> {
|
package/dist/index.d.ts
CHANGED
|
@@ -772,9 +772,11 @@ interface TabsProps<T extends string = string> {
|
|
|
772
772
|
variant?: 'pill' | 'underline';
|
|
773
773
|
/** 컨테이너를 w-full로 펼치고 각 탭 버튼을 균등 분할(flex-1)합니다 */
|
|
774
774
|
block?: boolean;
|
|
775
|
+
/** Tailwind height 클래스 (e.g. "h-[36px]"). 지정 시 내부 버튼 패딩도 자동 조정됩니다. */
|
|
776
|
+
height?: string;
|
|
775
777
|
className?: string;
|
|
776
778
|
}
|
|
777
|
-
declare function Tabs<T extends string = string>({ allTabs, current, onTabChange, variant, block, className, }: TabsProps<T>): react_jsx_runtime.JSX.Element;
|
|
779
|
+
declare function Tabs<T extends string = string>({ allTabs, current, onTabChange, variant, block, height, className, }: TabsProps<T>): react_jsx_runtime.JSX.Element;
|
|
778
780
|
|
|
779
781
|
interface ToggleProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
|
|
780
782
|
pressed?: boolean;
|
|
@@ -823,8 +825,8 @@ interface CircleIndicatorProps {
|
|
|
823
825
|
used: number;
|
|
824
826
|
/** 전체 용량 */
|
|
825
827
|
total: number;
|
|
826
|
-
/** 중앙에 표시할
|
|
827
|
-
|
|
828
|
+
/** 중앙에 표시할 콘텐츠 */
|
|
829
|
+
centerContent?: React$1.ReactNode;
|
|
828
830
|
/** hover 시 표시할 툴팁 텍스트 */
|
|
829
831
|
tooltip?: string;
|
|
830
832
|
/**
|
|
@@ -835,9 +837,13 @@ interface CircleIndicatorProps {
|
|
|
835
837
|
color?: string;
|
|
836
838
|
/** 컴포넌트 크기 (px, 기본값 44) */
|
|
837
839
|
size?: number;
|
|
840
|
+
/** stroke 두께 (px, 기본값 3) */
|
|
841
|
+
strokeWidth?: number;
|
|
842
|
+
/** stroke 끝 모양 (기본값 'round') */
|
|
843
|
+
strokeLinecap?: 'round' | 'square';
|
|
838
844
|
className?: string;
|
|
839
845
|
}
|
|
840
|
-
declare function CircleIndicator({ used, total,
|
|
846
|
+
declare function CircleIndicator({ used, total, centerContent, tooltip, color, size, strokeWidth, strokeLinecap, className, }: CircleIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
841
847
|
|
|
842
848
|
declare const Switch: React__default.ForwardRefExoticComponent<Omit<Switch$1.SwitchProps & React__default.RefAttributes<HTMLButtonElement>, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
843
849
|
interface SwitchFieldProps extends React__default.ComponentPropsWithoutRef<typeof Switch$1.Root> {
|
package/dist/index.js
CHANGED
|
@@ -2140,8 +2140,8 @@ function CalendarGrid({
|
|
|
2140
2140
|
const prevYear = month === 0 ? year - 1 : year;
|
|
2141
2141
|
const prevMon = month === 0 ? 11 : month - 1;
|
|
2142
2142
|
const isPrevDisabled = disablePast && (prevYear < today.getFullYear() || prevYear === today.getFullYear() && prevMon < today.getMonth());
|
|
2143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "
|
|
2144
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between
|
|
2143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "px-5 pt-3 pb-4", children: [
|
|
2144
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
2145
2145
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2146
2146
|
"button",
|
|
2147
2147
|
{
|
|
@@ -2149,20 +2149,20 @@ function CalendarGrid({
|
|
|
2149
2149
|
onClick: prevMonth,
|
|
2150
2150
|
disabled: isPrevDisabled,
|
|
2151
2151
|
className: cn(
|
|
2152
|
-
"size-8
|
|
2153
|
-
isPrevDisabled ? "text-muted-foreground opacity-30 cursor-not-allowed" : "text-foreground hover:bg-accent cursor-pointer"
|
|
2152
|
+
"flex size-8 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2153
|
+
isPrevDisabled ? "text-muted-foreground opacity-30 cursor-not-allowed" : "text-foreground hover:bg-accent active:bg-accent cursor-pointer"
|
|
2154
2154
|
),
|
|
2155
2155
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "chevron-left", className: "size-4" })
|
|
2156
2156
|
}
|
|
2157
2157
|
),
|
|
2158
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
2159
2159
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative", children: [
|
|
2160
2160
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2161
2161
|
"select",
|
|
2162
2162
|
{
|
|
2163
2163
|
value: year,
|
|
2164
2164
|
onChange: (e) => onYearChange(Number(e.target.value)),
|
|
2165
|
-
className: "appearance-none border border-border
|
|
2165
|
+
className: "h-8 appearance-none rounded-lg border border-border bg-background pl-3 pr-6 text-sm font-medium text-foreground transition-colors hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer",
|
|
2166
2166
|
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: y, children: config.formatYear(y) }, y))
|
|
2167
2167
|
}
|
|
2168
2168
|
),
|
|
@@ -2170,7 +2170,7 @@ function CalendarGrid({
|
|
|
2170
2170
|
Icon,
|
|
2171
2171
|
{
|
|
2172
2172
|
name: "chevron-down",
|
|
2173
|
-
className: "absolute right-1.5 top-1/2 -translate-y-1/2
|
|
2173
|
+
className: "pointer-events-none absolute right-1.5 top-1/2 size-3 -translate-y-1/2 text-foreground"
|
|
2174
2174
|
}
|
|
2175
2175
|
)
|
|
2176
2176
|
] }),
|
|
@@ -2180,7 +2180,7 @@ function CalendarGrid({
|
|
|
2180
2180
|
{
|
|
2181
2181
|
value: month,
|
|
2182
2182
|
onChange: (e) => onMonthChange(Number(e.target.value)),
|
|
2183
|
-
className: "appearance-none border border-border
|
|
2183
|
+
className: "h-8 appearance-none rounded-lg border border-border bg-background pl-3 pr-6 text-sm font-medium text-foreground transition-colors hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer",
|
|
2184
2184
|
children: Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: i, children: config.formatMonth(i) }, i))
|
|
2185
2185
|
}
|
|
2186
2186
|
),
|
|
@@ -2188,7 +2188,7 @@ function CalendarGrid({
|
|
|
2188
2188
|
Icon,
|
|
2189
2189
|
{
|
|
2190
2190
|
name: "chevron-down",
|
|
2191
|
-
className: "absolute right-1.5 top-1/2 -translate-y-1/2
|
|
2191
|
+
className: "pointer-events-none absolute right-1.5 top-1/2 size-3 -translate-y-1/2 text-foreground"
|
|
2192
2192
|
}
|
|
2193
2193
|
)
|
|
2194
2194
|
] })
|
|
@@ -2198,39 +2198,40 @@ function CalendarGrid({
|
|
|
2198
2198
|
{
|
|
2199
2199
|
type: "button",
|
|
2200
2200
|
onClick: nextMonth,
|
|
2201
|
-
className: "size-8
|
|
2201
|
+
className: "flex size-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent active:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer",
|
|
2202
2202
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "chevron-right", className: "size-4" })
|
|
2203
2203
|
}
|
|
2204
2204
|
)
|
|
2205
2205
|
] }),
|
|
2206
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grid grid-cols-7
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mb-1 grid grid-cols-7 gap-1", children: config.dayHeaders.map((d) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2207
2207
|
"div",
|
|
2208
2208
|
{
|
|
2209
|
-
className: "flex items-center justify-center
|
|
2209
|
+
className: "flex h-10 items-center justify-center text-sm font-normal leading-xs text-muted-foreground",
|
|
2210
2210
|
children: d
|
|
2211
2211
|
},
|
|
2212
2212
|
d
|
|
2213
2213
|
)) }),
|
|
2214
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grid grid-cols-7", children: cells.map(({ day, currentMonth, date }
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grid grid-cols-7 gap-1", children: cells.map(({ day, currentMonth, date }) => {
|
|
2215
2215
|
const dateStart = startOfDay(date);
|
|
2216
2216
|
const isSelected = (selectedStart == null ? void 0 : selectedStart.getTime()) === dateStart.getTime();
|
|
2217
2217
|
const isToday = todayStart.getTime() === dateStart.getTime();
|
|
2218
2218
|
const isPast = dateStart < todayStart;
|
|
2219
2219
|
const isDisabled = disablePast && isPast;
|
|
2220
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2221
2221
|
"button",
|
|
2222
2222
|
{
|
|
2223
2223
|
type: "button",
|
|
2224
2224
|
disabled: isDisabled,
|
|
2225
2225
|
onClick: () => onSelect(date),
|
|
2226
2226
|
className: cn(
|
|
2227
|
-
"
|
|
2228
|
-
isSelected ? "bg-
|
|
2229
|
-
isToday && !isSelected && "
|
|
2227
|
+
"flex aspect-square w-full items-center justify-center rounded-lg text-sm leading-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2228
|
+
isSelected ? "bg-foreground font-normal text-background hover:bg-foreground active:bg-foreground" : isDisabled ? "cursor-not-allowed text-foreground opacity-50" : !currentMonth ? "cursor-pointer text-foreground opacity-50 hover:bg-accent active:bg-accent" : "cursor-pointer text-foreground hover:bg-accent active:bg-accent",
|
|
2229
|
+
isToday && !isSelected && "border border-border"
|
|
2230
2230
|
),
|
|
2231
2231
|
children: day
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2232
|
+
},
|
|
2233
|
+
date.toISOString()
|
|
2234
|
+
);
|
|
2234
2235
|
}) })
|
|
2235
2236
|
] });
|
|
2236
2237
|
}
|
|
@@ -2341,7 +2342,7 @@ function DatePicker({
|
|
|
2341
2342
|
sideOffset: 4,
|
|
2342
2343
|
style: { minWidth: "var(--radix-popover-trigger-width)" },
|
|
2343
2344
|
className: cn(
|
|
2344
|
-
"z-50 rounded-2xl border border-border bg-background",
|
|
2345
|
+
"z-50 w-64 rounded-2xl border border-border bg-background",
|
|
2345
2346
|
"shadow-dropdown",
|
|
2346
2347
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
2347
2348
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -4924,6 +4925,7 @@ function Tabs({
|
|
|
4924
4925
|
onTabChange,
|
|
4925
4926
|
variant = "underline",
|
|
4926
4927
|
block = false,
|
|
4928
|
+
height = "h-[36px]",
|
|
4927
4929
|
className
|
|
4928
4930
|
}) {
|
|
4929
4931
|
if (variant === "pill") {
|
|
@@ -4933,6 +4935,8 @@ function Tabs({
|
|
|
4933
4935
|
className: cn(
|
|
4934
4936
|
"items-center gap-1 rounded-lg bg-muted p-1",
|
|
4935
4937
|
block ? "flex w-full" : "inline-flex",
|
|
4938
|
+
height,
|
|
4939
|
+
height && "[&_button]:py-1",
|
|
4936
4940
|
className
|
|
4937
4941
|
),
|
|
4938
4942
|
children: allTabs.map((tab) => {
|
|
@@ -5104,14 +5108,15 @@ var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
|
5104
5108
|
function CircleIndicator({
|
|
5105
5109
|
used,
|
|
5106
5110
|
total,
|
|
5107
|
-
|
|
5111
|
+
centerContent,
|
|
5108
5112
|
tooltip,
|
|
5109
5113
|
color,
|
|
5110
5114
|
size = 44,
|
|
5115
|
+
strokeWidth = 3,
|
|
5116
|
+
strokeLinecap = "round",
|
|
5111
5117
|
className
|
|
5112
5118
|
}) {
|
|
5113
5119
|
const ratio = total > 0 ? Math.min(used / total, 1) : 0;
|
|
5114
|
-
const strokeWidth = 3;
|
|
5115
5120
|
const padding = strokeWidth / 2 + 1;
|
|
5116
5121
|
const radius = size / 2 - padding;
|
|
5117
5122
|
const circumference = 2 * Math.PI * radius;
|
|
@@ -5150,7 +5155,7 @@ function CircleIndicator({
|
|
|
5150
5155
|
cy: size / 2,
|
|
5151
5156
|
r: radius,
|
|
5152
5157
|
strokeWidth,
|
|
5153
|
-
strokeLinecap
|
|
5158
|
+
strokeLinecap,
|
|
5154
5159
|
strokeDasharray: circumference,
|
|
5155
5160
|
strokeDashoffset: offset,
|
|
5156
5161
|
className: cn(!color && "text-primary"),
|
|
@@ -5160,7 +5165,7 @@ function CircleIndicator({
|
|
|
5160
5165
|
]
|
|
5161
5166
|
}
|
|
5162
5167
|
),
|
|
5163
|
-
|
|
5168
|
+
centerContent && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "z-10", children: centerContent })
|
|
5164
5169
|
]
|
|
5165
5170
|
}
|
|
5166
5171
|
) });
|