@mw-kit/mw-ui 1.8.6 → 1.8.8

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.
@@ -1,8 +1,7 @@
1
1
  export interface ProgressBarProps {
2
2
  type: 'default' | 'info' | 'danger' | 'success' | 'warning';
3
- value: string;
3
+ value: number | null;
4
4
  }
5
5
  export interface StyledProgressBarProps {
6
6
  $type: ProgressBarProps['type'];
7
- $value: ProgressBarProps['value'];
8
7
  }
@@ -1,3 +1,5 @@
1
1
  import type { StyledProgressBarProps } from './interfaces';
2
- export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
+ $disabled: boolean;
4
+ }>> & string;
3
5
  export declare const Progress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProgressBarProps>> & string;
package/dist/index.d.mts CHANGED
@@ -30,7 +30,7 @@ type MappedTransitions<P extends string> = {
30
30
  };
31
31
  };
32
32
 
33
- declare const theme: {
33
+ declare const theme$1: {
34
34
  readonly button: {
35
35
  readonly sizes: {
36
36
  tiny: {
@@ -91,7 +91,7 @@ interface ThemeInterface {
91
91
  isDarkColor: (color: ColorOptions, ifDark?: ColorOptions, ifLight?: ColorOptions) => ColorOptions;
92
92
  spacings: typeof spacings;
93
93
  typographies: typeof typographies;
94
- components: typeof theme;
94
+ components: typeof theme$1;
95
95
  }
96
96
 
97
97
  declare const colors: {
@@ -1501,7 +1501,7 @@ declare const Placeholder: (props: PlaceholderProps) => react_jsx_runtime.JSX.El
1501
1501
 
1502
1502
  interface ProgressBarProps {
1503
1503
  type: 'default' | 'info' | 'danger' | 'success' | 'warning';
1504
- value: string;
1504
+ value: number | null;
1505
1505
  }
1506
1506
 
1507
1507
  declare const ProgressBar: ({ type, value, ...props }: ProgressBarProps) => react_jsx_runtime.JSX.Element;
@@ -1553,8 +1553,9 @@ interface ZoomProps {
1553
1553
 
1554
1554
  declare const Zoom: (props: ZoomProps) => react_jsx_runtime.JSX.Element;
1555
1555
 
1556
+ declare const theme: ThemeInterface;
1556
1557
  declare const ThemeProvider: (props: {
1557
1558
  children: JSX.Element | string | (JSX.Element | string)[];
1558
1559
  }) => react_jsx_runtime.JSX.Element;
1559
1560
 
1560
- export { AbsoluteContainer as MwAbsoluteContainer, AppliedFilters as MwAppliedFilters, Button as MwButton, Calendar as MwCalendar, Card as MwCard, EllipsisContainer as MwEllipsisContainer, Filters as MwFilters, Form as MwForm, Grid as MwGrid, Icon as MwIcon, Indicator as MwIndicator, Input as MwInput, Link as MwLink, Loader as MwLoader, Menu as MwMenu, Modal as MwModal, Placeholder as MwPlaceholder, ProgressBar as MwProgressBar, ScrollContainer as MwScrollContainer, Tabs as MwTabs, TextArea as MwTextArea, Toast as MwToast, Transition as MwTransition, Zoom as MwZoom, ThemeProvider, useTransition as useMwTransition };
1561
+ export { AbsoluteContainer as MwAbsoluteContainer, AppliedFilters as MwAppliedFilters, Button as MwButton, Calendar as MwCalendar, Card as MwCard, EllipsisContainer as MwEllipsisContainer, Filters as MwFilters, Form as MwForm, Grid as MwGrid, Icon as MwIcon, Indicator as MwIndicator, Input as MwInput, Link as MwLink, Loader as MwLoader, Menu as MwMenu, Modal as MwModal, Placeholder as MwPlaceholder, ProgressBar as MwProgressBar, ScrollContainer as MwScrollContainer, Tabs as MwTabs, TextArea as MwTextArea, Toast as MwToast, Transition as MwTransition, Zoom as MwZoom, ThemeProvider, theme, useTransition as useMwTransition };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './components';
2
- export { default as ThemeProvider } from './theme';
2
+ export { theme, default as ThemeProvider } from './theme';
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ __export(index_exports, {
55
55
  MwTransition: () => Transition_default2,
56
56
  MwZoom: () => Zoom_default,
57
57
  ThemeProvider: () => theme_default3,
58
+ theme: () => theme3,
58
59
  useMwTransition: () => useTransition_default
59
60
  });
60
61
  module.exports = __toCommonJS(index_exports);
@@ -16857,51 +16858,51 @@ var Container25 = import_styled_components71.default.div`
16857
16858
  display: flex;
16858
16859
  flex-direction: row;
16859
16860
  align-items: center;
16861
+ opacity: ${({ $disabled: disabled }) => disabled ? 0.5 : 1};
16862
+ width: 100%;
16860
16863
 
16861
- span {
16864
+ > span {
16862
16865
  display: inline-block;
16863
16866
  margin-left: 7px;
16864
16867
  color: #000000cc;
16865
16868
  }
16866
16869
  `;
16867
16870
  var Progress = import_styled_components71.default.div`
16868
- width: 64px;
16871
+ width: 100%;
16869
16872
  height: 12px;
16870
16873
  border: 1px solid #e4e4e4;
16871
- div {
16872
- width: ${({ $value: value }) => `${value}%`};
16873
- max-width: 64px;
16874
- height: 100%;
16875
- ${({ theme: theme4, $type: type }) => type === "default" && import_styled_components71.css`
16876
- background-color: ${theme4.colors.warningGray};
16877
- `}
16878
16874
 
16879
- ${({ theme: theme4, $type: type }) => type === "info" && import_styled_components71.css`
16880
- background-color: ${theme4.colors.blue};
16881
- `}
16875
+ > span {
16876
+ content: '';
16877
+ display: flex;
16882
16878
 
16883
- ${({ theme: theme4, $type: type }) => type === "danger" && import_styled_components71.css`
16884
- background-color: ${theme4.colors.warningRed};
16885
- `}
16879
+ height: 100%;
16886
16880
 
16887
- ${({ theme: theme4, $type: type }) => type === "success" && import_styled_components71.css`
16888
- background-color: ${theme4.colors.green};
16889
- `}
16881
+ transition-property: width background-color;
16882
+ transition-duration: 0.25s;
16883
+ transition-timing-function: ease-in-out;
16890
16884
 
16891
- ${({ theme: theme4, $type: type }) => type === "warning" && import_styled_components71.css`
16892
- background-color: ${theme4.colors.warningYellow};
16893
- `}
16885
+ background-color: ${({ theme: theme4, $type: type }) => {
16886
+ const colors2 = {
16887
+ default: "warningGray",
16888
+ info: "blue",
16889
+ danger: "warningRed",
16890
+ success: "green",
16891
+ warning: "warningYellow"
16892
+ };
16893
+ return theme4.colors[colors2[type]];
16894
+ }};
16894
16895
  }
16895
16896
  `;
16896
16897
 
16897
16898
  // src/components/ProgressBar/index.tsx
16898
16899
  var import_jsx_runtime359 = require("react/jsx-runtime");
16899
16900
  var ProgressBar = ({ type, value, ...props }) => {
16900
- return /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(Container25, { children: [
16901
- /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Progress, { ...props, $type: type, $value: value, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("div", {}) }),
16901
+ return /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)(Container25, { $disabled: value === null, children: [
16902
+ /* @__PURE__ */ (0, import_jsx_runtime359.jsx)(Progress, { ...props, $type: type, children: /* @__PURE__ */ (0, import_jsx_runtime359.jsx)("span", { style: { width: `${value || 0}%` } }) }),
16902
16903
  /* @__PURE__ */ (0, import_jsx_runtime359.jsxs)("span", { children: [
16903
16904
  " ",
16904
- value || "0",
16905
+ value === null ? "-" : value,
16905
16906
  "%"
16906
16907
  ] })
16907
16908
  ] });
@@ -17136,10 +17137,7 @@ var Close2 = (props) => {
17136
17137
  if (!await onClose(index, options[index], event)) {
17137
17138
  return;
17138
17139
  }
17139
- const newactive = (() => {
17140
- if (index < active) return active - 1;
17141
- return active > 0 ? active - 1 : active;
17142
- })();
17140
+ const newactive = index < active || !newOptions[active] ? active - 1 : active;
17143
17141
  setActive(newactive, newOptions[newactive].data);
17144
17142
  setOptions(newOptions);
17145
17143
  },
@@ -17744,5 +17742,6 @@ var Zoom_default = Zoom;
17744
17742
  MwTransition,
17745
17743
  MwZoom,
17746
17744
  ThemeProvider,
17745
+ theme,
17747
17746
  useMwTransition
17748
17747
  });
package/dist/index.mjs CHANGED
@@ -16796,56 +16796,56 @@ var Placeholder = (props) => {
16796
16796
  var Placeholder_default = Placeholder;
16797
16797
 
16798
16798
  // src/components/ProgressBar/styles.ts
16799
- import styled68, { css as css48 } from "styled-components";
16799
+ import styled68 from "styled-components";
16800
16800
  var Container25 = styled68.div`
16801
16801
  display: flex;
16802
16802
  flex-direction: row;
16803
16803
  align-items: center;
16804
+ opacity: ${({ $disabled: disabled }) => disabled ? 0.5 : 1};
16805
+ width: 100%;
16804
16806
 
16805
- span {
16807
+ > span {
16806
16808
  display: inline-block;
16807
16809
  margin-left: 7px;
16808
16810
  color: #000000cc;
16809
16811
  }
16810
16812
  `;
16811
16813
  var Progress = styled68.div`
16812
- width: 64px;
16814
+ width: 100%;
16813
16815
  height: 12px;
16814
16816
  border: 1px solid #e4e4e4;
16815
- div {
16816
- width: ${({ $value: value }) => `${value}%`};
16817
- max-width: 64px;
16818
- height: 100%;
16819
- ${({ theme: theme4, $type: type }) => type === "default" && css48`
16820
- background-color: ${theme4.colors.warningGray};
16821
- `}
16822
16817
 
16823
- ${({ theme: theme4, $type: type }) => type === "info" && css48`
16824
- background-color: ${theme4.colors.blue};
16825
- `}
16818
+ > span {
16819
+ content: '';
16820
+ display: flex;
16826
16821
 
16827
- ${({ theme: theme4, $type: type }) => type === "danger" && css48`
16828
- background-color: ${theme4.colors.warningRed};
16829
- `}
16822
+ height: 100%;
16830
16823
 
16831
- ${({ theme: theme4, $type: type }) => type === "success" && css48`
16832
- background-color: ${theme4.colors.green};
16833
- `}
16824
+ transition-property: width background-color;
16825
+ transition-duration: 0.25s;
16826
+ transition-timing-function: ease-in-out;
16834
16827
 
16835
- ${({ theme: theme4, $type: type }) => type === "warning" && css48`
16836
- background-color: ${theme4.colors.warningYellow};
16837
- `}
16828
+ background-color: ${({ theme: theme4, $type: type }) => {
16829
+ const colors2 = {
16830
+ default: "warningGray",
16831
+ info: "blue",
16832
+ danger: "warningRed",
16833
+ success: "green",
16834
+ warning: "warningYellow"
16835
+ };
16836
+ return theme4.colors[colors2[type]];
16837
+ }};
16838
16838
  }
16839
16839
  `;
16840
16840
 
16841
16841
  // src/components/ProgressBar/index.tsx
16842
16842
  import { jsx as jsx359, jsxs as jsxs180 } from "react/jsx-runtime";
16843
16843
  var ProgressBar = ({ type, value, ...props }) => {
16844
- return /* @__PURE__ */ jsxs180(Container25, { children: [
16845
- /* @__PURE__ */ jsx359(Progress, { ...props, $type: type, $value: value, children: /* @__PURE__ */ jsx359("div", {}) }),
16844
+ return /* @__PURE__ */ jsxs180(Container25, { $disabled: value === null, children: [
16845
+ /* @__PURE__ */ jsx359(Progress, { ...props, $type: type, children: /* @__PURE__ */ jsx359("span", { style: { width: `${value || 0}%` } }) }),
16846
16846
  /* @__PURE__ */ jsxs180("span", { children: [
16847
16847
  " ",
16848
- value || "0",
16848
+ value === null ? "-" : value,
16849
16849
  "%"
16850
16850
  ] })
16851
16851
  ] });
@@ -16909,7 +16909,7 @@ var ScrollButton = (props) => {
16909
16909
  var ScrollButton_default = ScrollButton;
16910
16910
 
16911
16911
  // src/components/Tabs/components/ScrollButtons/styled.ts
16912
- import styled70, { css as css49 } from "styled-components";
16912
+ import styled70, { css as css48 } from "styled-components";
16913
16913
  var Container27 = styled70.div`
16914
16914
  overflow-x: auto;
16915
16915
  scrollbar-width: thin;
@@ -16925,7 +16925,7 @@ var Container27 = styled70.div`
16925
16925
  display: none; /* Chrome, Safari, Opera */
16926
16926
  }
16927
16927
 
16928
- ${({ theme: theme4, $internal: internal }) => internal && css49`
16928
+ ${({ theme: theme4, $internal: internal }) => internal && css48`
16929
16929
  gap: ${theme4.spacings.s6};
16930
16930
  `}
16931
16931
  `;
@@ -17080,10 +17080,7 @@ var Close2 = (props) => {
17080
17080
  if (!await onClose(index, options[index], event)) {
17081
17081
  return;
17082
17082
  }
17083
- const newactive = (() => {
17084
- if (index < active) return active - 1;
17085
- return active > 0 ? active - 1 : active;
17086
- })();
17083
+ const newactive = index < active || !newOptions[active] ? active - 1 : active;
17087
17084
  setActive(newactive, newOptions[newactive].data);
17088
17085
  setOptions(newOptions);
17089
17086
  },
@@ -17107,7 +17104,7 @@ var Close_default = Close2;
17107
17104
  import { useState as useState25 } from "react";
17108
17105
 
17109
17106
  // src/components/Tabs/components/TabItem/components/LabelItem/styled.ts
17110
- import styled72, { css as css50 } from "styled-components";
17107
+ import styled72, { css as css49 } from "styled-components";
17111
17108
  var StyledTab = styled72.div`
17112
17109
  position: relative;
17113
17110
  flex: 1;
@@ -17141,7 +17138,7 @@ var StyledTab = styled72.div`
17141
17138
  transition: --color 0.5s, --bgColor 0.5s;
17142
17139
  }
17143
17140
 
17144
- ${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal && css50`
17141
+ ${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal && css49`
17145
17142
  &::before {
17146
17143
  content: '';
17147
17144
  position: absolute;
@@ -17263,7 +17260,7 @@ var TabItem = (props) => {
17263
17260
  var TabItem_default = TabItem;
17264
17261
 
17265
17262
  // src/components/Tabs/styled.ts
17266
- import styled74, { css as css51 } from "styled-components";
17263
+ import styled74, { css as css50 } from "styled-components";
17267
17264
  var delimiters = {
17268
17265
  blue: ["blue"],
17269
17266
  grey: ["warningGray"]
@@ -17284,7 +17281,7 @@ var Tabs = styled74.div`
17284
17281
  bottom: "s4",
17285
17282
  left: "0"
17286
17283
  }).split(" ");
17287
- return css51`
17284
+ return css50`
17288
17285
  margin: ${top} 0 ${bottom} 0;
17289
17286
  padding: 0 ${right} 0 ${left};
17290
17287
  `;
@@ -17292,7 +17289,7 @@ var Tabs = styled74.div`
17292
17289
 
17293
17290
  ${({ theme: theme4, $internal: internal, $delimiter: delimiter }) => {
17294
17291
  const border = delimiter === "none" ? "none" : internal ? `1px solid ${theme4.getColor(...delimiters[delimiter || "grey"])}` : `2px solid ${theme4.getColor(...delimiters[delimiter || "blue"])}`;
17295
- return css51`
17292
+ return css50`
17296
17293
  border-bottom: ${border};
17297
17294
  + ${ComponentContainer} {
17298
17295
  border: 1px solid ${theme4.getColor(...delimiters.grey)};
@@ -17448,7 +17445,7 @@ var TextArea = ({
17448
17445
  var TextArea_default = TextArea;
17449
17446
 
17450
17447
  // src/components/Toast/styles.ts
17451
- import styled76, { css as css52 } from "styled-components";
17448
+ import styled76, { css as css51 } from "styled-components";
17452
17449
  var Container30 = styled76.div`
17453
17450
  border-radius: 4px;
17454
17451
  width: ${({ $size: size3 }) => size3 === "large" ? "837px" : "460px"};
@@ -17456,7 +17453,7 @@ var Container30 = styled76.div`
17456
17453
  border: 1px solid transparent;
17457
17454
  position: relative;
17458
17455
 
17459
- ${({ $color: color }) => color === "success" && css52`
17456
+ ${({ $color: color }) => color === "success" && css51`
17460
17457
  background-color: #fcfff5;
17461
17458
  opacity: 1;
17462
17459
  border-color: #a8c599;
@@ -17468,7 +17465,7 @@ var Container30 = styled76.div`
17468
17465
  }
17469
17466
  `}
17470
17467
 
17471
- ${({ $color: color }) => color === "error" && css52`
17468
+ ${({ $color: color }) => color === "error" && css51`
17472
17469
  background-color: #fff6f6;
17473
17470
  opacity: 1;
17474
17471
  border-color: #973937;
@@ -17480,7 +17477,7 @@ var Container30 = styled76.div`
17480
17477
  }
17481
17478
  `}
17482
17479
 
17483
- ${({ $color: color }) => color === "warning" && css52`
17480
+ ${({ $color: color }) => color === "warning" && css51`
17484
17481
  background-color: #fffaf3;
17485
17482
  opacity: 1;
17486
17483
  border-color: #ccbea0;
@@ -17687,5 +17684,6 @@ export {
17687
17684
  Transition_default2 as MwTransition,
17688
17685
  Zoom_default as MwZoom,
17689
17686
  theme_default3 as ThemeProvider,
17687
+ theme3 as theme,
17690
17688
  useTransition_default as useMwTransition
17691
17689
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mw-kit/mw-ui",
3
- "version": "1.8.6",
3
+ "version": "1.8.8",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "fmgusmao",
6
6
  "license": "MIT",