@lindle/linoardo 1.0.11 → 1.0.12

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.js CHANGED
@@ -1,4 +1,5 @@
1
- import * as React4 from 'react';
1
+ import * as React3 from 'react';
2
+ import { forwardRef, useCallback, useContext, useId, useState, useMemo, useEffect } from 'react';
2
3
  import { twMerge } from 'tailwind-merge';
3
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
5
 
@@ -129,7 +130,7 @@ var sizeClasses = {
129
130
  large: "px-6 py-3 text-lg",
130
131
  "x-large": "px-7 py-3.5 text-xl"
131
132
  };
132
- var Button = React4.forwardRef(
133
+ var Button = React3.forwardRef(
133
134
  ({
134
135
  variant = "solid",
135
136
  color = "primary",
@@ -300,7 +301,7 @@ var resolveIconClassName2 = (icon) => {
300
301
  const normalized = iconName.startsWith("mdi-") ? iconName : `mdi-${iconName}`;
301
302
  return Array.from(/* @__PURE__ */ new Set([...baseClasses, normalized])).join(" ");
302
303
  };
303
- var Chip = React4.forwardRef(
304
+ var Chip = forwardRef(
304
305
  ({
305
306
  variant = "solid",
306
307
  color = "primary",
@@ -332,7 +333,7 @@ var Chip = React4.forwardRef(
332
333
  const appendIconClassName = resolveIconClassName2(appendIcon);
333
334
  const closeIconClassName = resolveIconClassName2(closeIcon);
334
335
  const filterIconClassName = filter && selected ? resolveIconClassName2(filterIcon) : void 0;
335
- const handleClick = React4.useCallback(
336
+ const handleClick = useCallback(
336
337
  (event) => {
337
338
  if (disabled) {
338
339
  event.preventDefault();
@@ -343,7 +344,7 @@ var Chip = React4.forwardRef(
343
344
  },
344
345
  [disabled, onClick]
345
346
  );
346
- const handleKeyDown = React4.useCallback(
347
+ const handleKeyDown = useCallback(
347
348
  (event) => {
348
349
  onKeyDown?.(event);
349
350
  if (event.defaultPrevented || disabled || !interactive) {
@@ -356,7 +357,7 @@ var Chip = React4.forwardRef(
356
357
  },
357
358
  [disabled, interactive, onKeyDown]
358
359
  );
359
- const handleCloseClick = React4.useCallback(
360
+ const handleCloseClick = useCallback(
360
361
  (event) => {
361
362
  event.stopPropagation();
362
363
  if (disabled) {
@@ -367,7 +368,7 @@ var Chip = React4.forwardRef(
367
368
  },
368
369
  [disabled, onClose]
369
370
  );
370
- const handleCloseKeyDown = React4.useCallback((event) => {
371
+ const handleCloseKeyDown = useCallback((event) => {
371
372
  if (event.key === " " || event.key === "Enter") {
372
373
  event.stopPropagation();
373
374
  }
@@ -439,7 +440,7 @@ var accentClasses = {
439
440
  surface: { text: "text-gray-900", bg: "bg-gray-100", indicator: "bg-gray-900" },
440
441
  bw: { text: "text-gray-900", bg: "bg-gray-100", indicator: "bg-gray-900" }
441
442
  };
442
- var ListItem = React4.forwardRef((props, ref) => {
443
+ var ListItem = React3.forwardRef((props, ref) => {
443
444
  const {
444
445
  component,
445
446
  href,
@@ -556,13 +557,13 @@ var listRoundedClasses = {
556
557
  pill: "rounded-full"
557
558
  };
558
559
  var isListItemElement = (element) => {
559
- if (!React4.isValidElement(element)) {
560
+ if (!React3.isValidElement(element)) {
560
561
  return false;
561
562
  }
562
563
  const elementType = element.type;
563
564
  return element.type === Item_default || elementType.displayName === Item_default.displayName;
564
565
  };
565
- var List = React4.forwardRef((props, ref) => {
566
+ var List = React3.forwardRef((props, ref) => {
566
567
  const {
567
568
  variant = "solid",
568
569
  density = "default",
@@ -584,11 +585,11 @@ var List = React4.forwardRef((props, ref) => {
584
585
  const navClass = nav ? "py-1" : void 0;
585
586
  const accentColor = color;
586
587
  const enhanceChild = (child) => {
587
- if (!React4.isValidElement(child)) {
588
+ if (!React3.isValidElement(child)) {
588
589
  return child;
589
590
  }
590
591
  if (isListItemElement(child)) {
591
- return React4.cloneElement(child, {
592
+ return React3.cloneElement(child, {
592
593
  density: child.props.density ?? density,
593
594
  lines: child.props.lines ?? lines,
594
595
  nav: child.props.nav ?? nav,
@@ -598,14 +599,14 @@ var List = React4.forwardRef((props, ref) => {
598
599
  });
599
600
  }
600
601
  if (child.props && typeof child.props === "object" && "children" in child.props) {
601
- const nestedChildren = React4.Children.map(child.props.children, enhanceChild);
602
+ const nestedChildren = React3.Children.map(child.props.children, enhanceChild);
602
603
  if (nestedChildren !== child.props.children) {
603
- return React4.cloneElement(child, void 0, nestedChildren);
604
+ return React3.cloneElement(child, void 0, nestedChildren);
604
605
  }
605
606
  }
606
607
  return child;
607
608
  };
608
- const resolvedChildren = React4.Children.map(children, enhanceChild);
609
+ const resolvedChildren = React3.Children.map(children, enhanceChild);
609
610
  return /* @__PURE__ */ jsx(
610
611
  "div",
611
612
  {
@@ -633,7 +634,7 @@ var offsetClasses = {
633
634
  };
634
635
  var menuBaseClasses = "absolute z-50 min-w-[10rem] rounded-xl border border-gray-200/80 bg-white/95 p-2 text-sm text-gray-700 shadow-lg shadow-gray-900/10 ring-1 ring-black/5 backdrop-blur-md transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2";
635
636
  var overlayBaseClasses = "fixed inset-0 z-40 bg-gray-900/30 backdrop-blur-[1px]";
636
- var Menu = React4.forwardRef((props, ref) => {
637
+ var Menu = React3.forwardRef((props, ref) => {
637
638
  const {
638
639
  activator,
639
640
  children,
@@ -710,7 +711,7 @@ var Menu = React4.forwardRef((props, ref) => {
710
711
  });
711
712
  Menu.displayName = "Menu";
712
713
  var Menu_default = Menu;
713
- var ExpansionPanelContext = React4.createContext(null);
714
+ var ExpansionPanelContext = React3.createContext(null);
714
715
  var densityClasses2 = {
715
716
  comfortable: "py-5",
716
717
  default: "py-4",
@@ -739,7 +740,7 @@ var accentClasses2 = {
739
740
  surface: { text: "text-gray-900", bg: "bg-gray-100", border: "border-gray-200" },
740
741
  bw: { text: "text-gray-900", bg: "bg-gray-100", border: "border-gray-200" }
741
742
  };
742
- var ExpansionPanelItem = React4.forwardRef((props, ref) => {
743
+ var ExpansionPanelItem = forwardRef((props, ref) => {
743
744
  const {
744
745
  value,
745
746
  title,
@@ -758,8 +759,8 @@ var ExpansionPanelItem = React4.forwardRef((props, ref) => {
758
759
  color: colorOverride,
759
760
  ...rest
760
761
  } = props;
761
- const context = React4.useContext(ExpansionPanelContext);
762
- const generatedValue = React4.useId();
762
+ const context = useContext(ExpansionPanelContext);
763
+ const generatedValue = useId();
763
764
  const panelValue = value ?? generatedValue;
764
765
  const density = context?.density ?? "default";
765
766
  const color = colorOverride ?? context?.color ?? "primary";
@@ -767,9 +768,9 @@ var ExpansionPanelItem = React4.forwardRef((props, ref) => {
767
768
  const variant = context?.variant ?? "elevated";
768
769
  const rounded = context?.rounded ?? "lg";
769
770
  const accent = accentClasses2[color] ?? accentClasses2.primary;
770
- const headerId = React4.useId();
771
- const contentId = React4.useId();
772
- const [standaloneExpanded, setStandaloneExpanded] = React4.useState(false);
771
+ const headerId = useId();
772
+ const contentId = useId();
773
+ const [standaloneExpanded, setStandaloneExpanded] = useState(false);
773
774
  const isExpanded = context ? context.expandedValues.includes(panelValue) : standaloneExpanded;
774
775
  const handleToggle = () => {
775
776
  if (disabled) {
@@ -895,7 +896,7 @@ var normalizeValues = (value, allowMultiple) => {
895
896
  return normalized.length ? [normalized[0]] : [];
896
897
  };
897
898
  var clampValues = (values, allowMultiple) => allowMultiple ? uniqueValues(values) : values.length ? [values[0]] : [];
898
- var ExpansionPanel = React4.forwardRef((props, ref) => {
899
+ var ExpansionPanel = forwardRef((props, ref) => {
899
900
  const {
900
901
  variant = "elevated",
901
902
  rounded = "lg",
@@ -911,22 +912,22 @@ var ExpansionPanel = React4.forwardRef((props, ref) => {
911
912
  ...rest
912
913
  } = props;
913
914
  const isControlled = value !== void 0;
914
- const controlledValues = React4.useMemo(() => {
915
+ const controlledValues = useMemo(() => {
915
916
  if (!isControlled) {
916
917
  return void 0;
917
918
  }
918
919
  return normalizeValues(value, multiple);
919
920
  }, [isControlled, value, multiple]);
920
- const [internalValues, setInternalValues] = React4.useState(
921
+ const [internalValues, setInternalValues] = useState(
921
922
  () => normalizeValues(defaultValue, multiple)
922
923
  );
923
924
  const expandedValues = controlledValues ?? internalValues;
924
- React4.useEffect(() => {
925
+ useEffect(() => {
925
926
  if (!isControlled) {
926
927
  setInternalValues((prev) => clampValues(prev, multiple));
927
928
  }
928
929
  }, [multiple, isControlled]);
929
- const handleValueChange = React4.useCallback(
930
+ const handleValueChange = useCallback(
930
931
  (next) => {
931
932
  if (!isControlled) {
932
933
  setInternalValues(next);
@@ -941,7 +942,7 @@ var ExpansionPanel = React4.forwardRef((props, ref) => {
941
942
  },
942
943
  [isControlled, multiple, onChange]
943
944
  );
944
- const toggle = React4.useCallback(
945
+ const toggle = useCallback(
945
946
  (panelValue, disabled) => {
946
947
  if (disabled) {
947
948
  return;
@@ -952,7 +953,7 @@ var ExpansionPanel = React4.forwardRef((props, ref) => {
952
953
  },
953
954
  [expandedValues, handleValueChange, multiple]
954
955
  );
955
- const providerValue = React4.useMemo(
956
+ const providerValue = useMemo(
956
957
  () => ({ expandedValues, toggle, density, color, divider, rounded, variant }),
957
958
  [expandedValues, toggle, density, color, divider, rounded, variant]
958
959
  );
@@ -981,7 +982,7 @@ var resolveSizeValue = (value) => {
981
982
  }
982
983
  return typeof value === "number" ? `${value}px` : value;
983
984
  };
984
- var Dialog = React4.forwardRef((props, forwardedRef) => {
985
+ var Dialog = React3.forwardRef((props, forwardedRef) => {
985
986
  const {
986
987
  activator,
987
988
  children,
@@ -1098,7 +1099,7 @@ var arrowPlacementClasses = {
1098
1099
  "right-start": "left-full top-4 -translate-x-1/2",
1099
1100
  "right-end": "left-full bottom-4 -translate-x-1/2"
1100
1101
  };
1101
- var ToolTip = React4.forwardRef((props, forwardedRef) => {
1102
+ var ToolTip = React3.forwardRef((props, forwardedRef) => {
1102
1103
  const {
1103
1104
  activator,
1104
1105
  children,