@particle-academy/react-fancy 5.4.0 → 5.6.0
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.cjs +119 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -1
- package/dist/index.d.ts +97 -1
- package/dist/index.js +117 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4116,7 +4116,7 @@ var Checkbox = react.forwardRef(
|
|
|
4116
4116
|
el.indeterminate = indeterminate ?? false;
|
|
4117
4117
|
}
|
|
4118
4118
|
}, [indeterminate]);
|
|
4119
|
-
const
|
|
4119
|
+
const sizeClasses8 = {
|
|
4120
4120
|
xs: "h-3.5 w-3.5",
|
|
4121
4121
|
sm: "h-4 w-4",
|
|
4122
4122
|
md: "h-[18px] w-[18px]",
|
|
@@ -4142,7 +4142,7 @@ var Checkbox = react.forwardRef(
|
|
|
4142
4142
|
} : void 0,
|
|
4143
4143
|
className: cn(
|
|
4144
4144
|
"flex shrink-0 items-center justify-center text-zinc-700 dark:text-zinc-200",
|
|
4145
|
-
|
|
4145
|
+
sizeClasses8,
|
|
4146
4146
|
interactive && "cursor-pointer rounded outline-none transition-colors hover:text-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/40 dark:hover:text-white"
|
|
4147
4147
|
),
|
|
4148
4148
|
"aria-hidden": interactive ? void 0 : "true",
|
|
@@ -4171,7 +4171,7 @@ var Checkbox = react.forwardRef(
|
|
|
4171
4171
|
},
|
|
4172
4172
|
onChange: (e) => setChecked(e.target.checked),
|
|
4173
4173
|
className: cn(
|
|
4174
|
-
|
|
4174
|
+
sizeClasses8,
|
|
4175
4175
|
"cursor-pointer rounded border border-zinc-300 bg-white text-blue-600 transition-[border-color,box-shadow] duration-150 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-[#1e1e24]",
|
|
4176
4176
|
dirtyRingClasses(dirty),
|
|
4177
4177
|
error && "border-red-500"
|
|
@@ -4229,7 +4229,7 @@ function CheckboxGroup({
|
|
|
4229
4229
|
const next = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
4230
4230
|
setValue(next);
|
|
4231
4231
|
};
|
|
4232
|
-
const
|
|
4232
|
+
const sizeClasses8 = {
|
|
4233
4233
|
xs: "h-3.5 w-3.5",
|
|
4234
4234
|
sm: "h-4 w-4",
|
|
4235
4235
|
md: "h-[18px] w-[18px]",
|
|
@@ -4265,7 +4265,7 @@ function CheckboxGroup({
|
|
|
4265
4265
|
autoFocus: interactive && index === 0,
|
|
4266
4266
|
onChange: () => handleToggle(resolved.value),
|
|
4267
4267
|
className: cn(
|
|
4268
|
-
|
|
4268
|
+
sizeClasses8,
|
|
4269
4269
|
"cursor-pointer rounded border border-zinc-300 bg-white text-blue-600 transition-[border-color,box-shadow] duration-150 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-[#1e1e24]",
|
|
4270
4270
|
dirtyRingClasses(dirty),
|
|
4271
4271
|
error && "border-red-500"
|
|
@@ -4332,7 +4332,7 @@ function RadioGroup({
|
|
|
4332
4332
|
defaultValue,
|
|
4333
4333
|
onValueChange
|
|
4334
4334
|
);
|
|
4335
|
-
const
|
|
4335
|
+
const sizeClasses8 = {
|
|
4336
4336
|
xs: "h-3.5 w-3.5",
|
|
4337
4337
|
sm: "h-4 w-4",
|
|
4338
4338
|
md: "h-[18px] w-[18px]",
|
|
@@ -4371,7 +4371,7 @@ function RadioGroup({
|
|
|
4371
4371
|
autoFocus: shouldAutoFocus,
|
|
4372
4372
|
onChange: () => setValue(resolved.value),
|
|
4373
4373
|
className: cn(
|
|
4374
|
-
|
|
4374
|
+
sizeClasses8,
|
|
4375
4375
|
"cursor-pointer border border-zinc-300 bg-white text-blue-600 transition-[border-color,box-shadow] duration-150 focus:ring-2 focus:ring-blue-500/40 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-[#1e1e24]",
|
|
4376
4376
|
dirtyRingClasses(dirty),
|
|
4377
4377
|
error && "border-red-500"
|
|
@@ -6979,6 +6979,114 @@ var Eyebrow = react.forwardRef(
|
|
|
6979
6979
|
}
|
|
6980
6980
|
);
|
|
6981
6981
|
Eyebrow.displayName = "Eyebrow";
|
|
6982
|
+
var sizeClasses7 = {
|
|
6983
|
+
xs: "min-w-[1.25rem] px-1 py-px text-[9px]",
|
|
6984
|
+
sm: "min-w-[1.4rem] px-1 py-0.5 text-[10px]",
|
|
6985
|
+
md: "min-w-[1.6rem] px-1.5 py-0.5 text-xs"
|
|
6986
|
+
};
|
|
6987
|
+
var capClasses = "inline-grid place-items-center rounded border border-zinc-300 bg-zinc-50 font-mono leading-none text-zinc-700 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300";
|
|
6988
|
+
var Kbd = react.forwardRef(
|
|
6989
|
+
({ keys, separator = "+", size = "sm", className, children, ...props }, ref) => {
|
|
6990
|
+
if (keys?.length) {
|
|
6991
|
+
return (
|
|
6992
|
+
// The chord is ONE <kbd> containing per-key caps: a screen reader
|
|
6993
|
+
// announces "Cmd + K" as a unit, which is what it is, rather than as
|
|
6994
|
+
// two unrelated keys.
|
|
6995
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6996
|
+
"kbd",
|
|
6997
|
+
{
|
|
6998
|
+
ref,
|
|
6999
|
+
"data-react-fancy-kbd": "",
|
|
7000
|
+
className: cn("inline-flex items-center gap-1 font-mono not-italic", className),
|
|
7001
|
+
...props,
|
|
7002
|
+
children: keys.map((k, i) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
7003
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "text-zinc-400 dark:text-zinc-500", children: separator }),
|
|
7004
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(capClasses, sizeClasses7[size]), children: k })
|
|
7005
|
+
] }, i))
|
|
7006
|
+
}
|
|
7007
|
+
)
|
|
7008
|
+
);
|
|
7009
|
+
}
|
|
7010
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7011
|
+
"kbd",
|
|
7012
|
+
{
|
|
7013
|
+
ref,
|
|
7014
|
+
"data-react-fancy-kbd": "",
|
|
7015
|
+
className: cn(capClasses, sizeClasses7[size], "not-italic", className),
|
|
7016
|
+
...props,
|
|
7017
|
+
children
|
|
7018
|
+
}
|
|
7019
|
+
);
|
|
7020
|
+
}
|
|
7021
|
+
);
|
|
7022
|
+
Kbd.displayName = "Kbd";
|
|
7023
|
+
var IndexList = react.forwardRef(
|
|
7024
|
+
({ items, linkAs, className, ...props }, ref) => {
|
|
7025
|
+
const Link = linkAs ?? "a";
|
|
7026
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { ref, "data-react-fancy-index-list": "", className: cn("m-0 list-none p-0", className), ...props, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7027
|
+
"li",
|
|
7028
|
+
{
|
|
7029
|
+
"data-react-fancy-index-row": "",
|
|
7030
|
+
className: "relative flex items-baseline gap-4 border-b border-zinc-200 py-3 last:border-b-0 dark:border-zinc-800",
|
|
7031
|
+
children: [
|
|
7032
|
+
item.num != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-xs tabular-nums text-zinc-400 dark:text-zinc-500", children: item.num }),
|
|
7033
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-zinc-900 dark:text-zinc-100", children: item.href ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7034
|
+
Link,
|
|
7035
|
+
{
|
|
7036
|
+
href: item.href,
|
|
7037
|
+
className: "no-underline after:absolute after:inset-0 after:content-[''] hover:underline",
|
|
7038
|
+
children: item.title
|
|
7039
|
+
}
|
|
7040
|
+
) : item.title }),
|
|
7041
|
+
item.meta != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 truncate text-sm text-zinc-500 dark:text-zinc-400", children: item.meta }),
|
|
7042
|
+
item.value != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto shrink-0 font-mono text-xs tabular-nums text-zinc-500 dark:text-zinc-400", children: item.value })
|
|
7043
|
+
]
|
|
7044
|
+
},
|
|
7045
|
+
item.id ?? i
|
|
7046
|
+
)) });
|
|
7047
|
+
}
|
|
7048
|
+
);
|
|
7049
|
+
IndexList.displayName = "IndexList";
|
|
7050
|
+
var StatBand = react.forwardRef(
|
|
7051
|
+
({ columns = 4, className, style, children, ...props }, ref) => {
|
|
7052
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7053
|
+
"div",
|
|
7054
|
+
{
|
|
7055
|
+
ref,
|
|
7056
|
+
"data-react-fancy-stat-band": "",
|
|
7057
|
+
className: cn("grid gap-6", className),
|
|
7058
|
+
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style },
|
|
7059
|
+
...props,
|
|
7060
|
+
children
|
|
7061
|
+
}
|
|
7062
|
+
);
|
|
7063
|
+
}
|
|
7064
|
+
);
|
|
7065
|
+
StatBand.displayName = "StatBand";
|
|
7066
|
+
var valueClasses = {
|
|
7067
|
+
sm: "text-xl",
|
|
7068
|
+
md: "text-3xl",
|
|
7069
|
+
lg: "text-5xl"
|
|
7070
|
+
};
|
|
7071
|
+
var StatRoot = react.forwardRef(
|
|
7072
|
+
({ value, label, size = "md", className, children, ...props }, ref) => {
|
|
7073
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, "data-react-fancy-stat": "", className: cn(className), ...props, children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7074
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7075
|
+
"div",
|
|
7076
|
+
{
|
|
7077
|
+
className: cn(
|
|
7078
|
+
"font-semibold leading-none tracking-tight text-zinc-900 tabular-nums dark:text-zinc-100",
|
|
7079
|
+
valueClasses[size]
|
|
7080
|
+
),
|
|
7081
|
+
children: value
|
|
7082
|
+
}
|
|
7083
|
+
),
|
|
7084
|
+
label != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1.5 font-mono text-xs uppercase tracking-wide text-zinc-500 dark:text-zinc-400", children: label })
|
|
7085
|
+
] }) });
|
|
7086
|
+
}
|
|
7087
|
+
);
|
|
7088
|
+
StatRoot.displayName = "Stat";
|
|
7089
|
+
var Stat = Object.assign(StatRoot, { Band: StatBand });
|
|
6982
7090
|
var gapClasses2 = {
|
|
6983
7091
|
sm: "gap-2",
|
|
6984
7092
|
md: "gap-3",
|
|
@@ -16551,9 +16659,11 @@ exports.FormProvider = FormProvider;
|
|
|
16551
16659
|
exports.Heading = Heading;
|
|
16552
16660
|
exports.Icon = Icon;
|
|
16553
16661
|
exports.ImageViewer = ImageViewer;
|
|
16662
|
+
exports.IndexList = IndexList;
|
|
16554
16663
|
exports.Input = Input;
|
|
16555
16664
|
exports.InputTag = InputTag;
|
|
16556
16665
|
exports.Kanban = Kanban;
|
|
16666
|
+
exports.Kbd = Kbd;
|
|
16557
16667
|
exports.MagicWand = MagicWand;
|
|
16558
16668
|
exports.Marquee = Marquee;
|
|
16559
16669
|
exports.MediaViewer = MediaViewer;
|
|
@@ -16580,6 +16690,8 @@ exports.Separator = Separator;
|
|
|
16580
16690
|
exports.Sidebar = Sidebar;
|
|
16581
16691
|
exports.Skeleton = Skeleton;
|
|
16582
16692
|
exports.Slider = Slider;
|
|
16693
|
+
exports.Stat = Stat;
|
|
16694
|
+
exports.StatBand = StatBand;
|
|
16583
16695
|
exports.StickyNote = StickyNote;
|
|
16584
16696
|
exports.Switch = Switch;
|
|
16585
16697
|
exports.Table = Table;
|