@ornikar/kitt-universal 13.2.0 → 13.2.1

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.
@@ -2367,56 +2367,17 @@ function LoaderIcon({
2367
2367
  });
2368
2368
  }
2369
2369
 
2370
- function matchWindowSize({
2371
- width,
2372
- height
2373
- }, {
2374
- minWidth,
2375
- maxWidth,
2376
- minHeight,
2377
- maxHeight
2378
- }) {
2379
- const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
2380
- const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
2381
- return hasWidthMatched && hasHeightMatched;
2382
- }
2383
-
2384
- /**
2385
- * Returns if a size matches based on dimensions passed as options.
2386
- *
2387
- * WARNING: Not SSR friendly.
2388
- */
2389
- function useMatchWindowSize(options) {
2390
- const {
2391
- width,
2392
- height
2393
- } = reactNative.useWindowDimensions();
2394
- return matchWindowSize({
2395
- width,
2396
- height
2397
- }, options);
2398
- }
2399
-
2400
- function getCurrentStretchValue(isStretch, isMedium) {
2401
- // Stretch will follow the value passed from the component occurence if defined
2402
- if (isStretch) return isStretch;
2403
- return !isMedium ? true : undefined;
2404
- }
2405
-
2406
- // eslint-disable-next-line @typescript-eslint/ban-types
2407
-
2408
2370
  function ActionsItem({
2409
2371
  as,
2410
2372
  onPress,
2411
2373
  disabled,
2412
2374
  icon,
2413
- stretch,
2375
+ stretch = {
2376
+ base: true,
2377
+ medium: false
2378
+ },
2414
2379
  ...props
2415
2380
  }) {
2416
- const isMedium = useMatchWindowSize({
2417
- minWidth: KittBreakpoints.MEDIUM
2418
- });
2419
- const isCurrentStretch = getCurrentStretchValue(stretch, isMedium);
2420
2381
  const [isLoading, setIsLoading] = React.useState(false);
2421
2382
  const mountedRef = React.useRef(false);
2422
2383
 
@@ -2430,7 +2391,7 @@ function ActionsItem({
2430
2391
  return /*#__PURE__*/jsxRuntime.jsx(View, {
2431
2392
  children: /*#__PURE__*/jsxRuntime.jsx(as, {
2432
2393
  ...props,
2433
- stretch: isCurrentStretch,
2394
+ stretch: stretch,
2434
2395
  disabled: isLoading ? true : disabled,
2435
2396
  icon: isLoading ? /*#__PURE__*/jsxRuntime.jsx(LoaderIcon, {}) : icon,
2436
2397
  onPress: e => {
@@ -2479,6 +2440,14 @@ function getCurrentDirection(layout) {
2479
2440
  if (layout === 'column') return 'column';
2480
2441
  return 'row';
2481
2442
  }
2443
+ function getCurrentAlignSelf(layout) {
2444
+ if (!layout) return {
2445
+ base: 'stretch',
2446
+ medium: undefined
2447
+ };
2448
+ if (layout === 'column') return 'stretch';
2449
+ return undefined;
2450
+ }
2482
2451
  function Actions({
2483
2452
  children,
2484
2453
  layout,
@@ -2486,8 +2455,10 @@ function Actions({
2486
2455
  }) {
2487
2456
  const currentAlignItems = getCurrentLayout(layout);
2488
2457
  const currentDirection = getCurrentDirection(layout);
2458
+ const currentAlignSelf = getCurrentAlignSelf(layout);
2489
2459
  return /*#__PURE__*/jsxRuntime.jsx(Stack, {
2490
2460
  alignItems: currentAlignItems,
2461
+ alignSelf: currentAlignSelf,
2491
2462
  direction: currentDirection,
2492
2463
  flexGrow: 1,
2493
2464
  ...props,
@@ -9716,6 +9687,36 @@ function StyleWebWrapper({
9716
9687
  });
9717
9688
  }
9718
9689
 
9690
+ function matchWindowSize({
9691
+ width,
9692
+ height
9693
+ }, {
9694
+ minWidth,
9695
+ maxWidth,
9696
+ minHeight,
9697
+ maxHeight
9698
+ }) {
9699
+ const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
9700
+ const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
9701
+ return hasWidthMatched && hasHeightMatched;
9702
+ }
9703
+
9704
+ /**
9705
+ * Returns if a size matches based on dimensions passed as options.
9706
+ *
9707
+ * WARNING: Not SSR friendly.
9708
+ */
9709
+ function useMatchWindowSize(options) {
9710
+ const {
9711
+ width,
9712
+ height
9713
+ } = reactNative.useWindowDimensions();
9714
+ return matchWindowSize({
9715
+ width,
9716
+ height
9717
+ }, options);
9718
+ }
9719
+
9719
9720
  /**
9720
9721
  * Display children if match window size options
9721
9722
  *