@rolster/react-components 18.22.4 → 18.22.5

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.
@@ -514,13 +514,65 @@
514
514
  transition: all 160ms 0ms var(--rls-standard-curve);
515
515
  } /*# sourceMappingURL=CheckBox.css.map */
516
516
 
517
+ .rls-skeleton {
518
+ --pvt-height: var(--rlc-skeleton-height, inherit);
519
+ --pvt-max-height: var(--rlc-skeleton-max-height, inherit);
520
+ --pvt-min-height: var(--rlc-skeleton-min-height, inherit);
521
+ --pvt-color-primary: var(--rls-app-color-100);
522
+ --pvt-color-secondary: var(--rls-app-color-200);
523
+ position: relative;
524
+ width: 100%;
525
+ height: var(--pvt-height);
526
+ max-height: var(--pvt-max-height);
527
+ min-height: var(--pvt-min-height);
528
+ line-height: var(--pvt-height);
529
+ background: linear-gradient(
530
+ 90deg,
531
+ var(--pvt-color-primary) 25%,
532
+ var(--pvt-color-secondary) 50%,
533
+ var(--pvt-color-primary) 75%
534
+ );
535
+ overflow: hidden;
536
+ background-size: 200% 100%;
537
+ animation: skeleton-animation 1600ms infinite;
538
+ border-radius: var(--rls-sizing-x2);
539
+ }
540
+ .rls-skeleton[rls-theme] {
541
+ --pvt-color-primary: var(--rls-theme-color-100);
542
+ --pvt-color-secondary: var(--rls-theme-color-200);
543
+ }
544
+ @keyframes skeleton-animation {
545
+ 0% {
546
+ background-position: 200% 0;
547
+ }
548
+ 100% {
549
+ background-position: -200% 0;
550
+ }
551
+ } /*# sourceMappingURL=Skeleton.css.map */
552
+
517
553
  .rls-image {
518
- content-visibility: auto;
519
- background-color: var(--rls-theme-color-600);
520
- opacity: 0;
554
+ --pvt-background: transparent;
555
+ --pvt-width: var(--rlc-image-width, 100%);
556
+ --pvt-height: var(--rlc-image-height, 100%);
557
+ --pvt-img-display: none;
558
+ --rlc-skeleton-width: var(--pvt-width);
559
+ --rlc-skeleton-height: var(--pvt-height);
560
+ width: var(--pvt-width);
561
+ height: var(--pvt-height);
562
+ overflow: hidden;
521
563
  }
522
564
  .rls-image--complet {
523
- opacity: 1;
565
+ --pvt-img-display: block;
566
+ background: var(--pvt-background);
567
+ }
568
+ .rls-image[rls-theme] {
569
+ --pvt-background: var(--rls-theme-color-600);
570
+ }
571
+ .rls-image > img {
572
+ display: var(--pvt-img-display);
573
+ width: var(--pvt-width);
574
+ height: var(--pvt-height);
575
+ content-visibility: auto;
524
576
  } /*# sourceMappingURL=Image.css.map */
525
577
 
526
578
  .rls-input {
@@ -883,44 +935,6 @@
883
935
  transition: all 160ms 0ms var(--rls-standard-curve);
884
936
  } /*# sourceMappingURL=RadioButton.css.map */
885
937
 
886
- .rls-skeleton {
887
- --pvt-height: var(--rlc-skeleton-height, inherit);
888
- --pvt-max-height: var(--rlc-skeleton-max-height, inherit);
889
- --pvt-min-height: var(--rlc-skeleton-min-height, inherit);
890
- position: relative;
891
- width: 100%;
892
- max-height: var(--pvt-max-height);
893
- min-height: var(--pvt-min-height);
894
- height: var(--pvt-height);
895
- line-height: var(--pvt-height);
896
- letter-spacing: inherit;
897
- overflow: hidden;
898
- background: var(--rls-theme-color-100);
899
- border-radius: var(--rls-sizing-x2);
900
- }
901
- .rls-skeleton::after {
902
- position: absolute;
903
- content: '';
904
- top: 0rem;
905
- right: 0rem;
906
- bottom: 0rem;
907
- left: 0rem;
908
- transform: translateX(-100%);
909
- background-image: linear-gradient(
910
- 90deg,
911
- var(--rls-theme-skeleton-200) 0%,
912
- var(--rls-theme-skeleton-200) 20%,
913
- var(--rls-theme-skeleton-300) 60%,
914
- var(--rls-theme-skeleton-200)
915
- );
916
- animation: skeleton-animation 1600ms infinite;
917
- }
918
- @keyframes skeleton-animation {
919
- 100% {
920
- transform: translateX(100%);
921
- }
922
- } /*# sourceMappingURL=Skeleton.css.map */
923
-
924
938
  .rls-skeleton-text {
925
939
  --pvt-height: var(--rlc-skeleton-text-height, var(--rls-body-line-height));
926
940
  --rlc-skeleton-height: var(--pvt-height);
package/dist/es/index.js CHANGED
@@ -1552,7 +1552,11 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
1552
1552
  return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
1553
1553
  }
1554
1554
 
1555
- function RlsImage({ src }) {
1555
+ function RlsSkeleton({ rlsTheme }) {
1556
+ return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
1557
+ }
1558
+
1559
+ function RlsImage({ src, rlsTheme }) {
1556
1560
  const [isComplet, setIsComplet] = useState(false);
1557
1561
  const refSrc = useRef(src);
1558
1562
  const className = useMemo(() => {
@@ -1567,7 +1571,7 @@ function RlsImage({ src }) {
1567
1571
  const onLoad = useCallback(() => {
1568
1572
  setIsComplet(true);
1569
1573
  }, []);
1570
- return jsxRuntimeExports.jsx("img", { className: className, src: src, onLoad: onLoad });
1574
+ return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!isComplet && jsxRuntimeExports.jsx(RlsSkeleton, { rlsTheme: rlsTheme }), jsxRuntimeExports.jsx("img", { src: src, onLoad: onLoad })] }));
1571
1575
  }
1572
1576
 
1573
1577
  function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
@@ -1719,10 +1723,6 @@ function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
1719
1723
  return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
1720
1724
  }
1721
1725
 
1722
- function RlsSkeleton({ rlsTheme }) {
1723
- return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
1724
- }
1725
-
1726
1726
  function RlsSkeletonText({ active, children, rlsTheme }) {
1727
1727
  return (jsxRuntimeExports.jsx("div", { className: "rls-skeleton-text", "rls-theme": rlsTheme, children: active ? (jsxRuntimeExports.jsx(RlsSkeleton, {})) : (jsxRuntimeExports.jsx("label", { className: "rls-skeleton-text__value", children: children })) }));
1728
1728
  }