@gympass/yoga 7.113.2 → 7.114.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.
@@ -104,7 +104,10 @@ const Button = ({
104
104
  }
105
105
  },
106
106
  border: {
107
- width: borders.small
107
+ width: borders.small,
108
+ color: {
109
+ disabled: colors.elements.backgroundAndDisabled
110
+ }
108
111
  },
109
112
  font: {
110
113
  default: {
@@ -118,6 +121,9 @@ const Button = ({
118
121
  disabled: {
119
122
  color: colors.text.disabled
120
123
  },
124
+ inverted: {
125
+ color: colors.text.primary
126
+ },
121
127
  hover: {
122
128
  color: colors.white
123
129
  },
@@ -35,7 +35,9 @@ var import_Button = __toESM(require("./native/Button"));
35
35
  var import_Text = __toESM(require("./native/Text"));
36
36
  var import_Link = __toESM(require("./native/Link"));
37
37
  var import_Icon = __toESM(require("./native/Icon"));
38
+ var import_Outline = __toESM(require("./native/Outline"));
38
39
  import_Button.default.Text = import_Text.default;
39
40
  import_Button.default.Link = import_Link.default;
40
41
  import_Button.default.Icon = import_Icon.default;
42
+ import_Button.default.Outline = import_Outline.default;
41
43
  var index_native_default = import_Button.default;
@@ -183,6 +183,12 @@ describe("<Button />", () => {
183
183
  );
184
184
  expect(toJSON()).toMatchSnapshot();
185
185
  });
186
+ it("should match snapshot with outline Button", () => {
187
+ const { toJSON } = (0, import_react_native.render)(
188
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { secondary: true }) })
189
+ );
190
+ expect(toJSON()).toMatchSnapshot();
191
+ });
186
192
  it("should match snapshot with default Button with Icon", () => {
187
193
  const { toJSON } = (0, import_react_native.render)(
188
194
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { icon: import_yoga_icons.Booking, secondary: true }) })
@@ -215,6 +221,12 @@ describe("<Button />", () => {
215
221
  );
216
222
  expect(toJSON()).toMatchSnapshot();
217
223
  });
224
+ it("should match snapshot with outline Button", () => {
225
+ const { toJSON } = (0, import_react_native.render)(
226
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { inverted: true, secondary: true }) })
227
+ );
228
+ expect(toJSON()).toMatchSnapshot();
229
+ });
218
230
  it("should match snapshot with default Button with Icon", () => {
219
231
  const { toJSON } = (0, import_react_native.render)(
220
232
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { inverted: true, icon: import_yoga_icons.Booking, secondary: true }) })
@@ -247,6 +259,12 @@ describe("<Button />", () => {
247
259
  );
248
260
  expect(toJSON()).toMatchSnapshot();
249
261
  });
262
+ it("should match snapshot with outline Button", () => {
263
+ const { toJSON } = (0, import_react_native.render)(
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { small: true, secondary: true }) })
265
+ );
266
+ expect(toJSON()).toMatchSnapshot();
267
+ });
250
268
  it("should match snapshot with default Button with Icon", () => {
251
269
  const { toJSON } = (0, import_react_native.render)(
252
270
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { small: true, icon: import_yoga_icons.Booking, secondary: true }) })
@@ -273,6 +291,12 @@ describe("<Button />", () => {
273
291
  );
274
292
  expect(toJSON()).toMatchSnapshot();
275
293
  });
294
+ it("should match snapshot with outline Button", () => {
295
+ const { toJSON } = (0, import_react_native.render)(
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { full: true, secondary: true }) })
297
+ );
298
+ expect(toJSON()).toMatchSnapshot();
299
+ });
276
300
  it("should match snapshot with default Button with Icon", () => {
277
301
  const { toJSON } = (0, import_react_native.render)(
278
302
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { full: true, icon: import_yoga_icons.Booking, secondary: true }) })
@@ -315,6 +339,12 @@ describe("<Button />", () => {
315
339
  );
316
340
  expect(toJSON()).toMatchSnapshot();
317
341
  });
342
+ it("should match snapshot with outline Button", () => {
343
+ const { toJSON } = (0, import_react_native.render)(
344
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { disabled: true }) })
345
+ );
346
+ expect(toJSON()).toMatchSnapshot();
347
+ });
318
348
  it("should match snapshot with default Button with Icon", () => {
319
349
  const { toJSON } = (0, import_react_native.render)(
320
350
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { disabled: true, icon: import_yoga_icons.Booking }) })
@@ -361,6 +391,14 @@ describe("<Button />", () => {
361
391
  import_react_native.fireEvent.press(getByRole("button"));
362
392
  expect(onPressMock).toHaveBeenCalled();
363
393
  });
394
+ it("should call onPress function when press on Button.Outline", () => {
395
+ const onPressMock = jest.fn();
396
+ const { getByRole } = (0, import_react_native.render)(
397
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default.Outline, { onPress: onPressMock }) })
398
+ );
399
+ import_react_native.fireEvent.press(getByRole("button"));
400
+ expect(onPressMock).toHaveBeenCalled();
401
+ });
364
402
  it("should not call onPress function when press on Button disabled", () => {
365
403
  const onPressMock = jest.fn();
366
404
  const { getByText } = (0, import_react_native.render)(
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+ var Outline_exports = {};
59
+ __export(Outline_exports, {
60
+ default: () => Outline_default
61
+ });
62
+ module.exports = __toCommonJS(Outline_exports);
63
+ var import_jsx_runtime = require("react/jsx-runtime");
64
+ var import_react = __toESM(require("react"));
65
+ var import_styled_components = __toESM(require("styled-components"));
66
+ var import_prop_types = require("prop-types");
67
+ var import_yoga_common = require("@gympass/yoga-common");
68
+ var import_withTouchable = __toESM(require("./withTouchable"));
69
+ var import_Button = require("./Button");
70
+ const getInvertedStyles = ({ outline, pressed, white, disabled }) => {
71
+ const newStyles = {};
72
+ if (disabled) {
73
+ newStyles.backgroundColor = white;
74
+ newStyles.borderColor = outline.border.color.disabled;
75
+ }
76
+ if (!disabled && pressed) {
77
+ newStyles.backgroundColor = (0, import_yoga_common.hexToRgb)(white, 0.75);
78
+ newStyles.borderColor = "transparent";
79
+ }
80
+ return __spreadValues({
81
+ backgroundColor: outline.backgroundColor.default,
82
+ borderColor: white,
83
+ borderWidth: outline.border.width
84
+ }, newStyles);
85
+ };
86
+ const getDisabledStyles = ({ outline }) => {
87
+ return {
88
+ backgroundColor: outline.backgroundColor.default,
89
+ borderColor: outline.border.color.disabled,
90
+ borderWidth: outline.border.width
91
+ };
92
+ };
93
+ const getStyles = ({ outline, pressed, secondary }) => {
94
+ const state = secondary ? "secondary" : "primary";
95
+ const newStyles = {};
96
+ if (pressed) {
97
+ newStyles.backgroundColor = outline.font.pressed[state].color;
98
+ newStyles.borderColor = "transparent";
99
+ }
100
+ return __spreadValues({
101
+ backgroundColor: outline.backgroundColor.default,
102
+ borderColor: outline.font.default[state].color,
103
+ borderWidth: outline.border.width
104
+ }, newStyles);
105
+ };
106
+ const LabelText = (0, import_styled_components.default)(import_Button.Label)`
107
+ ${({ color }) => `
108
+ color: ${color};
109
+ text-decoration: none;
110
+ `},
111
+ `;
112
+ const ButtonContainerOutline = (0, import_styled_components.default)(import_Button.ButtonContainer)`
113
+ ${({
114
+ secondary,
115
+ inverted,
116
+ disabled,
117
+ pressed,
118
+ theme: {
119
+ yoga: {
120
+ colors: { white },
121
+ components: {
122
+ button: {
123
+ types: { outline }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }) => {
129
+ if (inverted) {
130
+ return getInvertedStyles({ outline, pressed, white, disabled });
131
+ }
132
+ if (disabled) {
133
+ return getDisabledStyles({ outline });
134
+ }
135
+ return getStyles({ outline, pressed, secondary });
136
+ }}}
137
+ `;
138
+ const ButtonOutline = (0, import_react.forwardRef)(
139
+ (_a, ref) => {
140
+ var _b = _a, {
141
+ children,
142
+ disabled,
143
+ pressed,
144
+ small,
145
+ secondary,
146
+ inverted,
147
+ theme: {
148
+ yoga: {
149
+ colors,
150
+ components: {
151
+ button: {
152
+ types: { outline }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ } = _b, rest = __objRest(_b, [
158
+ "children",
159
+ "disabled",
160
+ "pressed",
161
+ "small",
162
+ "secondary",
163
+ "inverted",
164
+ "theme"
165
+ ]);
166
+ const state = secondary ? "secondary" : "primary";
167
+ let textColor = colors[state];
168
+ if (disabled) {
169
+ textColor = outline.font.disabled.color;
170
+ } else if (inverted) {
171
+ textColor = colors.white;
172
+ if (pressed) {
173
+ textColor = outline.font.inverted.color;
174
+ }
175
+ } else if (pressed) {
176
+ textColor = colors.white;
177
+ }
178
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
179
+ ButtonContainerOutline,
180
+ __spreadProps(__spreadValues({}, rest), {
181
+ disabled,
182
+ pressed,
183
+ small,
184
+ secondary,
185
+ inverted,
186
+ accessible: true,
187
+ accessibilityRole: "button",
188
+ ref,
189
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
190
+ LabelText,
191
+ {
192
+ disabled,
193
+ pressed,
194
+ small,
195
+ secondary,
196
+ color: textColor,
197
+ children
198
+ }
199
+ )
200
+ })
201
+ );
202
+ }
203
+ );
204
+ ButtonOutline.propTypes = {
205
+ children: import_prop_types.node,
206
+ full: import_prop_types.bool,
207
+ disabled: import_prop_types.bool,
208
+ small: import_prop_types.bool,
209
+ pressed: import_prop_types.bool,
210
+ inverted: import_prop_types.bool,
211
+ secondary: import_prop_types.bool
212
+ };
213
+ ButtonOutline.defaultProps = {
214
+ children: "Button",
215
+ full: false,
216
+ disabled: false,
217
+ small: false,
218
+ pressed: false,
219
+ inverted: false,
220
+ secondary: false
221
+ };
222
+ var Outline_default = (0, import_withTouchable.default)((0, import_styled_components.withTheme)(ButtonOutline));
@@ -65,10 +65,20 @@ const Day = (0, import_styled_components.default)(import__.Text.Overline)`
65
65
  }
66
66
  }) => `
67
67
  width: 40px;
68
- color: ${colors.medium};
68
+ color: ${colors.elements.selectionAndIcons};
69
69
  text-align: center;
70
70
  `}
71
71
  `;
72
+ const Month = (0, import_styled_components.default)(import__.Text.Body2)`
73
+ ${({
74
+ theme: {
75
+ yoga: { colors, v3theme }
76
+ }
77
+ }) => `
78
+ color: ${v3theme ? colors.primary : colors.text.primary};
79
+ align-self: center;
80
+ `}
81
+ `;
72
82
  const getDayFieldColor = (selected, disabled, colors, aux) => {
73
83
  if (selected && !disabled) {
74
84
  return colors.white;
@@ -132,14 +142,14 @@ const DayField = import_styled_components.default.div`
132
142
  display: flex;
133
143
  align-items: center;
134
144
  justify-content: center;
135
- background: ${inRange ? colors.clear : colors.white};
145
+ background: ${inRange ? colors.elements.lineAndBorders : colors.white};
136
146
  position: relative;
137
147
  cursor: pointer;
138
148
  ${selected && inRange ? `border-radius: ${getDayFieldRadius(aux, radii)};` : ``}
139
149
  ${selected && !disabled ? `&:before {
140
150
  content: '';
141
151
  position: absolute;
142
- background: ${colors.vibin};
152
+ background: ${colors.primary};
143
153
  width: ${datepicker.width.day}px;
144
154
  height: ${datepicker.width.day}px;
145
155
  border-radius: ${radii.circle}px;
@@ -346,7 +356,7 @@ function Calendar({
346
356
  "data-testid": "previous-month-arrow"
347
357
  }
348
358
  ),
349
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.Text.Body2, { style: { alignSelf: "center" }, bold: true, children: new Intl.DateTimeFormat("en-US", {
359
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Month, { bold: true, children: new Intl.DateTimeFormat("en-US", {
350
360
  month: "long",
351
361
  year: "numeric"
352
362
  }).format(new Date(year, month, 1, 0, 0, 0)) }),
@@ -81,7 +81,10 @@ const Button = ({
81
81
  }
82
82
  },
83
83
  border: {
84
- width: borders.small
84
+ width: borders.small,
85
+ color: {
86
+ disabled: colors.elements.backgroundAndDisabled
87
+ }
85
88
  },
86
89
  font: {
87
90
  default: {
@@ -95,6 +98,9 @@ const Button = ({
95
98
  disabled: {
96
99
  color: colors.text.disabled
97
100
  },
101
+ inverted: {
102
+ color: colors.text.primary
103
+ },
98
104
  hover: {
99
105
  color: colors.white
100
106
  },
@@ -2,9 +2,11 @@ import Button from "./native/Button";
2
2
  import ButtonText from "./native/Text";
3
3
  import ButtonLink from "./native/Link";
4
4
  import ButtonIcon from "./native/Icon";
5
+ import ButtonOutline from "./native/Outline";
5
6
  Button.Text = ButtonText;
6
7
  Button.Link = ButtonLink;
7
8
  Button.Icon = ButtonIcon;
9
+ Button.Outline = ButtonOutline;
8
10
  var index_native_default = Button;
9
11
  export {
10
12
  index_native_default as default
@@ -160,6 +160,12 @@ describe("<Button />", () => {
160
160
  );
161
161
  expect(toJSON()).toMatchSnapshot();
162
162
  });
163
+ it("should match snapshot with outline Button", () => {
164
+ const { toJSON } = render(
165
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { secondary: true }) })
166
+ );
167
+ expect(toJSON()).toMatchSnapshot();
168
+ });
163
169
  it("should match snapshot with default Button with Icon", () => {
164
170
  const { toJSON } = render(
165
171
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button, { icon: Booking, secondary: true }) })
@@ -192,6 +198,12 @@ describe("<Button />", () => {
192
198
  );
193
199
  expect(toJSON()).toMatchSnapshot();
194
200
  });
201
+ it("should match snapshot with outline Button", () => {
202
+ const { toJSON } = render(
203
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { inverted: true, secondary: true }) })
204
+ );
205
+ expect(toJSON()).toMatchSnapshot();
206
+ });
195
207
  it("should match snapshot with default Button with Icon", () => {
196
208
  const { toJSON } = render(
197
209
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button, { inverted: true, icon: Booking, secondary: true }) })
@@ -224,6 +236,12 @@ describe("<Button />", () => {
224
236
  );
225
237
  expect(toJSON()).toMatchSnapshot();
226
238
  });
239
+ it("should match snapshot with outline Button", () => {
240
+ const { toJSON } = render(
241
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { small: true, secondary: true }) })
242
+ );
243
+ expect(toJSON()).toMatchSnapshot();
244
+ });
227
245
  it("should match snapshot with default Button with Icon", () => {
228
246
  const { toJSON } = render(
229
247
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button, { small: true, icon: Booking, secondary: true }) })
@@ -250,6 +268,12 @@ describe("<Button />", () => {
250
268
  );
251
269
  expect(toJSON()).toMatchSnapshot();
252
270
  });
271
+ it("should match snapshot with outline Button", () => {
272
+ const { toJSON } = render(
273
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { full: true, secondary: true }) })
274
+ );
275
+ expect(toJSON()).toMatchSnapshot();
276
+ });
253
277
  it("should match snapshot with default Button with Icon", () => {
254
278
  const { toJSON } = render(
255
279
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button, { full: true, icon: Booking, secondary: true }) })
@@ -292,6 +316,12 @@ describe("<Button />", () => {
292
316
  );
293
317
  expect(toJSON()).toMatchSnapshot();
294
318
  });
319
+ it("should match snapshot with outline Button", () => {
320
+ const { toJSON } = render(
321
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { disabled: true }) })
322
+ );
323
+ expect(toJSON()).toMatchSnapshot();
324
+ });
295
325
  it("should match snapshot with default Button with Icon", () => {
296
326
  const { toJSON } = render(
297
327
  /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button, { disabled: true, icon: Booking }) })
@@ -338,6 +368,14 @@ describe("<Button />", () => {
338
368
  fireEvent.press(getByRole("button"));
339
369
  expect(onPressMock).toHaveBeenCalled();
340
370
  });
371
+ it("should call onPress function when press on Button.Outline", () => {
372
+ const onPressMock = jest.fn();
373
+ const { getByRole } = render(
374
+ /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Button.Outline, { onPress: onPressMock }) })
375
+ );
376
+ fireEvent.press(getByRole("button"));
377
+ expect(onPressMock).toHaveBeenCalled();
378
+ });
341
379
  it("should not call onPress function when press on Button disabled", () => {
342
380
  const onPressMock = jest.fn();
343
381
  const { getByText } = render(
@@ -0,0 +1,194 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { jsx } from "react/jsx-runtime";
33
+ import React, { forwardRef } from "react";
34
+ import styled, { withTheme } from "styled-components";
35
+ import { bool, node } from "prop-types";
36
+ import { hexToRgb } from "@gympass/yoga-common";
37
+ import withTouchable from "./withTouchable";
38
+ import { Label, ButtonContainer } from "./Button";
39
+ const getInvertedStyles = ({ outline, pressed, white, disabled }) => {
40
+ const newStyles = {};
41
+ if (disabled) {
42
+ newStyles.backgroundColor = white;
43
+ newStyles.borderColor = outline.border.color.disabled;
44
+ }
45
+ if (!disabled && pressed) {
46
+ newStyles.backgroundColor = hexToRgb(white, 0.75);
47
+ newStyles.borderColor = "transparent";
48
+ }
49
+ return __spreadValues({
50
+ backgroundColor: outline.backgroundColor.default,
51
+ borderColor: white,
52
+ borderWidth: outline.border.width
53
+ }, newStyles);
54
+ };
55
+ const getDisabledStyles = ({ outline }) => {
56
+ return {
57
+ backgroundColor: outline.backgroundColor.default,
58
+ borderColor: outline.border.color.disabled,
59
+ borderWidth: outline.border.width
60
+ };
61
+ };
62
+ const getStyles = ({ outline, pressed, secondary }) => {
63
+ const state = secondary ? "secondary" : "primary";
64
+ const newStyles = {};
65
+ if (pressed) {
66
+ newStyles.backgroundColor = outline.font.pressed[state].color;
67
+ newStyles.borderColor = "transparent";
68
+ }
69
+ return __spreadValues({
70
+ backgroundColor: outline.backgroundColor.default,
71
+ borderColor: outline.font.default[state].color,
72
+ borderWidth: outline.border.width
73
+ }, newStyles);
74
+ };
75
+ const LabelText = styled(Label)`
76
+ ${({ color }) => `
77
+ color: ${color};
78
+ text-decoration: none;
79
+ `},
80
+ `;
81
+ const ButtonContainerOutline = styled(ButtonContainer)`
82
+ ${({
83
+ secondary,
84
+ inverted,
85
+ disabled,
86
+ pressed,
87
+ theme: {
88
+ yoga: {
89
+ colors: { white },
90
+ components: {
91
+ button: {
92
+ types: { outline }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }) => {
98
+ if (inverted) {
99
+ return getInvertedStyles({ outline, pressed, white, disabled });
100
+ }
101
+ if (disabled) {
102
+ return getDisabledStyles({ outline });
103
+ }
104
+ return getStyles({ outline, pressed, secondary });
105
+ }}}
106
+ `;
107
+ const ButtonOutline = forwardRef(
108
+ (_a, ref) => {
109
+ var _b = _a, {
110
+ children,
111
+ disabled,
112
+ pressed,
113
+ small,
114
+ secondary,
115
+ inverted,
116
+ theme: {
117
+ yoga: {
118
+ colors,
119
+ components: {
120
+ button: {
121
+ types: { outline }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ } = _b, rest = __objRest(_b, [
127
+ "children",
128
+ "disabled",
129
+ "pressed",
130
+ "small",
131
+ "secondary",
132
+ "inverted",
133
+ "theme"
134
+ ]);
135
+ const state = secondary ? "secondary" : "primary";
136
+ let textColor = colors[state];
137
+ if (disabled) {
138
+ textColor = outline.font.disabled.color;
139
+ } else if (inverted) {
140
+ textColor = colors.white;
141
+ if (pressed) {
142
+ textColor = outline.font.inverted.color;
143
+ }
144
+ } else if (pressed) {
145
+ textColor = colors.white;
146
+ }
147
+ return /* @__PURE__ */ jsx(
148
+ ButtonContainerOutline,
149
+ __spreadProps(__spreadValues({}, rest), {
150
+ disabled,
151
+ pressed,
152
+ small,
153
+ secondary,
154
+ inverted,
155
+ accessible: true,
156
+ accessibilityRole: "button",
157
+ ref,
158
+ children: /* @__PURE__ */ jsx(
159
+ LabelText,
160
+ {
161
+ disabled,
162
+ pressed,
163
+ small,
164
+ secondary,
165
+ color: textColor,
166
+ children
167
+ }
168
+ )
169
+ })
170
+ );
171
+ }
172
+ );
173
+ ButtonOutline.propTypes = {
174
+ children: node,
175
+ full: bool,
176
+ disabled: bool,
177
+ small: bool,
178
+ pressed: bool,
179
+ inverted: bool,
180
+ secondary: bool
181
+ };
182
+ ButtonOutline.defaultProps = {
183
+ children: "Button",
184
+ full: false,
185
+ disabled: false,
186
+ small: false,
187
+ pressed: false,
188
+ inverted: false,
189
+ secondary: false
190
+ };
191
+ var Outline_default = withTouchable(withTheme(ButtonOutline));
192
+ export {
193
+ Outline_default as default
194
+ };
@@ -32,10 +32,20 @@ const Day = styled(Text.Overline)`
32
32
  }
33
33
  }) => `
34
34
  width: 40px;
35
- color: ${colors.medium};
35
+ color: ${colors.elements.selectionAndIcons};
36
36
  text-align: center;
37
37
  `}
38
38
  `;
39
+ const Month = styled(Text.Body2)`
40
+ ${({
41
+ theme: {
42
+ yoga: { colors, v3theme }
43
+ }
44
+ }) => `
45
+ color: ${v3theme ? colors.primary : colors.text.primary};
46
+ align-self: center;
47
+ `}
48
+ `;
39
49
  const getDayFieldColor = (selected, disabled, colors, aux) => {
40
50
  if (selected && !disabled) {
41
51
  return colors.white;
@@ -99,14 +109,14 @@ const DayField = styled.div`
99
109
  display: flex;
100
110
  align-items: center;
101
111
  justify-content: center;
102
- background: ${inRange ? colors.clear : colors.white};
112
+ background: ${inRange ? colors.elements.lineAndBorders : colors.white};
103
113
  position: relative;
104
114
  cursor: pointer;
105
115
  ${selected && inRange ? `border-radius: ${getDayFieldRadius(aux, radii)};` : ``}
106
116
  ${selected && !disabled ? `&:before {
107
117
  content: '';
108
118
  position: absolute;
109
- background: ${colors.vibin};
119
+ background: ${colors.primary};
110
120
  width: ${datepicker.width.day}px;
111
121
  height: ${datepicker.width.day}px;
112
122
  border-radius: ${radii.circle}px;
@@ -313,7 +323,7 @@ function Calendar({
313
323
  "data-testid": "previous-month-arrow"
314
324
  }
315
325
  ),
316
- /* @__PURE__ */ jsx(Text.Body2, { style: { alignSelf: "center" }, bold: true, children: new Intl.DateTimeFormat("en-US", {
326
+ /* @__PURE__ */ jsx(Month, { bold: true, children: new Intl.DateTimeFormat("en-US", {
317
327
  month: "long",
318
328
  year: "numeric"
319
329
  }).format(new Date(year, month, 1, 0, 0, 0)) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gympass/yoga",
3
- "version": "7.113.2",
3
+ "version": "7.114.1",
4
4
  "description": "Gympass component library",
5
5
  "main": "./cjs",
6
6
  "types": "./typings/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "react-native": "0.72.3",
58
58
  "styled-components": "^4.4.0"
59
59
  },
60
- "gitHead": "66091324d6eaf72a82b372186981b081d009f51d",
60
+ "gitHead": "5a987a21d7e3b87e6da4aaac9930dfde1155134a",
61
61
  "module": "./esm",
62
62
  "private": false,
63
63
  "react-native": "./cjs/index.native.js"
@@ -10,46 +10,46 @@ declare const v3theme: {
10
10
  length: number;
11
11
  toString(): string;
12
12
  toLocaleString(): string;
13
- pop(): 0 | 2 | 1 | undefined;
14
- push(...items: (0 | 2 | 1)[]): number;
15
- concat(...items: ConcatArray<0 | 2 | 1>[]): (0 | 2 | 1)[];
16
- concat(...items: (0 | 2 | 1 | ConcatArray<0 | 2 | 1>)[]): (0 | 2 | 1)[];
13
+ pop(): 0 | 1 | 2 | undefined;
14
+ push(...items: (0 | 1 | 2)[]): number;
15
+ concat(...items: ConcatArray<0 | 1 | 2>[]): (0 | 1 | 2)[];
16
+ concat(...items: (0 | 1 | 2 | ConcatArray<0 | 1 | 2>)[]): (0 | 1 | 2)[];
17
17
  join(separator?: string | undefined): string;
18
- reverse(): (0 | 2 | 1)[];
19
- shift(): 0 | 2 | 1 | undefined;
20
- slice(start?: number | undefined, end?: number | undefined): (0 | 2 | 1)[];
21
- sort(compareFn?: ((a: 0 | 2 | 1, b: 0 | 2 | 1) => number) | undefined): (0 | 2 | 1)[];
22
- splice(start: number, deleteCount?: number | undefined): (0 | 2 | 1)[];
23
- splice(start: number, deleteCount: number, ...items: (0 | 2 | 1)[]): (0 | 2 | 1)[];
24
- unshift(...items: (0 | 2 | 1)[]): number;
25
- indexOf(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): number;
26
- lastIndexOf(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): number;
27
- every<S extends 0 | 2 | 1>(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => value is S, thisArg?: any): this is S[];
28
- every(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): boolean;
29
- some(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): boolean;
30
- forEach(callbackfn: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => void, thisArg?: any): void;
31
- map<U>(callbackfn: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => U, thisArg?: any): U[];
32
- filter<S_1 extends 0 | 2 | 1>(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => value is S_1, thisArg?: any): S_1[];
33
- filter(predicate: (value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => unknown, thisArg?: any): (0 | 2 | 1)[];
34
- reduce(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1): 0 | 2 | 1;
35
- reduce(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1, initialValue: 0 | 2 | 1): 0 | 2 | 1;
36
- reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => U_1, initialValue: U_1): U_1;
37
- reduceRight(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1): 0 | 2 | 1;
38
- reduceRight(callbackfn: (previousValue: 0 | 2 | 1, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => 0 | 2 | 1, initialValue: 0 | 2 | 1): 0 | 2 | 1;
39
- reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: 0 | 2 | 1, currentIndex: number, array: (0 | 2 | 1)[]) => U_2, initialValue: U_2): U_2;
40
- find<S_2 extends 0 | 2 | 1>(predicate: (this: void, value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => value is S_2, thisArg?: any): S_2 | undefined;
41
- find(predicate: (value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => unknown, thisArg?: any): 0 | 2 | 1 | undefined;
42
- findIndex(predicate: (value: 0 | 2 | 1, index: number, obj: (0 | 2 | 1)[]) => unknown, thisArg?: any): number;
43
- fill(value: 0 | 2 | 1, start?: number | undefined, end?: number | undefined): (0 | 2 | 1)[];
44
- copyWithin(target: number, start: number, end?: number | undefined): (0 | 2 | 1)[];
45
- entries(): IterableIterator<[number, 0 | 2 | 1]>;
18
+ reverse(): (0 | 1 | 2)[];
19
+ shift(): 0 | 1 | 2 | undefined;
20
+ slice(start?: number | undefined, end?: number | undefined): (0 | 1 | 2)[];
21
+ sort(compareFn?: ((a: 0 | 1 | 2, b: 0 | 1 | 2) => number) | undefined): (0 | 1 | 2)[];
22
+ splice(start: number, deleteCount?: number | undefined): (0 | 1 | 2)[];
23
+ splice(start: number, deleteCount: number, ...items: (0 | 1 | 2)[]): (0 | 1 | 2)[];
24
+ unshift(...items: (0 | 1 | 2)[]): number;
25
+ indexOf(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): number;
26
+ lastIndexOf(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): number;
27
+ every<S extends 0 | 1 | 2>(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => value is S, thisArg?: any): this is S[];
28
+ every(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): boolean;
29
+ some(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): boolean;
30
+ forEach(callbackfn: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => void, thisArg?: any): void;
31
+ map<U>(callbackfn: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => U, thisArg?: any): U[];
32
+ filter<S_1 extends 0 | 1 | 2>(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => value is S_1, thisArg?: any): S_1[];
33
+ filter(predicate: (value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => unknown, thisArg?: any): (0 | 1 | 2)[];
34
+ reduce(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2): 0 | 1 | 2;
35
+ reduce(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2, initialValue: 0 | 1 | 2): 0 | 1 | 2;
36
+ reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => U_1, initialValue: U_1): U_1;
37
+ reduceRight(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2): 0 | 1 | 2;
38
+ reduceRight(callbackfn: (previousValue: 0 | 1 | 2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => 0 | 1 | 2, initialValue: 0 | 1 | 2): 0 | 1 | 2;
39
+ reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: 0 | 1 | 2, currentIndex: number, array: (0 | 1 | 2)[]) => U_2, initialValue: U_2): U_2;
40
+ find<S_2 extends 0 | 1 | 2>(predicate: (this: void, value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => value is S_2, thisArg?: any): S_2 | undefined;
41
+ find(predicate: (value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => unknown, thisArg?: any): 0 | 1 | 2 | undefined;
42
+ findIndex(predicate: (value: 0 | 1 | 2, index: number, obj: (0 | 1 | 2)[]) => unknown, thisArg?: any): number;
43
+ fill(value: 0 | 1 | 2, start?: number | undefined, end?: number | undefined): (0 | 1 | 2)[];
44
+ copyWithin(target: number, start: number, end?: number | undefined): (0 | 1 | 2)[];
45
+ entries(): IterableIterator<[number, 0 | 1 | 2]>;
46
46
  keys(): IterableIterator<number>;
47
- values(): IterableIterator<0 | 2 | 1>;
48
- includes(searchElement: 0 | 2 | 1, fromIndex?: number | undefined): boolean;
49
- flatMap<U_3, This = undefined>(callback: (this: This, value: 0 | 2 | 1, index: number, array: (0 | 2 | 1)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
47
+ values(): IterableIterator<0 | 1 | 2>;
48
+ includes(searchElement: 0 | 1 | 2, fromIndex?: number | undefined): boolean;
49
+ flatMap<U_3, This = undefined>(callback: (this: This, value: 0 | 1 | 2, index: number, array: (0 | 1 | 2)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
50
50
  flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
51
- at(index: number): 0 | 2 | 1 | undefined;
52
- [Symbol.iterator](): IterableIterator<0 | 2 | 1>;
51
+ at(index: number): 0 | 1 | 2 | undefined;
52
+ [Symbol.iterator](): IterableIterator<0 | 1 | 2>;
53
53
  [Symbol.unscopables](): {
54
54
  copyWithin: boolean;
55
55
  entries: boolean;