@wlloyalty/wll-react-sdk 1.0.107 → 1.0.108

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.
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Skeleton from './index';
3
+ declare const meta: Meta<typeof Skeleton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Skeleton>;
6
+ export declare const Default: Story;
7
+ export declare const FewerTiles: Story;
8
+ export declare const CustomStyle: Story;
package/dist/web.js CHANGED
@@ -19038,22 +19038,22 @@ var Text = function (_a) {
19038
19038
  var accessibilityRole;
19039
19039
  switch (variant) {
19040
19040
  case 'title':
19041
- accessibilityRole = 'header';
19041
+ accessibilityRole = IS_MOBILE ? 'heading' : 'header';
19042
19042
  break;
19043
19043
  case 'caption':
19044
- accessibilityRole = 'text';
19044
+ accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
19045
19045
  break;
19046
19046
  case 'eyebrow':
19047
- accessibilityRole = 'text';
19047
+ accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
19048
19048
  break;
19049
19049
  case 'description':
19050
- accessibilityRole = 'paragraph';
19050
+ accessibilityRole = IS_MOBILE ? 'article' : 'paragraph';
19051
19051
  break;
19052
19052
  case 'label':
19053
- accessibilityRole = 'text';
19053
+ accessibilityRole = IS_MOBILE ? 'option' : 'text';
19054
19054
  break;
19055
19055
  default:
19056
- accessibilityRole = 'text';
19056
+ accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
19057
19057
  }
19058
19058
  var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
19059
19059
  return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
@@ -19680,11 +19680,51 @@ var styles$5 = StyleSheet$1.create({
19680
19680
 
19681
19681
  var GRID_GAP = 16;
19682
19682
 
19683
+ /**
19684
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
19685
+ *
19686
+ * This source code is licensed under the MIT license found in the
19687
+ * LICENSE file in the root directory of this source tree.
19688
+ *
19689
+ * @format
19690
+ *
19691
+ */
19692
+
19693
+ function useWindowDimensions() {
19694
+ var _useState = React.useState(() => Dimensions.get('window')),
19695
+ dims = _useState[0],
19696
+ setDims = _useState[1];
19697
+ React.useEffect(() => {
19698
+ function handleChange(_ref) {
19699
+ var window = _ref.window;
19700
+ if (window != null) {
19701
+ setDims(window);
19702
+ }
19703
+ }
19704
+ Dimensions.addEventListener('change', handleChange);
19705
+ // We might have missed an update between calling `get` in render and
19706
+ // `addEventListener` in this handler, so we set it here. If there was
19707
+ // no change, React will filter out this update as a no-op.
19708
+ setDims(Dimensions.get('window'));
19709
+ return () => {
19710
+ Dimensions.removeEventListener('change', handleChange);
19711
+ };
19712
+ }, []);
19713
+ return dims;
19714
+ }
19715
+
19683
19716
  /* istanbul ignore file */
19684
19717
  var SkeletonTile = function (_a) {
19685
19718
  var style = _a.style;
19686
19719
  var theme = useWllSdk().theme;
19687
19720
  var animatedValue = React__namespace.useRef(new Animated$1.Value(0)).current;
19721
+ var width = useWindowDimensions().width;
19722
+ var tileWidth = 1000 / 4;
19723
+ var tileHeight = tileWidth;
19724
+ if (IS_MOBILE) {
19725
+ tileWidth = width / 2 - theme.sizes.lg * 2;
19726
+ tileHeight = tileWidth;
19727
+ }
19688
19728
  React__namespace.useEffect(function () {
19689
19729
  var pulseAnimation = Animated$1.loop(Animated$1.sequence([Animated$1.timing(animatedValue, {
19690
19730
  toValue: 1,
@@ -19708,15 +19748,16 @@ var SkeletonTile = function (_a) {
19708
19748
  style: [styles$4.container, {
19709
19749
  opacity: opacity,
19710
19750
  backgroundColor: theme.alphaDerivedText[20],
19711
- borderRadius: theme.sizes.borderRadiusLg
19751
+ borderRadius: theme.sizes.borderRadiusLg,
19752
+ width: tileWidth,
19753
+ height: tileHeight
19712
19754
  }, style]
19713
19755
  });
19714
19756
  };
19715
19757
  var styles$4 = StyleSheet$1.create({
19716
19758
  container: {
19717
19759
  aspectRatio: 1,
19718
- overflow: 'hidden',
19719
- width: 1000 / 4
19760
+ overflow: 'hidden'
19720
19761
  }
19721
19762
  });
19722
19763
 
@@ -20556,39 +20597,6 @@ exports.SectionType = void 0;
20556
20597
  SectionType["Banner"] = "BANNER";
20557
20598
  })(exports.SectionType || (exports.SectionType = {}));
20558
20599
 
20559
- /**
20560
- * Copyright (c) Meta Platforms, Inc. and affiliates.
20561
- *
20562
- * This source code is licensed under the MIT license found in the
20563
- * LICENSE file in the root directory of this source tree.
20564
- *
20565
- * @format
20566
- *
20567
- */
20568
-
20569
- function useWindowDimensions() {
20570
- var _useState = React.useState(() => Dimensions.get('window')),
20571
- dims = _useState[0],
20572
- setDims = _useState[1];
20573
- React.useEffect(() => {
20574
- function handleChange(_ref) {
20575
- var window = _ref.window;
20576
- if (window != null) {
20577
- setDims(window);
20578
- }
20579
- }
20580
- Dimensions.addEventListener('change', handleChange);
20581
- // We might have missed an update between calling `get` in render and
20582
- // `addEventListener` in this handler, so we set it here. If there was
20583
- // no change, React will filter out this update as a no-op.
20584
- setDims(Dimensions.get('window'));
20585
- return () => {
20586
- Dimensions.removeEventListener('change', handleChange);
20587
- };
20588
- }, []);
20589
- return dims;
20590
- }
20591
-
20592
20600
  var useSectionHeaderStyles = function () {
20593
20601
  var _a = useResponsive$1(),
20594
20602
  isDesktop = _a.isDesktop,
@@ -21214,7 +21222,7 @@ var Section = function (_a) {
21214
21222
  if (isLoading) {
21215
21223
  return /*#__PURE__*/React.createElement(Skeleton, {
21216
21224
  "aria-label": "Loading section content",
21217
- numberOfSquares: 4
21225
+ numberOfSquares: IS_WEB ? 4 : 2
21218
21226
  });
21219
21227
  }
21220
21228
  if (error || !sectionData) {
@@ -21478,12 +21486,18 @@ var Group = function (_a) {
21478
21486
  groupData = _b.groupData,
21479
21487
  isLoading = _b.isLoading,
21480
21488
  error = _b.error;
21489
+ var theme = useWllSdk().theme;
21481
21490
  if (isLoading) {
21482
21491
  return /*#__PURE__*/React.createElement(View$2, {
21483
- style: commonStyles.emptyContainer,
21492
+ style: {
21493
+ flex: 1,
21494
+ padding: theme.sizes.lg
21495
+ },
21484
21496
  accessible: true,
21485
21497
  accessibilityLabel: "Loading group data"
21486
- }, /*#__PURE__*/React.createElement(Skeleton, null));
21498
+ }, /*#__PURE__*/React.createElement(Skeleton, {
21499
+ numberOfSquares: IS_WEB ? 4 : 2
21500
+ }));
21487
21501
  }
21488
21502
  if (error || !groupData) {
21489
21503
  return /*#__PURE__*/React.createElement(GroupEmptyState, {