@synerise/ds-time-picker 2.0.4 → 2.0.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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-time-picker@2.0.4...@synerise/ds-time-picker@2.0.5) (2026-09-18)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-time-picker
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.0.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-time-picker@2.0.3...@synerise/ds-time-picker@2.0.4) (2026-09-16)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-time-picker
@@ -8,9 +8,9 @@ import { useDataFormat } from "@synerise/ds-core";
8
8
  import DSDropdown from "@synerise/ds-dropdown";
9
9
  import Icon, { Close3S, ClockM } from "@synerise/ds-icon";
10
10
  import Tooltip from "@synerise/ds-tooltip";
11
+ import { HOUR, MINUTE, SECOND, AM, PM, HOUR_12, DISABLE_CLOCK_MODE_HOUR, CLOCK_MODES } from "./constants/timePicker.constants.js";
11
12
  import { OverlayContainer, UnitSeperator, ClearIcon, Container, TimePickerInput, Unit as Unit$1, Cell, CellText } from "./TimePicker.styles.js";
12
13
  import Unit from "./Unit.js";
13
- import { HOUR, MINUTE, SECOND, AM, PM, HOUR_12, DISABLE_CLOCK_MODE_HOUR, CLOCK_MODES } from "./constants/timePicker.constants.js";
14
14
  import { getClockModeFromDate, getOppositeClockMode } from "./utils/clockMode.utils.js";
15
15
  import { handleTimeChange } from "./utils/timePicker.utils.js";
16
16
  dayjs.extend(customParseFormatPlugin);
@@ -56,20 +56,16 @@ const TimePicker = ({
56
56
  return use12HourClock;
57
57
  }, [is12HoursClockFromDataFormat, use12HourClock]);
58
58
  const timeFormatByClockMode = useMemo(() => timeFormat ?? (is12HourClock ? "hh:mm:ss A" : "HH:mm:ss"), [timeFormat, is12HourClock]);
59
- const getTimeString = useCallback(
60
- (date) => {
61
- if (timeFormat) {
62
- return dayjs(date).format(timeFormatByClockMode);
63
- }
64
- return formatValue(date, {
65
- targetFormat: "time",
66
- second: "numeric",
67
- ...valueFormatOptions
68
- });
69
- },
70
- // eslint-disable-next-line react-hooks/exhaustive-deps
71
- [timeFormat, timeFormatByClockMode, formatValue]
72
- );
59
+ const getTimeString = useCallback((date) => {
60
+ if (timeFormat) {
61
+ return dayjs(date).format(timeFormatByClockMode);
62
+ }
63
+ return formatValue(date, {
64
+ targetFormat: "time",
65
+ second: "numeric",
66
+ ...valueFormatOptions
67
+ });
68
+ }, [timeFormat, timeFormatByClockMode, formatValue]);
73
69
  const unitConfig = [{
74
70
  unit: HOUR,
75
71
  options: is12HourClock ? range(1, 13) : range(24),
package/dist/Unit.js CHANGED
@@ -29,7 +29,7 @@ const Unit = ({
29
29
  }
30
30
  }, [isFirstRender, unitContainerRef]);
31
31
  const scrollHandler = () => {
32
- if (!!unitContainerRef && !!unitContainerRef.current) {
32
+ if (unitContainerRef && unitContainerRef.current) {
33
33
  const pixelsScrolled = unitContainerRef.current.scrollTop;
34
34
  const isScrollBetweenTwoCells = pixelsScrolled % CELL_HEIGHT !== 0;
35
35
  pixelsScrolled !== 0 && isScrollBetweenTwoCells && typeof unitContainerRef.current.scrollTo === "function" && unitContainerRef.current.scrollTo({
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export { AM, CLOCK_MODES, DISABLE_CLOCK_MODE_HOUR, HOUR, HOUR_12, MAP_12_AM_TO_24_HOUR, MAP_12_PM_TO_24_HOUR, MAP_24_HOUR_TO_12, PM, } from './constants/timePicker.constants';
1
2
  export { default } from './TimePicker';
2
- export { AM, PM, HOUR_12, HOUR, CLOCK_MODES, MAP_12_AM_TO_24_HOUR, MAP_12_PM_TO_24_HOUR, MAP_24_HOUR_TO_12, DISABLE_CLOCK_MODE_HOUR, } from './constants/timePicker.constants';
3
3
  export type { ClockModes, TimePickerProps } from './types/TimePicker.types';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { default as default2 } from "./TimePicker.js";
2
1
  import { AM, CLOCK_MODES, DISABLE_CLOCK_MODE_HOUR, HOUR, HOUR_12, MAP_12_AM_TO_24_HOUR, MAP_12_PM_TO_24_HOUR, MAP_24_HOUR_TO_12, PM } from "./constants/timePicker.constants.js";
2
+ import { default as default2 } from "./TimePicker.js";
3
3
  export {
4
4
  AM,
5
5
  CLOCK_MODES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-time-picker",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "TimePicker UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -42,13 +42,13 @@
42
42
  ],
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
- "@synerise/ds-dropdown": "^2.1.0",
46
- "@synerise/ds-icon": "^2.1.1",
47
- "@synerise/ds-input": "^2.0.4",
48
- "@synerise/ds-popover": "^2.0.1",
49
- "@synerise/ds-scrollbar": "^2.0.2",
50
- "@synerise/ds-tooltip": "^2.0.3",
51
- "@synerise/ds-typography": "^2.0.3",
45
+ "@synerise/ds-dropdown": "^2.1.1",
46
+ "@synerise/ds-icon": "^2.1.2",
47
+ "@synerise/ds-input": "^2.0.5",
48
+ "@synerise/ds-popover": "^2.0.2",
49
+ "@synerise/ds-scrollbar": "^2.0.3",
50
+ "@synerise/ds-tooltip": "^2.0.4",
51
+ "@synerise/ds-typography": "^2.0.4",
52
52
  "dayjs": "^1.8.19",
53
53
  "debounce": "^1.2.0",
54
54
  "lodash.range": "^3.2.0"
@@ -63,5 +63,5 @@
63
63
  "styled-components": "^5.3.3",
64
64
  "vitest": "4"
65
65
  },
66
- "gitHead": "71f08fdaba8e7b80731e29a03883dc6a33f2b9db"
66
+ "gitHead": "b1d905617dfb186b5d80966d63ce55bf29df743d"
67
67
  }