@particle-academy/react-fancy 5.2.0 → 5.4.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 +136 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -2
- package/dist/index.d.ts +89 -2
- package/dist/index.js +135 -10
- 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 sizeClasses7 = {
|
|
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
|
+
sizeClasses7,
|
|
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
|
+
sizeClasses7,
|
|
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 sizeClasses7 = {
|
|
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
|
+
sizeClasses7,
|
|
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 sizeClasses7 = {
|
|
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
|
+
sizeClasses7,
|
|
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"
|
|
@@ -6867,6 +6867,36 @@ var Progress = react.forwardRef(
|
|
|
6867
6867
|
}
|
|
6868
6868
|
);
|
|
6869
6869
|
Progress.displayName = "Progress";
|
|
6870
|
+
var sizeClasses6 = {
|
|
6871
|
+
sm: "h-6 w-6 rounded-md text-[11px]",
|
|
6872
|
+
md: "h-8 w-8 rounded-lg text-sm",
|
|
6873
|
+
lg: "h-11 w-11 rounded-xl text-lg"
|
|
6874
|
+
};
|
|
6875
|
+
var BrandMark = react.forwardRef(
|
|
6876
|
+
({ glyph, size = "md", className, style, ...props }, ref) => {
|
|
6877
|
+
const numeric = typeof size === "number";
|
|
6878
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6879
|
+
"span",
|
|
6880
|
+
{
|
|
6881
|
+
ref,
|
|
6882
|
+
"data-react-fancy-brand-mark": "",
|
|
6883
|
+
"aria-hidden": props["aria-label"] ? void 0 : true,
|
|
6884
|
+
className: cn(
|
|
6885
|
+
"grid shrink-0 place-items-center font-bold leading-none text-white select-none",
|
|
6886
|
+
numeric ? "rounded-lg" : sizeClasses6[size],
|
|
6887
|
+
// Overridable default: a mark with no `className` still reads as a
|
|
6888
|
+
// mark rather than as an invisible box.
|
|
6889
|
+
"bg-zinc-900 dark:bg-zinc-100 dark:text-zinc-900",
|
|
6890
|
+
className
|
|
6891
|
+
),
|
|
6892
|
+
style: numeric ? { height: size, width: size, fontSize: Math.round(size * 0.5), ...style } : style,
|
|
6893
|
+
...props,
|
|
6894
|
+
children: glyph
|
|
6895
|
+
}
|
|
6896
|
+
);
|
|
6897
|
+
}
|
|
6898
|
+
);
|
|
6899
|
+
BrandMark.displayName = "BrandMark";
|
|
6870
6900
|
var gapClasses = {
|
|
6871
6901
|
sm: "gap-2",
|
|
6872
6902
|
md: "gap-3",
|
|
@@ -6882,7 +6912,7 @@ var taglineClasses = {
|
|
|
6882
6912
|
md: "text-sm",
|
|
6883
6913
|
lg: "text-base"
|
|
6884
6914
|
};
|
|
6885
|
-
var
|
|
6915
|
+
var BrandRoot = react.forwardRef(
|
|
6886
6916
|
({ logo, name, tagline, size = "md", className }, ref) => {
|
|
6887
6917
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6888
6918
|
"div",
|
|
@@ -6919,7 +6949,36 @@ var Brand = react.forwardRef(
|
|
|
6919
6949
|
);
|
|
6920
6950
|
}
|
|
6921
6951
|
);
|
|
6922
|
-
|
|
6952
|
+
BrandRoot.displayName = "Brand";
|
|
6953
|
+
var Brand = Object.assign(BrandRoot, { Mark: BrandMark });
|
|
6954
|
+
var Eyebrow = react.forwardRef(
|
|
6955
|
+
({ num, label, aside, rule = false, className, children, ...props }, ref) => {
|
|
6956
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6957
|
+
"div",
|
|
6958
|
+
{
|
|
6959
|
+
ref,
|
|
6960
|
+
"data-react-fancy-eyebrow": "",
|
|
6961
|
+
className: cn(
|
|
6962
|
+
"flex items-baseline gap-3 font-mono text-[11.5px] uppercase tracking-wider text-zinc-500 dark:text-zinc-400",
|
|
6963
|
+
rule && "border-b border-zinc-200 pb-2 dark:border-zinc-800",
|
|
6964
|
+
className
|
|
6965
|
+
),
|
|
6966
|
+
...props,
|
|
6967
|
+
children: [
|
|
6968
|
+
children ?? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
6969
|
+
num != null && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6970
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { className: "font-medium text-zinc-900 dark:text-zinc-100", children: num }),
|
|
6971
|
+
label != null && " \u2014 "
|
|
6972
|
+
] }),
|
|
6973
|
+
label
|
|
6974
|
+
] }),
|
|
6975
|
+
aside != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto", children: aside })
|
|
6976
|
+
]
|
|
6977
|
+
}
|
|
6978
|
+
);
|
|
6979
|
+
}
|
|
6980
|
+
);
|
|
6981
|
+
Eyebrow.displayName = "Eyebrow";
|
|
6923
6982
|
var gapClasses2 = {
|
|
6924
6983
|
sm: "gap-2",
|
|
6925
6984
|
md: "gap-3",
|
|
@@ -7042,6 +7101,66 @@ var CardFooter = react.forwardRef(
|
|
|
7042
7101
|
}
|
|
7043
7102
|
);
|
|
7044
7103
|
CardFooter.displayName = "CardFooter";
|
|
7104
|
+
var CardMedia = react.forwardRef(
|
|
7105
|
+
({
|
|
7106
|
+
src,
|
|
7107
|
+
alt = "",
|
|
7108
|
+
ratio = "16/9",
|
|
7109
|
+
height,
|
|
7110
|
+
background,
|
|
7111
|
+
objectPosition = "center",
|
|
7112
|
+
loading = "lazy",
|
|
7113
|
+
topLeft,
|
|
7114
|
+
topRight,
|
|
7115
|
+
bottomLeft,
|
|
7116
|
+
bottomRight,
|
|
7117
|
+
className,
|
|
7118
|
+
style,
|
|
7119
|
+
children,
|
|
7120
|
+
...props
|
|
7121
|
+
}, ref) => {
|
|
7122
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7123
|
+
"div",
|
|
7124
|
+
{
|
|
7125
|
+
ref,
|
|
7126
|
+
"data-react-fancy-card-media": "",
|
|
7127
|
+
className: cn(
|
|
7128
|
+
"relative overflow-hidden rounded-t-lg",
|
|
7129
|
+
// Card's `padding` prop pads EVERY direct div child
|
|
7130
|
+
// (`[&>div]:px-4 …`), which would inset the media and break the
|
|
7131
|
+
// flush-to-the-edge look every caller wants. `!` wins regardless of
|
|
7132
|
+
// stylesheet order, which plain `p-0` would not.
|
|
7133
|
+
"!px-0 !py-0",
|
|
7134
|
+
className
|
|
7135
|
+
),
|
|
7136
|
+
style: {
|
|
7137
|
+
...height === void 0 ? { aspectRatio: ratio } : { height },
|
|
7138
|
+
...background ? { background } : null,
|
|
7139
|
+
...style
|
|
7140
|
+
},
|
|
7141
|
+
...props,
|
|
7142
|
+
children: [
|
|
7143
|
+
src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7144
|
+
"img",
|
|
7145
|
+
{
|
|
7146
|
+
src,
|
|
7147
|
+
alt,
|
|
7148
|
+
loading,
|
|
7149
|
+
className: "absolute inset-0 h-full w-full object-cover",
|
|
7150
|
+
style: { objectPosition }
|
|
7151
|
+
}
|
|
7152
|
+
) : null,
|
|
7153
|
+
children,
|
|
7154
|
+
topLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 top-2 z-10", children: topLeft }) : null,
|
|
7155
|
+
topRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 top-2 z-10", children: topRight }) : null,
|
|
7156
|
+
bottomLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 left-2 z-10", children: bottomLeft }) : null,
|
|
7157
|
+
bottomRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-2 right-2 z-10", children: bottomRight }) : null
|
|
7158
|
+
]
|
|
7159
|
+
}
|
|
7160
|
+
);
|
|
7161
|
+
}
|
|
7162
|
+
);
|
|
7163
|
+
CardMedia.displayName = "CardMedia";
|
|
7045
7164
|
var variantClasses = {
|
|
7046
7165
|
outlined: "border border-zinc-200 dark:border-zinc-700",
|
|
7047
7166
|
elevated: "shadow-md border border-zinc-100 dark:border-zinc-800",
|
|
@@ -7057,6 +7176,7 @@ var CardRoot = react.forwardRef(
|
|
|
7057
7176
|
({
|
|
7058
7177
|
variant = "outlined",
|
|
7059
7178
|
padding = "md",
|
|
7179
|
+
interactive = false,
|
|
7060
7180
|
className,
|
|
7061
7181
|
children,
|
|
7062
7182
|
...props
|
|
@@ -7069,6 +7189,10 @@ var CardRoot = react.forwardRef(
|
|
|
7069
7189
|
className: cn(
|
|
7070
7190
|
"rounded-lg bg-white dark:bg-zinc-900",
|
|
7071
7191
|
variantClasses[variant],
|
|
7192
|
+
// `overflow-hidden` is part of `interactive` rather than always-on:
|
|
7193
|
+
// clipping unconditionally would cut off popovers and dropdowns that
|
|
7194
|
+
// legitimately overflow a static card.
|
|
7195
|
+
interactive && "overflow-hidden transition hover:-translate-y-0.5 hover:shadow-lg hover:border-zinc-300 dark:hover:border-zinc-600",
|
|
7072
7196
|
paddingClasses[padding],
|
|
7073
7197
|
className
|
|
7074
7198
|
),
|
|
@@ -7080,6 +7204,7 @@ var CardRoot = react.forwardRef(
|
|
|
7080
7204
|
);
|
|
7081
7205
|
CardRoot.displayName = "Card";
|
|
7082
7206
|
var Card = Object.assign(CardRoot, {
|
|
7207
|
+
Media: CardMedia,
|
|
7083
7208
|
Header: CardHeader,
|
|
7084
7209
|
Body: CardBody,
|
|
7085
7210
|
Footer: CardFooter
|
|
@@ -16388,6 +16513,7 @@ exports.Autocomplete = Autocomplete;
|
|
|
16388
16513
|
exports.Avatar = Avatar;
|
|
16389
16514
|
exports.Badge = Badge;
|
|
16390
16515
|
exports.Brand = Brand;
|
|
16516
|
+
exports.BrandMark = BrandMark;
|
|
16391
16517
|
exports.Breadcrumbs = Breadcrumbs;
|
|
16392
16518
|
exports.Button = Button;
|
|
16393
16519
|
exports.Calendar = Calendar;
|
|
@@ -16414,6 +16540,7 @@ exports.EMOJI_ENTRIES = EMOJI_ENTRIES;
|
|
|
16414
16540
|
exports.Editor = Editor;
|
|
16415
16541
|
exports.Emoji = Emoji;
|
|
16416
16542
|
exports.EmojiSelect = EmojiSelect;
|
|
16543
|
+
exports.Eyebrow = Eyebrow;
|
|
16417
16544
|
exports.FauxClient = FauxClient;
|
|
16418
16545
|
exports.Field = Field;
|
|
16419
16546
|
exports.FieldModeContext = FieldModeContext;
|