rangeflow 1.0.10 → 1.0.12

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.
@@ -0,0 +1,2 @@
1
+ import { RangeFlowProps } from './types';
2
+ export declare function RangeFlow(props: RangeFlowProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import { RangeFlowProps } from './types';
2
- export declare function RangeFlow(props: RangeFlowProps): import("react/jsx-runtime").JSX.Element;
1
+ export { RangeFlow } from './RangeFlow';
2
+ export { useRangeflow } from './hooks/use-rangeflow';
3
+ export type { RangeFlowProps, RangeFlowApi } from './types';
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ function N(e, t) {
58
58
  //#region src/package/rangeflow/utils/create-slider-values.ts
59
59
  var ce = N([1, 100], [5, 100]);
60
60
  function P(e, t) {
61
- let n = d(e.from).startOf("day"), r = d(e.to).startOf("day").diff(n, "day"), i = d(t.from).startOf("day"), a = d(t.to).startOf("day"), o = Math.max(i.diff(n, "day"), 0), s = Math.max(a.diff(i, "day"), 0) * 100 / r, c = o * 100 / r, l = Math.max(ce(s), 5), u = M(c - (l - s), 0, Math.max(100 - l, 0));
61
+ let n = d(e.from).startOf("day"), r = d(e.to).startOf("day").diff(n, "day"), i = d(t.from).startOf("day"), a = d(t.to).startOf("day"), o = Math.max(i.diff(n, "day"), 0), s = (a.diff(i, "day") + 1) * 100 / r, c = o * 100 / r, l = Math.max(ce(s), 5), u = M(c - (l - s), 0, Math.max(100 - l, 0));
62
62
  return {
63
63
  size: l,
64
64
  left: u,
@@ -297,7 +297,7 @@ function ge(e, t) {
297
297
  left: r,
298
298
  right: i,
299
299
  from: a.add(u, "day").toDate(),
300
- to: a.add(u + l, "day").toDate()
300
+ to: a.add(u + l - 1, "day").toDate()
301
301
  };
302
302
  }
303
303
  //#endregion
@@ -352,7 +352,7 @@ function ve() {
352
352
  //#region src/package/rangeflow/components/DateSlider/SliderValue.tsx
353
353
  var ye = n(() => {
354
354
  let { SliderValueLabel: e } = G(), n = K((e) => e.slider.size), r = K((e) => e.selected_date), i = c(() => {
355
- let e = Math.max(d(r.to).diff(r.from, "day"), 1);
355
+ let e = d(r.to).diff(r.from, "day") + 1;
356
356
  return n < 10 ? `${e}D` : e === 1 ? "1 Day" : `${e} Days`;
357
357
  }, [
358
358
  r.from,
@@ -831,7 +831,7 @@ function Be() {
831
831
  });
832
832
  }
833
833
  //#endregion
834
- //#region src/package/rangeflow/index.tsx
834
+ //#region src/package/rangeflow/RangeFlow.tsx
835
835
  function Ve(e) {
836
836
  return /* @__PURE__ */ p(V, {
837
837
  ...e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rangeflow",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "description": "A fancy date range picker built with React and Tailwind.",
6
6
  "license": "MIT",
package/dist/entry.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { RangeFlow } from '.';
2
- export { useRangeflow } from './hooks/use-rangeflow';
3
- export type { RangeFlowProps, RangeFlowApi } from './types';