@mw-kit/mw-ui 1.8.12 → 1.8.13

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,5 +1,2 @@
1
- interface SelectedAreaProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
2
- $percent: number;
3
- }
4
- declare const SelectedArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SelectedAreaProps>> & string;
1
+ declare const SelectedArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
2
  export default SelectedArea;
package/dist/index.js CHANGED
@@ -10332,17 +10332,25 @@ var Button3 = (props) => {
10332
10332
  };
10333
10333
  const htmlProps = filterObject(props, ["size", "appearance", "color", "loading", "content"]);
10334
10334
  const loaderSize = sizes[defaultValues.$size].lineHeight;
10335
- return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(Button2, { ...defaultValues, ...htmlProps, children: [
10336
- children || content,
10337
- props.loading && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
10338
- Loader_default2,
10339
- {
10340
- color: defaultValues.$appearance === "solid" ? "white" : "blue",
10341
- size: loaderSize,
10342
- borderSize: `calc(${loaderSize} * 0.0757)`
10343
- }
10344
- )
10345
- ] });
10335
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
10336
+ Button2,
10337
+ {
10338
+ ...defaultValues,
10339
+ ...htmlProps,
10340
+ formNoValidate: "formNoValidate" in props ? props.formNoValidate : props.type === "submit",
10341
+ children: [
10342
+ children || content,
10343
+ props.loading && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
10344
+ Loader_default2,
10345
+ {
10346
+ color: defaultValues.$appearance === "solid" ? "white" : "blue",
10347
+ size: loaderSize,
10348
+ borderSize: `calc(${loaderSize} * 0.0757)`
10349
+ }
10350
+ )
10351
+ ]
10352
+ }
10353
+ );
10346
10354
  };
10347
10355
  var Button_default2 = Button3;
10348
10356
 
@@ -12572,9 +12580,7 @@ var SelectedArea = import_styled_components30.default.div`
12572
12580
  z-index: 1;
12573
12581
 
12574
12582
  > span {
12575
- width: ${({ $percent: percent }) => percent}%;
12576
- display: block;
12577
- box-sizing: border-box;
12583
+ background-color: ${({ theme: theme4 }) => theme4.colors.blue};
12578
12584
  height: 100%;
12579
12585
  }
12580
12586
  `;
@@ -12965,8 +12971,7 @@ var Range = import_react27.default.forwardRef(
12965
12971
  const viewMode = isViewMode() || props.viewMode;
12966
12972
  const { min, max, strict, markers, step, position, value } = getMarkers(props);
12967
12973
  const range = max - min;
12968
- const percent = 100 / range;
12969
- const spans = value - min;
12974
+ const percent = (value - min) * 100 / range;
12970
12975
  if (value < min || value > max) {
12971
12976
  throw new Error(
12972
12977
  `Value must be between "${min}" and "${max}". "${value}" given`
@@ -13143,7 +13148,14 @@ var Range = import_react27.default.forwardRef(
13143
13148
  }
13144
13149
  )
13145
13150
  ] }),
13146
- /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(SelectedArea_default, { $percent: percent, children: Array(spans).fill(1).map((_value, index) => /* @__PURE__ */ (0, import_jsx_runtime319.jsx)("span", {}, index)) })
13151
+ /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(SelectedArea_default, { children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
13152
+ "span",
13153
+ {
13154
+ style: {
13155
+ width: `calc(${percent}% - (${bulletSize * percent / 100}px)`
13156
+ }
13157
+ }
13158
+ ) })
13147
13159
  ] })
13148
13160
  ] }),
13149
13161
  maxLabel && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(MinMaxLabelContainer_default, { children: maxLabel })
package/dist/index.mjs CHANGED
@@ -10275,17 +10275,25 @@ var Button3 = (props) => {
10275
10275
  };
10276
10276
  const htmlProps = filterObject(props, ["size", "appearance", "color", "loading", "content"]);
10277
10277
  const loaderSize = sizes[defaultValues.$size].lineHeight;
10278
- return /* @__PURE__ */ jsxs148(Button2, { ...defaultValues, ...htmlProps, children: [
10279
- children || content,
10280
- props.loading && /* @__PURE__ */ jsx306(
10281
- Loader_default2,
10282
- {
10283
- color: defaultValues.$appearance === "solid" ? "white" : "blue",
10284
- size: loaderSize,
10285
- borderSize: `calc(${loaderSize} * 0.0757)`
10286
- }
10287
- )
10288
- ] });
10278
+ return /* @__PURE__ */ jsxs148(
10279
+ Button2,
10280
+ {
10281
+ ...defaultValues,
10282
+ ...htmlProps,
10283
+ formNoValidate: "formNoValidate" in props ? props.formNoValidate : props.type === "submit",
10284
+ children: [
10285
+ children || content,
10286
+ props.loading && /* @__PURE__ */ jsx306(
10287
+ Loader_default2,
10288
+ {
10289
+ color: defaultValues.$appearance === "solid" ? "white" : "blue",
10290
+ size: loaderSize,
10291
+ borderSize: `calc(${loaderSize} * 0.0757)`
10292
+ }
10293
+ )
10294
+ ]
10295
+ }
10296
+ );
10289
10297
  };
10290
10298
  var Button_default2 = Button3;
10291
10299
 
@@ -12515,9 +12523,7 @@ var SelectedArea = styled27.div`
12515
12523
  z-index: 1;
12516
12524
 
12517
12525
  > span {
12518
- width: ${({ $percent: percent }) => percent}%;
12519
- display: block;
12520
- box-sizing: border-box;
12526
+ background-color: ${({ theme: theme4 }) => theme4.colors.blue};
12521
12527
  height: 100%;
12522
12528
  }
12523
12529
  `;
@@ -12908,8 +12914,7 @@ var Range = React25.forwardRef(
12908
12914
  const viewMode = isViewMode() || props.viewMode;
12909
12915
  const { min, max, strict, markers, step, position, value } = getMarkers(props);
12910
12916
  const range = max - min;
12911
- const percent = 100 / range;
12912
- const spans = value - min;
12917
+ const percent = (value - min) * 100 / range;
12913
12918
  if (value < min || value > max) {
12914
12919
  throw new Error(
12915
12920
  `Value must be between "${min}" and "${max}". "${value}" given`
@@ -13086,7 +13091,14 @@ var Range = React25.forwardRef(
13086
13091
  }
13087
13092
  )
13088
13093
  ] }),
13089
- /* @__PURE__ */ jsx319(SelectedArea_default, { $percent: percent, children: Array(spans).fill(1).map((_value, index) => /* @__PURE__ */ jsx319("span", {}, index)) })
13094
+ /* @__PURE__ */ jsx319(SelectedArea_default, { children: /* @__PURE__ */ jsx319(
13095
+ "span",
13096
+ {
13097
+ style: {
13098
+ width: `calc(${percent}% - (${bulletSize * percent / 100}px)`
13099
+ }
13100
+ }
13101
+ ) })
13090
13102
  ] })
13091
13103
  ] }),
13092
13104
  maxLabel && /* @__PURE__ */ jsx319(MinMaxLabelContainer_default, { children: maxLabel })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mw-kit/mw-ui",
3
- "version": "1.8.12",
3
+ "version": "1.8.13",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "fmgusmao",
6
6
  "license": "MIT",