@tecsinapse/react-web-kit 3.4.3 → 3.4.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.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 TecSinapse
3
+ Copyright (c) 2024 TecSinapse
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -4,8 +4,7 @@
4
4
 
5
5
  [![Stars](https://img.shields.io/github/stars/tecsinapse/design-system?style=social)](https://github.com/tecsinapse/design-system/) [![License](https://img.shields.io/github/license/tecsinapse/design-system)](./LICENSE.md) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)![build workflow](https://github.com/tecsinapse/design-system/actions/workflows/ci.yml/badge.svg)
6
6
 
7
-
8
- [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
7
+ [TecSinapse Design System](https://tecsinapse.github.io/design-system) is the hybrid implementation of the [TecSinapse](https://www.tecsinapse.com.br/) Design System.
9
8
  Our primary goal is to create a system that can be used to build a wide variety of TecSinapase websites and apps, while providing a consistent and inclusive user experience to our end users.
10
9
  In addition, the design system and component library should be easy to use for developers and designers.
11
10
 
@@ -24,11 +23,12 @@ Here are a few helpful links for getting started:
24
23
  ## Packages
25
24
 
26
25
  | Package | Content | Version |
27
- |-----------------------------------------------------------------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
26
+ | --------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
28
27
  | **[@tecsinapse/react-core](./packages/react-core)** | the core hybrid React component library | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-core) |
29
28
  | **[@tecsinapse/react-web-kit](./packages/react-web-kit)** | the React component library focused on web | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-web-kit) |
30
29
  | **[@tecsinapse/react-native-kit](./packages/react-native-kit)** | the React native component library focused on mobile | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-native-kit) |
31
30
  | **[@tecsinapse/react-charts](./packages/react-charts)** | Charts for React based on SVG | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Freact-charts.svg)](https://badge.fury.io/js/%40tecsinapse%2Freact-charts) |
31
+ | **[@tecsinapse/cortex-core](./packages/cortex-core)** | The core library for tailwindcss based design | [![npm version](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core.svg)](https://badge.fury.io/js/%40tecsinapse%2Fcortex-core) |
32
32
 
33
33
  ## Code of conduct
34
34
 
@@ -41,27 +41,29 @@ If you feel another member of the community violated our code or you are experie
41
41
  At times, it may be necessary to test changes directly in a product, and not in the design system, and for this to work in a less laborious way, we can follow the steps below:
42
42
 
43
43
  3 terminal tabs should open:
44
+
44
45
  - In one run the JS code watch:
46
+
45
47
  ```
46
48
  yarn build:watch
47
49
  ```
50
+
48
51
  - In another run the watch of the TS code watch
52
+
49
53
  ```
50
54
  yarn build:declarations:watch
51
55
  ```
56
+
52
57
  - On another run yalc push (this script updates linked local projects)
58
+
53
59
  ```
54
60
  yarn yalc:push
55
61
  ```
56
62
 
57
63
  With that, all changes will be in yalc locally.
58
64
 
59
- To access in your application, see this [example](https://github.com/tecsinapse/vendas-web-poc-playground#tools) in topic "**Yalc link Design System:**"
60
-
61
-
62
65
  ### Maintainers
63
66
 
64
- - [Beatriz Silva](mailto:beatriz.silva@tecsinapse.com.br)
65
67
  - [Denner Vidal](mailto:denner.vidal@tecsinapse.com.br)
66
68
  - [Gabriel Sanches](mailto:gabriel.sanches@tecsinapse.com.br)
67
69
  - [Lucas Ramos](mailto:lucas.ramos@tecsinapse.com.br)
@@ -18,8 +18,7 @@ const Switch = ({
18
18
  const theme = reactCore.useTheme();
19
19
  const transitionRef = React.useRef(null);
20
20
  const handleChange = React.useCallback(() => {
21
- if (!disabled)
22
- onChange(!active);
21
+ if (!disabled) onChange(!active);
23
22
  }, [active, onChange]);
24
23
  const defaultStyleBackground = {
25
24
  transition: `all 300ms ease`
@@ -1,14 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const getSpan = (value, sm, md, lg) => {
4
- if (!value)
5
- return 0;
6
- if (sm)
7
- return value.sm;
8
- if (md)
9
- return value?.md ?? value.sm;
10
- if (lg)
11
- return value?.lg ?? value?.md ?? value.sm;
4
+ if (!value) return 0;
5
+ if (sm) return value.sm;
6
+ if (md) return value?.md ?? value.sm;
7
+ if (lg) return value?.lg ?? value?.md ?? value.sm;
12
8
  return 0;
13
9
  };
14
10
 
@@ -35,8 +35,7 @@ const Menubar = ({
35
35
  [setOpen]
36
36
  );
37
37
  React.useEffect(() => {
38
- if (search === "")
39
- return;
38
+ if (search === "") return;
40
39
  setResults(utils.filterAndTransform(options, search));
41
40
  }, [search]);
42
41
  return /* @__PURE__ */ React.createElement("div", { ref: (ref) => menuRef.current = ref, ...rest }, /* @__PURE__ */ React.createElement(styled.StyledMenuBar, null, /* @__PURE__ */ React.createElement(styled.StyledMenuButton, { variant: "filled", color: "primary", onPress: toggleOpen }, !open ? /* @__PURE__ */ React.createElement(
@@ -80,8 +80,7 @@ const Select = ({
80
80
  (v) => keyExtractor(value) === keyExtractor(v)
81
81
  )) {
82
82
  setSelectOptions([value, ...result]);
83
- } else
84
- setSelectOptions(result);
83
+ } else setSelectOptions(result);
85
84
  } else {
86
85
  if (value.length > 0) {
87
86
  const selectedValues = value.filter(
@@ -13,8 +13,7 @@ const getSingleLabel = (value, options, keyExtractor, placeholder, labelExtracto
13
13
  return selectedOption ? labelExtractor(selectedOption) : placeholder;
14
14
  };
15
15
  const getDisplayValue = (type, value, options, placeholder, keyExtractor, labelExtractor, multiLabels) => {
16
- if (value === void 0 || value.length === 0)
17
- return placeholder;
16
+ if (value === void 0 || value.length === 0) return placeholder;
18
17
  if (type === "multi" && value.length > 1)
19
18
  return getMultiLabel(value, options, multiLabels);
20
19
  return getSingleLabel(
package/dist/cjs/index.js CHANGED
@@ -32,11 +32,11 @@ var useWindowSize = require('./hooks/useWindowSize.js');
32
32
 
33
33
 
34
34
 
35
- Object.defineProperty(exports, 'Icon', {
35
+ Object.defineProperty(exports, "Icon", {
36
36
  enumerable: true,
37
37
  get: function () { return reactCore.Icon; }
38
38
  });
39
- Object.defineProperty(exports, 'Text', {
39
+ Object.defineProperty(exports, "Text", {
40
40
  enumerable: true,
41
41
  get: function () { return reactCore.Text; }
42
42
  });
@@ -16,8 +16,7 @@ const Switch = ({
16
16
  const theme = useTheme();
17
17
  const transitionRef = useRef(null);
18
18
  const handleChange = useCallback(() => {
19
- if (!disabled)
20
- onChange(!active);
19
+ if (!disabled) onChange(!active);
21
20
  }, [active, onChange]);
22
21
  const defaultStyleBackground = {
23
22
  transition: `all 300ms ease`
@@ -1,12 +1,8 @@
1
1
  const getSpan = (value, sm, md, lg) => {
2
- if (!value)
3
- return 0;
4
- if (sm)
5
- return value.sm;
6
- if (md)
7
- return value?.md ?? value.sm;
8
- if (lg)
9
- return value?.lg ?? value?.md ?? value.sm;
2
+ if (!value) return 0;
3
+ if (sm) return value.sm;
4
+ if (md) return value?.md ?? value.sm;
5
+ if (lg) return value?.lg ?? value?.md ?? value.sm;
10
6
  return 0;
11
7
  };
12
8
 
@@ -33,8 +33,7 @@ const Menubar = ({
33
33
  [setOpen]
34
34
  );
35
35
  React__default.useEffect(() => {
36
- if (search === "")
37
- return;
36
+ if (search === "") return;
38
37
  setResults(filterAndTransform(options, search));
39
38
  }, [search]);
40
39
  return /* @__PURE__ */ React__default.createElement("div", { ref: (ref) => menuRef.current = ref, ...rest }, /* @__PURE__ */ React__default.createElement(StyledMenuBar, null, /* @__PURE__ */ React__default.createElement(StyledMenuButton, { variant: "filled", color: "primary", onPress: toggleOpen }, !open ? /* @__PURE__ */ React__default.createElement(
@@ -78,8 +78,7 @@ const Select = ({
78
78
  (v) => keyExtractor(value) === keyExtractor(v)
79
79
  )) {
80
80
  setSelectOptions([value, ...result]);
81
- } else
82
- setSelectOptions(result);
81
+ } else setSelectOptions(result);
83
82
  } else {
84
83
  if (value.length > 0) {
85
84
  const selectedValues = value.filter(
@@ -11,8 +11,7 @@ const getSingleLabel = (value, options, keyExtractor, placeholder, labelExtracto
11
11
  return selectedOption ? labelExtractor(selectedOption) : placeholder;
12
12
  };
13
13
  const getDisplayValue = (type, value, options, placeholder, keyExtractor, labelExtractor, multiLabels) => {
14
- if (value === void 0 || value.length === 0)
15
- return placeholder;
14
+ if (value === void 0 || value.length === 0) return placeholder;
16
15
  if (type === "multi" && value.length > 1)
17
16
  return getMultiLabel(value, options, multiLabels);
18
17
  return getSingleLabel(
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CalendarProps, SelectionType } from '@tecsinapse/react-core';
3
3
  import { ModalProps } from 'react-native';
4
- export declare const Modal: <T extends SelectionType>({ onRequestClose, children, ...modalProps }: CalendarProps<T> & import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps & {
4
+ export declare const Modal: <T extends SelectionType>({ onRequestClose, children, ...modalProps }: CalendarProps<T> & ModalProps & {
5
5
  children: JSX.Element;
6
6
  }) => JSX.Element;
@@ -6,6 +6,6 @@ declare const Component: <Data, Type extends "single" | "multi">({ options, onSe
6
6
  declare const Dropdown: <Data, Type extends "single" | "multi">(props: SelectProps<Data, Type> & {
7
7
  setDropDownVisible: (t: boolean) => void;
8
8
  } & {
9
- ref?: React.ForwardedRef<HTMLDivElement> | undefined;
9
+ ref?: React.ForwardedRef<HTMLDivElement>;
10
10
  }) => ReturnType<typeof Component>;
11
11
  export default Dropdown;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-web-kit",
3
- "description": "TecSinapse React components",
4
- "version": "3.4.3",
3
+ "description": "React components library for web",
4
+ "version": "3.4.5",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "@emotion/native": "~11.11.0",
22
22
  "@emotion/react": "~11.11.0",
23
23
  "@emotion/styled": "~11.11.0",
24
- "@tecsinapse/react-core": "3.4.0",
24
+ "@tecsinapse/react-core": "3.4.2",
25
25
  "date-fns": "~2.30.0",
26
26
  "react-native-vector-icons": "^9.2.0",
27
27
  "react-transition-group": "~4.4.5"
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "homepage": "https://tecsinapse.github.io/design-system/",
38
38
  "peerDependencies": {
39
- "react": "^18.0.0",
40
- "react-dom": "^18.0.0",
39
+ "react": ">=18.0.0",
40
+ "react-dom": ">=18.0.0",
41
41
  "react-native-web": ">=0.18.0 <1"
42
42
  },
43
- "gitHead": "dfdf993b5ed292d922dd8f7c1e1bc7e7057e194a"
43
+ "gitHead": "88caf1e99c9ff6e9a3cf84e60f79a6358fd3fc32"
44
44
  }