@gympass/yoga 7.89.0 → 7.90.0

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.
@@ -100,8 +100,8 @@ const Menu = ({ avatar: Avatar, subtitle, title, onClick }) => {
100
100
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledMenu, { hasAction, onClick, children: [
101
101
  Avatar,
102
102
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledTextContainer, { children: [
103
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledText, { children: title || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Skeleton, { type: "text", variant: "body2", width: "100%" }) }),
104
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Text.Small, { color: "deep", children: subtitle })
103
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledText, { children: title }),
104
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Text.Small, { color: "deep", children: subtitle })
105
105
  ] }),
106
106
  hasAction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.default, { as: import_yoga_icons.ArrowRight, size: "large", fill: "vibin" })
107
107
  ] });
@@ -88,6 +88,7 @@ const Switcher = ({
88
88
  actions,
89
89
  avatar: Avatar,
90
90
  fill = "transparent",
91
+ isLoading = false,
91
92
  sideOffset = 36,
92
93
  subtitle,
93
94
  title
@@ -95,10 +96,21 @@ const Switcher = ({
95
96
  const hasActions = actions == null ? void 0 : actions.length;
96
97
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledSwitcher, { fill, children: [
97
98
  Avatar,
98
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledTextContainer, { children: [
99
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTitle, { children: title || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Skeleton, { type: "text", variant: "body2", width: "100%" }) }),
100
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Text.Tiny, { color: "deep", children: subtitle })
101
- ] }),
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTextContainer, { children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ import_yoga.Skeleton,
102
+ {
103
+ type: "text",
104
+ variant: "overline",
105
+ width: "100%",
106
+ marginBottom: "4px"
107
+ }
108
+ ),
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Skeleton, { type: "text", variant: "overline", width: "100%" })
110
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
111
+ title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledTitle, { children: title }),
112
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_yoga.Text.Tiny, { color: "deep", children: subtitle })
113
+ ] }) }),
102
114
  hasActions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Actions.default, { actions, sideOffset })
103
115
  ] });
104
116
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import styled, { css } from "styled-components";
3
3
  import { ArrowRight } from "@gympass/yoga-icons";
4
- import { Text, Skeleton } from "@gympass/yoga";
4
+ import { Text } from "@gympass/yoga";
5
5
  import Box from "../../../Box";
6
6
  import Icon from "../../../Icon";
7
7
  const StyledMenu = styled(Box)`
@@ -67,8 +67,8 @@ const Menu = ({ avatar: Avatar, subtitle, title, onClick }) => {
67
67
  return /* @__PURE__ */ jsxs(StyledMenu, { hasAction, onClick, children: [
68
68
  Avatar,
69
69
  /* @__PURE__ */ jsxs(StyledTextContainer, { children: [
70
- /* @__PURE__ */ jsx(StyledText, { children: title || /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body2", width: "100%" }) }),
71
- /* @__PURE__ */ jsx(Text.Small, { color: "deep", children: subtitle })
70
+ title && /* @__PURE__ */ jsx(StyledText, { children: title }),
71
+ subtitle && /* @__PURE__ */ jsx(Text.Small, { color: "deep", children: subtitle })
72
72
  ] }),
73
73
  hasAction && /* @__PURE__ */ jsx(Icon, { as: ArrowRight, size: "large", fill: "vibin" })
74
74
  ] });
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import styled, { css } from "styled-components";
3
3
  import { Text, Skeleton } from "@gympass/yoga";
4
4
  import Actions from "./Actions";
@@ -55,6 +55,7 @@ const Switcher = ({
55
55
  actions,
56
56
  avatar: Avatar,
57
57
  fill = "transparent",
58
+ isLoading = false,
58
59
  sideOffset = 36,
59
60
  subtitle,
60
61
  title
@@ -62,10 +63,21 @@ const Switcher = ({
62
63
  const hasActions = actions == null ? void 0 : actions.length;
63
64
  return /* @__PURE__ */ jsxs(StyledSwitcher, { fill, children: [
64
65
  Avatar,
65
- /* @__PURE__ */ jsxs(StyledTextContainer, { children: [
66
- /* @__PURE__ */ jsx(StyledTitle, { children: title || /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "body2", width: "100%" }) }),
67
- /* @__PURE__ */ jsx(Text.Tiny, { color: "deep", children: subtitle })
68
- ] }),
66
+ /* @__PURE__ */ jsx(StyledTextContainer, { children: isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
67
+ /* @__PURE__ */ jsx(
68
+ Skeleton,
69
+ {
70
+ type: "text",
71
+ variant: "overline",
72
+ width: "100%",
73
+ marginBottom: "4px"
74
+ }
75
+ ),
76
+ /* @__PURE__ */ jsx(Skeleton, { type: "text", variant: "overline", width: "100%" })
77
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
78
+ title && /* @__PURE__ */ jsx(StyledTitle, { children: title }),
79
+ subtitle && /* @__PURE__ */ jsx(Text.Tiny, { color: "deep", children: subtitle })
80
+ ] }) }),
69
81
  hasActions && /* @__PURE__ */ jsx(Actions, { actions, sideOffset })
70
82
  ] });
71
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.89.0",
3
+ "version": "7.90.0",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "react-native": "0.72.3",
57
57
  "styled-components": "^4.4.0"
58
58
  },
59
- "gitHead": "0f1e1dc67d7dbe17045b0fb018460cf623735b6e",
59
+ "gitHead": "dd4ef572d0fdc61fbc0902e5e24101986ca18e8f",
60
60
  "module": "./esm",
61
61
  "private": false,
62
62
  "react-native": "./cjs/index.native.js"
@@ -1,5 +1,5 @@
1
- import { N as NavigationMenu } from '../NavigationMenu-7f690c1e.js';
2
- import '../Switcher-cab05b9f.js';
1
+ import { N as NavigationMenu } from '../NavigationMenu-373d8980.js';
2
+ import '../Switcher-a8dff781.js';
3
3
  import 'react';
4
4
 
5
5
 
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  declare type MenuProps = {
4
4
  avatar: React.ReactElement;
5
5
  subtitle?: string;
6
- title: string;
6
+ title?: string;
7
7
  onClick?: () => void;
8
8
  };
9
9
  declare const Menu: ({ avatar: Avatar, subtitle, title, onClick }: MenuProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { a as Switcher } from '../../../Switcher-cab05b9f.js';
1
+ import { a as Switcher } from '../../../Switcher-a8dff781.js';
2
2
  import 'react';
3
3
 
4
4
 
@@ -1,5 +1,5 @@
1
- import { N as NavigationMenu } from '../../NavigationMenu-7f690c1e.js';
2
- import '../../Switcher-cab05b9f.js';
1
+ import { N as NavigationMenu } from '../../NavigationMenu-373d8980.js';
2
+ import '../../Switcher-a8dff781.js';
3
3
  import 'react';
4
4
 
5
5
 
@@ -1,4 +1,4 @@
1
- import { S as SwitcherActionsProps } from './Switcher-cab05b9f.js';
1
+ import { S as SwitcherActionsProps } from './Switcher-a8dff781.js';
2
2
  import React from 'react';
3
3
 
4
4
  declare type NavigationMenuProps = {
@@ -12,16 +12,17 @@ declare const NavigationMenu: {
12
12
  Menu: ({ avatar: Avatar, subtitle, title, onClick }: {
13
13
  avatar: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
14
14
  subtitle?: string | undefined;
15
- title: string;
15
+ title?: string | undefined;
16
16
  onClick?: (() => void) | undefined;
17
17
  }) => JSX.Element;
18
- Switcher: ({ actions, avatar: Avatar, fill, sideOffset, subtitle, title, }: {
18
+ Switcher: ({ actions, avatar: Avatar, fill, isLoading, sideOffset, subtitle, title, }: {
19
19
  actions?: SwitcherActionsProps[] | undefined;
20
20
  avatar: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
21
21
  fill?: string | undefined;
22
+ isLoading?: boolean | undefined;
22
23
  sideOffset?: number | undefined;
23
24
  subtitle?: string | undefined;
24
- title: string;
25
+ title?: string | undefined;
25
26
  }) => JSX.Element;
26
27
  Items: any;
27
28
  ItemsGroup: any;
@@ -9,10 +9,11 @@ declare type SwitcherProps = {
9
9
  actions?: SwitcherActionsProps[];
10
10
  avatar: React.ReactElement;
11
11
  fill?: string;
12
+ isLoading?: boolean;
12
13
  sideOffset?: number;
13
14
  subtitle?: string;
14
- title: string;
15
+ title?: string;
15
16
  };
16
- declare const Switcher: ({ actions, avatar: Avatar, fill, sideOffset, subtitle, title, }: SwitcherProps) => JSX.Element;
17
+ declare const Switcher: ({ actions, avatar: Avatar, fill, isLoading, sideOffset, subtitle, title, }: SwitcherProps) => JSX.Element;
17
18
 
18
19
  export { SwitcherActionsProps as S, Switcher as a };
@@ -2,8 +2,8 @@ import * as prop_types from 'prop-types';
2
2
  import prop_types__default, { string, bool, func, node, number, elementType } from 'prop-types';
3
3
  import React from 'react';
4
4
  export { _ as Icon } from './Icon-4557ae6b.js';
5
- export { N as NavigationMenu } from './NavigationMenu-7f690c1e.js';
6
- import './Switcher-cab05b9f.js';
5
+ export { N as NavigationMenu } from './NavigationMenu-373d8980.js';
6
+ import './Switcher-a8dff781.js';
7
7
 
8
8
  /** This component provides a theme to all React components underneath itself via the context API. */
9
9
  declare function ThemeProvider({ children, ...rest }: {