@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/cjs/index.js CHANGED
@@ -1554,7 +1554,11 @@ function RlsCheckBoxControl({ formControl, disabled, identifier, rlsTheme }) {
1554
1554
  return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
1555
1555
  }
1556
1556
 
1557
- function RlsImage({ src }) {
1557
+ function RlsSkeleton({ rlsTheme }) {
1558
+ return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
1559
+ }
1560
+
1561
+ function RlsImage({ src, rlsTheme }) {
1558
1562
  const [isComplet, setIsComplet] = require$$0.useState(false);
1559
1563
  const refSrc = require$$0.useRef(src);
1560
1564
  const className = require$$0.useMemo(() => {
@@ -1569,7 +1573,7 @@ function RlsImage({ src }) {
1569
1573
  const onLoad = require$$0.useCallback(() => {
1570
1574
  setIsComplet(true);
1571
1575
  }, []);
1572
- return jsxRuntimeExports.jsx("img", { className: className, src: src, onLoad: onLoad });
1576
+ return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!isComplet && jsxRuntimeExports.jsx(RlsSkeleton, { rlsTheme: rlsTheme }), jsxRuntimeExports.jsx("img", { src: src, onLoad: onLoad })] }));
1573
1577
  }
1574
1578
 
1575
1579
  function RlsInput({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
@@ -1721,10 +1725,6 @@ function RlsRadioButton({ checked, disabled, identifier, rlsTheme, onClick }) {
1721
1725
  return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
1722
1726
  }
1723
1727
 
1724
- function RlsSkeleton({ rlsTheme }) {
1725
- return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
1726
- }
1727
-
1728
1728
  function RlsSkeletonText({ active, children, rlsTheme }) {
1729
1729
  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 })) }));
1730
1730
  }