@bigbinary/neeto-atoms 1.1.8 → 1.1.10

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.
Files changed (32) hide show
  1. package/dist/{DatePicker-CMlA-hNW.js → DatePicker-CHLlvCBK.js} +121 -282
  2. package/dist/DatePicker-CHLlvCBK.js.map +1 -0
  3. package/dist/{TranslationProvider-DKdbPweu.js → TranslationProvider-CQyQt55W.js} +2 -4
  4. package/dist/{TranslationProvider-DKdbPweu.js.map → TranslationProvider-CQyQt55W.js.map} +1 -1
  5. package/dist/cjs/{DatePicker-CBxWLALJ.js → DatePicker-wFGPZ-gu.js} +119 -281
  6. package/dist/cjs/DatePicker-wFGPZ-gu.js.map +1 -0
  7. package/dist/cjs/{TranslationProvider-Cao2ugzJ.js → TranslationProvider-CJlcb83b.js} +2 -4
  8. package/dist/cjs/{TranslationProvider-Cao2ugzJ.js.map → TranslationProvider-CJlcb83b.js.map} +1 -1
  9. package/dist/cjs/components/DatePicker.js +1 -1
  10. package/dist/cjs/components/TranslationProvider.js +1 -1
  11. package/dist/cjs/components/index.js +2 -2
  12. package/dist/cjs/index.js +2 -2
  13. package/dist/cjs/primitives/Calendar.js +5 -2
  14. package/dist/cjs/primitives/Calendar.js.map +1 -1
  15. package/dist/components/DatePicker/RangeTimeSection.d.ts +2 -2
  16. package/dist/components/DatePicker/TimeInput.d.ts +27 -0
  17. package/dist/components/DatePicker/TimeSection.d.ts +2 -2
  18. package/dist/components/DatePicker/timeText.d.ts +32 -0
  19. package/dist/components/DatePicker/types.d.ts +1 -1
  20. package/dist/components/DatePicker.js +1 -1
  21. package/dist/components/TranslationProvider.js +1 -1
  22. package/dist/components/index.js +2 -2
  23. package/dist/index.js +2 -2
  24. package/dist/primitives/Calendar.d.ts +1 -1
  25. package/dist/primitives/Calendar.js +5 -2
  26. package/dist/primitives/Calendar.js.map +1 -1
  27. package/dist/translations/index.d.ts +1 -3
  28. package/package.json +1 -1
  29. package/dist/DatePicker-CMlA-hNW.js.map +0 -1
  30. package/dist/cjs/DatePicker-CBxWLALJ.js.map +0 -1
  31. package/dist/components/DatePicker/SegmentedTimeInput.d.ts +0 -23
  32. package/dist/components/DatePicker/segmentedTime.d.ts +0 -58
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { TimeValue } from "../TimePicker/types";
3
- import { type SegmentedTimeInputHandle } from "./SegmentedTimeInput";
3
+ import { type TimeInputHandle } from "./TimeInput";
4
4
  import type { RangeEndpoint } from "./useRangePicker";
5
5
  interface RangeTimeSectionProps {
6
6
  /** The picked days, formatted, e.g. "15/11/2026"; empty until picked. */
@@ -29,7 +29,7 @@ interface RangeTimeSectionProps {
29
29
  /** e.g. "India Standard Time (UTC+5:30)"; hidden when null. */
30
30
  timezoneLabel: string | null;
31
31
  /** Lets the picker move focus to the start time. */
32
- fromTimeRef?: React.Ref<SegmentedTimeInputHandle>;
32
+ fromTimeRef?: React.Ref<TimeInputHandle>;
33
33
  disabled?: boolean;
34
34
  className?: string;
35
35
  }
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import type { TimeValue } from "../TimePicker/types";
3
+ import { type TimeTextError } from "./timeText";
4
+ interface TimeInputProps {
5
+ value: TimeValue;
6
+ /** Minute increment; minutes snap to it. Omit to take minutes as typed. */
7
+ minuteStep?: number;
8
+ onChange: (value: TimeValue) => void;
9
+ /** Reports why the text can't be read as a time, or null once it can. */
10
+ onErrorChange: (error: TimeTextError | null) => void;
11
+ invalid?: boolean;
12
+ disabled?: boolean;
13
+ autoFocus?: boolean;
14
+ "aria-label"?: string;
15
+ "aria-describedby"?: string;
16
+ "data-testid"?: string;
17
+ }
18
+ export interface TimeInputHandle {
19
+ /** Focuses the field with its text selected, ready to type over. */
20
+ focus: () => void;
21
+ }
22
+ /**
23
+ * A text field that reads times however they are typed: "930", "1122p",
24
+ * "9:30 pm", "21:30". The text is tidied to "11:22 PM" on leaving the field.
25
+ */
26
+ declare const TimeInput: React.ForwardRefExoticComponent<TimeInputProps & React.RefAttributes<TimeInputHandle>>;
27
+ export { TimeInput };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { TimeValue } from "../TimePicker/types";
3
- import type { SegmentedTimeError } from "./segmentedTime";
3
+ import type { TimeTextError } from "./timeText";
4
4
  interface TimeSectionProps {
5
5
  value: TimeValue;
6
6
  /** Minute increment; also shows the hint naming it. Omit for any minute. */
@@ -19,7 +19,7 @@ interface TimeSectionProps {
19
19
  disabled?: boolean;
20
20
  className?: string;
21
21
  }
22
- export declare const ERROR_DEFAULTS: Record<SegmentedTimeError, string>;
22
+ export declare const ERROR_DEFAULTS: Record<TimeTextError, string>;
23
23
  export declare const stepExamples: (step: number) => [string, string];
24
24
  declare const TimeSection: React.FC<TimeSectionProps>;
25
25
  export { TimeSection };
@@ -0,0 +1,32 @@
1
+ import type { TimeValue } from "../TimePicker/types";
2
+ /**
3
+ * Helpers for the free-text time field. Every function here is pure.
4
+ *
5
+ * `step` is the minute increment (e.g. 5): parsed and loaded minutes snap to
6
+ * it. 1, the default, leaves minutes as typed.
7
+ */
8
+ export type TimeTextError = "timeRequired";
9
+ /**
10
+ * Rounds minutes to the nearest step, staying within the hour. With step 5:
11
+ * 27 → 25, 28 → 30, 58 → 55. With step 1 they are unchanged.
12
+ */
13
+ export declare const snapMinute: (minutes: number, step?: number) => number;
14
+ export declare const snapTimeValue: (value: TimeValue, step?: number) => TimeValue;
15
+ export declare const toMinutes: (value: TimeValue) => number;
16
+ export declare const fromMinutes: (minutes: number) => TimeValue;
17
+ /** The last time of the day on the step's grid: 11:59 PM, or 11:55 PM for 5. */
18
+ export declare const lastMinuteOfDay: (step?: number) => number;
19
+ /** e.g. "9:30 AM". */
20
+ export declare const formatTimeText: (value: TimeValue) => string;
21
+ /**
22
+ * Reads what people type into a time field. Without "a"/"p" the hour is read
23
+ * on the 24-hour clock, so "9" is 9 AM and "21" is 9 PM.
24
+ *
25
+ * "9" → 9:00 AM, "930" → 9:30 AM, "113" → 11:30 AM, "1122p" → 11:22 PM,
26
+ * "9:30 pm" → 9:30 PM, "1 15" → 1:15 AM, "11:3" → 11:30 AM, "21:30" → 9:30 PM,
27
+ * "12a" → 12:00 AM.
28
+ *
29
+ * Returns null when the text is empty and "invalid" when it can't be read.
30
+ */
31
+ export declare const parseTimeText: (text: string, step?: number) => TimeValue | null | "invalid";
32
+ export declare const getTimeTextError: (parsed: TimeValue | null | "invalid") => TimeTextError | null;
@@ -105,7 +105,7 @@ export interface DatePickerProps {
105
105
  align?: PopoverAlign;
106
106
  /** Custom trigger element. When provided, replaces the built-in input UI and the popover anchors to this element. */
107
107
  trigger?: React.ReactNode;
108
- /** First day of the week. 0 = Sunday (default), 1 = Monday, etc. */
108
+ /** First day of the week. 0 = Sunday, 1 = Monday (default), etc. */
109
109
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
110
110
  /** Prefix for the field's testid family(input, error). Falls back to the hyphenized label. */
111
111
  dataTestId?: string;
@@ -1,4 +1,4 @@
1
- export { D as DatePicker } from '../DatePicker-CMlA-hNW.js';
1
+ export { D as DatePicker } from '../DatePicker-CHLlvCBK.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '../primitives/Calendar.js';
@@ -1,4 +1,4 @@
1
- export { T as TranslationProvider } from '../TranslationProvider-DKdbPweu.js';
1
+ export { T as TranslationProvider } from '../TranslationProvider-CQyQt55W.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'react-i18next';
@@ -8,7 +8,7 @@ export { C as Callout } from '../Callout-DJGi3MQR.js';
8
8
  export { C as Checkbox } from '../Checkbox-BalUzegZ.js';
9
9
  export { C as ColorPicker } from '../ColorPicker-g9siUaIe.js';
10
10
  export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from '../DataTable-C7OVgLaL.js';
11
- export { D as DatePicker } from '../DatePicker-CMlA-hNW.js';
11
+ export { D as DatePicker } from '../DatePicker-CHLlvCBK.js';
12
12
  export { D as Dialog } from '../Dialog-ZTcfRPwU.js';
13
13
  export { E as Empty } from '../Empty-B4iQJlmf.js';
14
14
  export { I as Input } from '../Input-Dm5ILPH3.js';
@@ -30,7 +30,7 @@ export { T as Textarea } from '../Textarea-CUe09-sr.js';
30
30
  export { T as TimePicker, a as TimePickerPanel } from '../TimePicker-DNeKmsBO.js';
31
31
  export { T as Toastr } from '../Toastr-BGdPHnlj.js';
32
32
  export { T as Tooltip } from '../Tooltip-DWDsgyx7.js';
33
- export { T as TranslationProvider } from '../TranslationProvider-DKdbPweu.js';
33
+ export { T as TranslationProvider } from '../TranslationProvider-CQyQt55W.js';
34
34
  export { T as Tree } from '../Tree-Cf0rLcX9.js';
35
35
  export { T as TreeSelect } from '../TreeSelect-BV18q8UD.js';
36
36
  export { T as Typography, t as typographyVariants } from '../Typography-Bu78IBJy.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { dayjs } from '@bigbinary/neeto-commons-frontend/utils';
2
2
  export { dayjs } from '@bigbinary/neeto-commons-frontend/utils';
3
- export { T as TranslationProvider, r as translations } from './TranslationProvider-DKdbPweu.js';
3
+ export { T as TranslationProvider, r as translations } from './TranslationProvider-CQyQt55W.js';
4
4
  export { DropdownMenu } from './components/DropdownMenu.js';
5
5
  export { u as useIsMobile } from './use-mobile-QbHL72cX.js';
6
6
  export { c as cn } from './utils-BJnb9o5c.js';
@@ -13,7 +13,7 @@ export { C as Callout } from './Callout-DJGi3MQR.js';
13
13
  export { C as Checkbox } from './Checkbox-BalUzegZ.js';
14
14
  export { C as ColorPicker } from './ColorPicker-g9siUaIe.js';
15
15
  export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from './DataTable-C7OVgLaL.js';
16
- export { D as DatePicker } from './DatePicker-CMlA-hNW.js';
16
+ export { D as DatePicker } from './DatePicker-CHLlvCBK.js';
17
17
  export { D as Dialog } from './Dialog-ZTcfRPwU.js';
18
18
  export { D as DirectionProvider } from './DirectionProvider-weqLz_BJ.js';
19
19
  export { E as Empty } from './Empty-B4iQJlmf.js';
@@ -1,5 +1,5 @@
1
1
  import type React from "react";
2
2
  import { Calendar as ShadcnCalendar, CalendarDayButton as ShadcnCalendarDayButton } from "src/shadcn/components/calendar";
3
- declare const Calendar: (props: React.ComponentProps<typeof ShadcnCalendar>) => import("react/jsx-runtime").JSX.Element;
3
+ declare const Calendar: ({ weekStartsOn, ...props }: React.ComponentProps<typeof ShadcnCalendar>) => import("react/jsx-runtime").JSX.Element;
4
4
  declare const CalendarDayButton: (props: React.ComponentProps<typeof ShadcnCalendarDayButton>) => import("react/jsx-runtime").JSX.Element;
5
5
  export { Calendar, CalendarDayButton };
@@ -8036,7 +8036,7 @@ function Calendar$1({
8036
8036
  defaultClassNames.today
8037
8037
  ),
8038
8038
  outside: cn(
8039
- "text-muted-foreground aria-selected:text-muted-foreground",
8039
+ "text-muted-foreground/40 aria-selected:text-muted-foreground/40",
8040
8040
  defaultClassNames.outside
8041
8041
  ),
8042
8042
  disabled: cn(
@@ -8110,7 +8110,10 @@ function CalendarDayButton$1({
8110
8110
  );
8111
8111
  }
8112
8112
 
8113
- const Calendar = (props) => /* @__PURE__ */ jsx(Calendar$1, { ...props });
8113
+ const Calendar = ({
8114
+ weekStartsOn = 1,
8115
+ ...props
8116
+ }) => /* @__PURE__ */ jsx(Calendar$1, { weekStartsOn, ...props });
8114
8117
  const CalendarDayButton = (props) => /* @__PURE__ */ jsx(CalendarDayButton$1, { ...props });
8115
8118
 
8116
8119
  export { Calendar, CalendarDayButton };