@particle-academy/react-fancy 5.7.0 → 5.9.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 +21 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/styles.css +269 -255
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2995,9 +2995,10 @@ function Field({
|
|
|
2995
2995
|
htmlFor,
|
|
2996
2996
|
size = "md",
|
|
2997
2997
|
children,
|
|
2998
|
-
className
|
|
2998
|
+
className,
|
|
2999
|
+
...rest
|
|
2999
3000
|
}) {
|
|
3000
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-react-fancy-field": "", className: cn("flex flex-col gap-2", className), children: [
|
|
3001
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...rest, "data-react-fancy-field": "", className: cn("flex flex-col gap-2", className), children: [
|
|
3001
3002
|
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3002
3003
|
"label",
|
|
3003
3004
|
{
|
|
@@ -4098,7 +4099,8 @@ var Checkbox = react.forwardRef(
|
|
|
4098
4099
|
defaultChecked = false,
|
|
4099
4100
|
onCheckedChange,
|
|
4100
4101
|
indeterminate,
|
|
4101
|
-
mode
|
|
4102
|
+
mode,
|
|
4103
|
+
...rest
|
|
4102
4104
|
}, ref) => {
|
|
4103
4105
|
const autoId = react.useId();
|
|
4104
4106
|
const checkboxId = id ?? autoId;
|
|
@@ -4124,7 +4126,7 @@ var Checkbox = react.forwardRef(
|
|
|
4124
4126
|
xl: "h-6 w-6"
|
|
4125
4127
|
}[size];
|
|
4126
4128
|
const glyph = indeterminate ? "\u2014" : checked ? "\u2713" : "\u2715";
|
|
4127
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-react-fancy-checkbox": "", className: cn("flex items-start gap-2", className), children: [
|
|
4129
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...rest, "data-react-fancy-checkbox": "", className: cn("flex items-start gap-2", className), children: [
|
|
4128
4130
|
!showControl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4129
4131
|
"span",
|
|
4130
4132
|
{
|
|
@@ -4215,7 +4217,8 @@ function CheckboxGroup({
|
|
|
4215
4217
|
defaultValue = [],
|
|
4216
4218
|
onValueChange,
|
|
4217
4219
|
orientation = "vertical",
|
|
4218
|
-
mode
|
|
4220
|
+
mode,
|
|
4221
|
+
...rest
|
|
4219
4222
|
}) {
|
|
4220
4223
|
const groupId = react.useId();
|
|
4221
4224
|
const resolvedMode = useFieldMode(mode);
|
|
@@ -4239,6 +4242,7 @@ function CheckboxGroup({
|
|
|
4239
4242
|
const content = !showControl ? /* @__PURE__ */ jsxRuntime.jsx(DisplayValue, { size, interactive, onActivate: enterEdit, children: list.map(resolveOption).filter((o) => value.includes(o.value)).map((o) => o.label).join(", ") }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4240
4243
|
"div",
|
|
4241
4244
|
{
|
|
4245
|
+
...rest,
|
|
4242
4246
|
"data-react-fancy-checkbox-group": "",
|
|
4243
4247
|
onBlur: (e) => {
|
|
4244
4248
|
if (interactive && !e.currentTarget.contains(e.relatedTarget)) exitEdit();
|
|
@@ -4321,7 +4325,8 @@ function RadioGroup({
|
|
|
4321
4325
|
defaultValue,
|
|
4322
4326
|
onValueChange,
|
|
4323
4327
|
orientation = "vertical",
|
|
4324
|
-
mode
|
|
4328
|
+
mode,
|
|
4329
|
+
...rest
|
|
4325
4330
|
}) {
|
|
4326
4331
|
const groupId = react.useId();
|
|
4327
4332
|
const radioName = name ?? groupId;
|
|
@@ -4343,6 +4348,7 @@ function RadioGroup({
|
|
|
4343
4348
|
const content = !showControl ? /* @__PURE__ */ jsxRuntime.jsx(DisplayValue, { size, interactive, onActivate: enterEdit, children: list.map(resolveOption).find((o) => o.value === value)?.label }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4344
4349
|
"div",
|
|
4345
4350
|
{
|
|
4351
|
+
...rest,
|
|
4346
4352
|
"data-react-fancy-radio-group": "",
|
|
4347
4353
|
role: "radiogroup",
|
|
4348
4354
|
onBlur: (e) => {
|
|
@@ -4454,7 +4460,8 @@ var Switch = react.forwardRef(
|
|
|
4454
4460
|
defaultChecked = false,
|
|
4455
4461
|
onCheckedChange,
|
|
4456
4462
|
color = "blue",
|
|
4457
|
-
mode
|
|
4463
|
+
mode,
|
|
4464
|
+
...rest
|
|
4458
4465
|
}, ref) => {
|
|
4459
4466
|
const autoId = react.useId();
|
|
4460
4467
|
const switchId = id ?? autoId;
|
|
@@ -4486,7 +4493,7 @@ var Switch = react.forwardRef(
|
|
|
4486
4493
|
lg: "translate-x-5",
|
|
4487
4494
|
xl: "translate-x-6"
|
|
4488
4495
|
}[size];
|
|
4489
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-react-fancy-switch": "", className: cn("flex items-start gap-2", className), children: [
|
|
4496
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...rest, "data-react-fancy-switch": "", className: cn("flex items-start gap-2", className), children: [
|
|
4490
4497
|
!showControl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4491
4498
|
"span",
|
|
4492
4499
|
{
|
|
@@ -4854,7 +4861,8 @@ function MultiSwitch({
|
|
|
4854
4861
|
defaultValue,
|
|
4855
4862
|
onValueChange,
|
|
4856
4863
|
linear,
|
|
4857
|
-
mode
|
|
4864
|
+
mode,
|
|
4865
|
+
...rest
|
|
4858
4866
|
}) {
|
|
4859
4867
|
const resolvedOptions = list.map(resolveOption);
|
|
4860
4868
|
const fallback = defaultValue ?? resolvedOptions[0]?.value;
|
|
@@ -4888,6 +4896,7 @@ function MultiSwitch({
|
|
|
4888
4896
|
"div",
|
|
4889
4897
|
{
|
|
4890
4898
|
ref: containerRef,
|
|
4899
|
+
...rest,
|
|
4891
4900
|
"data-react-fancy-multi-switch": "",
|
|
4892
4901
|
role: "radiogroup",
|
|
4893
4902
|
id,
|
|
@@ -5989,7 +5998,8 @@ function TableRow({
|
|
|
5989
5998
|
trayTriggerPosition = "end",
|
|
5990
5999
|
expanded: controlledExpanded,
|
|
5991
6000
|
defaultExpanded = false,
|
|
5992
|
-
onExpandedChange
|
|
6001
|
+
onExpandedChange,
|
|
6002
|
+
...rest
|
|
5993
6003
|
}) {
|
|
5994
6004
|
const [expanded, setExpanded] = useControllableState(
|
|
5995
6005
|
controlledExpanded,
|
|
@@ -6028,6 +6038,7 @@ function TableRow({
|
|
|
6028
6038
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6029
6039
|
"tr",
|
|
6030
6040
|
{
|
|
6041
|
+
...rest,
|
|
6031
6042
|
"data-react-fancy-table-row": "",
|
|
6032
6043
|
className: cn(
|
|
6033
6044
|
"transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-800/50",
|