@particle-academy/react-fancy 5.3.0 → 5.5.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
@@ -4116,7 +4116,7 @@ var Checkbox = react.forwardRef(
4116
4116
  el.indeterminate = indeterminate ?? false;
4117
4117
  }
4118
4118
  }, [indeterminate]);
4119
- const sizeClasses6 = {
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
- sizeClasses6,
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
- sizeClasses6,
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 sizeClasses6 = {
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
- sizeClasses6,
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 sizeClasses6 = {
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
- sizeClasses6,
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"
@@ -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 Brand = react.forwardRef(
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,77 @@ var Brand = react.forwardRef(
6919
6949
  );
6920
6950
  }
6921
6951
  );
6922
- Brand.displayName = "Brand";
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";
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";
6923
7023
  var gapClasses2 = {
6924
7024
  sm: "gap-2",
6925
7025
  md: "gap-3",
@@ -16454,6 +16554,7 @@ exports.Autocomplete = Autocomplete;
16454
16554
  exports.Avatar = Avatar;
16455
16555
  exports.Badge = Badge;
16456
16556
  exports.Brand = Brand;
16557
+ exports.BrandMark = BrandMark;
16457
16558
  exports.Breadcrumbs = Breadcrumbs;
16458
16559
  exports.Button = Button;
16459
16560
  exports.Calendar = Calendar;
@@ -16480,6 +16581,7 @@ exports.EMOJI_ENTRIES = EMOJI_ENTRIES;
16480
16581
  exports.Editor = Editor;
16481
16582
  exports.Emoji = Emoji;
16482
16583
  exports.EmojiSelect = EmojiSelect;
16584
+ exports.Eyebrow = Eyebrow;
16483
16585
  exports.FauxClient = FauxClient;
16484
16586
  exports.Field = Field;
16485
16587
  exports.FieldModeContext = FieldModeContext;
@@ -16493,6 +16595,7 @@ exports.ImageViewer = ImageViewer;
16493
16595
  exports.Input = Input;
16494
16596
  exports.InputTag = InputTag;
16495
16597
  exports.Kanban = Kanban;
16598
+ exports.Kbd = Kbd;
16496
16599
  exports.MagicWand = MagicWand;
16497
16600
  exports.Marquee = Marquee;
16498
16601
  exports.MediaViewer = MediaViewer;