@particle-academy/react-fancy 5.6.1 → 5.8.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 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",
@@ -7047,6 +7058,40 @@ var IndexList = react.forwardRef(
7047
7058
  }
7048
7059
  );
7049
7060
  IndexList.displayName = "IndexList";
7061
+ var PullQuote = react.forwardRef(
7062
+ ({ attribution, source, citeUrl, rule = false, className, children, ...props }, ref) => {
7063
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7064
+ "blockquote",
7065
+ {
7066
+ ref,
7067
+ cite: citeUrl,
7068
+ "data-react-fancy-pull-quote": "",
7069
+ className: cn(
7070
+ "m-0 text-2xl font-medium leading-snug tracking-tight text-zinc-900 dark:text-zinc-100",
7071
+ rule && "border-y border-zinc-200 py-6 dark:border-zinc-800",
7072
+ className
7073
+ ),
7074
+ ...props,
7075
+ children: [
7076
+ /* @__PURE__ */ jsxRuntime.jsx("p", { "data-react-fancy-pull-quote-text": "", className: "m-0", children }),
7077
+ (attribution != null || source != null) && /* @__PURE__ */ jsxRuntime.jsxs(
7078
+ "footer",
7079
+ {
7080
+ "data-react-fancy-pull-quote-attribution": "",
7081
+ className: "mt-3 text-sm font-normal tracking-normal text-zinc-500 dark:text-zinc-400",
7082
+ children: [
7083
+ attribution != null && /* @__PURE__ */ jsxRuntime.jsx("cite", { className: "not-italic", children: attribution }),
7084
+ attribution != null && source != null && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: " \xB7 " }),
7085
+ source
7086
+ ]
7087
+ }
7088
+ )
7089
+ ]
7090
+ }
7091
+ );
7092
+ }
7093
+ );
7094
+ PullQuote.displayName = "PullQuote";
7050
7095
  var StatBand = react.forwardRef(
7051
7096
  ({ columns = 4, className, style, children, ...props }, ref) => {
7052
7097
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -16690,6 +16735,7 @@ exports.Portal = Portal;
16690
16735
  exports.Profile = Profile;
16691
16736
  exports.Progress = Progress;
16692
16737
  exports.PromptInput = PromptInput;
16738
+ exports.PullQuote = PullQuote;
16693
16739
  exports.RadioGroup = RadioGroup;
16694
16740
  exports.ReasonTag = ReasonTag;
16695
16741
  exports.SKIN_TONES = SKIN_TONES;