@synerise/ds-time-picker 1.1.29 → 1.2.0

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,17 @@
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
+ # [1.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-time-picker@1.1.29...@synerise/ds-time-picker@1.2.0) (2025-11-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * **dropdown:** dropdownMenu component ([f0ec827](https://github.com/Synerise/synerise-design/commit/f0ec82792cdcb021fa9a454912f6e7a892e53895))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.1.29](https://github.com/Synerise/synerise-design/compare/@synerise/ds-time-picker@1.1.28...@synerise/ds-time-picker@1.1.29) (2025-10-31)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-time-picker
package/README.md CHANGED
@@ -45,5 +45,5 @@ import TimePicker from '@synerise/ds-time-picker'
45
45
  | use12HourClock | use 12 hour clock instead of 24 | boolean | - |
46
46
  | placeholder | Placeholder of Timepicker input | `string` | `Select time` |
47
47
  | timeFormat | format of date displayed in input (see: https://github.com/iamkun/dayjs/blob/dev/docs/en/API-reference.md#list-of-all-available-formats) | string | `'HH:mm:ss'` |
48
- | trigger | trigger that opens the dropdown | ['click'] / ['hover'] / ['contextMenu'] | ['click'] |
48
+ | trigger | trigger that opens the dropdown | ['click'] / ['hover'] | ['click'] |
49
49
  | value | selected value | Date | - |
@@ -5,6 +5,7 @@ import { range } from 'lodash';
5
5
  import React, { Fragment, useCallback, useMemo, useState } from 'react';
6
6
  import { FormattedMessage, useIntl } from 'react-intl';
7
7
  import { useDataFormat } from '@synerise/ds-core';
8
+ import Dropdown from '@synerise/ds-dropdown';
8
9
  import Icon, { ClockM, Close3S } from '@synerise/ds-icon';
9
10
  import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
10
11
  import * as S from './TimePicker.styles';
@@ -196,13 +197,15 @@ var TimePicker = function TimePicker(_ref) {
196
197
  className: "ds-time-picker " + (className || ''),
197
198
  "data-testid": "tp-container",
198
199
  style: containerStyle
199
- }, /*#__PURE__*/React.createElement(S.Dropdown, _extends({
200
+ }, /*#__PURE__*/React.createElement(Dropdown, _extends({
200
201
  trigger: trigger,
201
202
  open: alwaysOpen || open,
202
203
  onOpenChange: onVisibleChange,
203
204
  placement: placement,
204
205
  overlay: overlay,
205
- disabled: disabled
206
+ disabled: disabled,
207
+ asChild: true,
208
+ size: "match-trigger"
206
209
  }, dropdownProps), /*#__PURE__*/React.createElement(S.TimePickerInput, _extends({
207
210
  errorText: !open && errorText,
208
211
  disabled: disabled,
@@ -1,14 +1,4 @@
1
- import { type ReactNode } from 'react';
2
- export declare const Dropdown: import("styled-components").StyledComponent<import("react").ComponentType<import("@synerise/ds-dropdown").DropdownProps> & {
3
- Wrapper: typeof import("@synerise/ds-dropdown/dist/Dropdown.styles").Wrapper;
4
- SearchInput: ({ value, className, onSearchChange, onClearInput, placeholder, iconLeft, autofocus, clearTooltip, disabled, borderRadius, handleInputRef, autofocusDelay, clearTooltipProps, valuePrefix, ...htmlAttributes }: import("@synerise/ds-search-bar").SearchBarProps) => React.JSX.Element;
5
- BottomAction: ({ onClickAction, children, icon, ...rest }: import("@synerise/ds-dropdown/dist/elements/BottomAction/BottomAction.types").BottomActionProps) => React.JSX.Element;
6
- BackAction: ({ label, onClick, tooltip, tooltipProps }: import("@synerise/ds-dropdown/dist/elements/BackAction/BackAction.types").Props) => React.JSX.Element;
7
- Button: import("react").ComponentClass<import("antd/lib/dropdown").DropdownButtonProps, any> | import("react").FunctionComponent<import("antd/lib/dropdown").DropdownButtonProps>;
8
- TextTrigger: import("react").FC<import("@synerise/ds-dropdown/dist/elements/TextTrigger/TextTrigger.types").TextTriggerProps>;
9
- }, any, {
10
- children?: ReactNode;
11
- }, never>;
1
+ import React from 'react';
12
2
  export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
13
3
  export declare const OverlayContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
14
4
  export declare const Unit: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -17,8 +7,25 @@ export declare const CellText: import("styled-components").StyledComponent<"labe
17
7
  export declare const Cell: import("styled-components").StyledComponent<"button", any, {
18
8
  active?: boolean;
19
9
  }, never>;
20
- export declare const ClearIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
21
- export declare const TimePickerInput: import("styled-components").StyledComponent<({ className, errorText, label, description, counterLimit, tooltip, tooltipConfig, icon1, icon1Tooltip, autoResize, icon2, icon2Tooltip, resetMargin, handleInputRef, prefixel, suffixel, error, expandable, expandableTooltip, renderCustomCounter, autoResizeProps, ...antdInputProps }: import("@synerise/ds-input").InputProps) => React.JSX.Element, any, {}, never>;
10
+ export declare const ClearIcon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("@synerise/ds-icon").BaseIconProps & Omit<React.HTMLAttributes<HTMLDivElement>, keyof import("@synerise/ds-icon").BaseIconProps> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<HTMLDivElement>>, any, {}, never>;
11
+ export declare const TimePickerInput: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<{
12
+ error?: boolean;
13
+ className?: string;
14
+ counterLimit?: number;
15
+ renderCustomCounter?: (count?: number) => React.ReactNode;
16
+ icon1?: React.ReactElement;
17
+ icon1Tooltip?: React.ReactElement;
18
+ icon2?: React.ReactElement;
19
+ icon2Tooltip?: React.ReactElement;
20
+ resetMargin?: boolean;
21
+ handleInputRef?: ((ref: React.MutableRefObject<HTMLInputElement | null>) => void) | undefined;
22
+ prefixel?: React.ReactNode;
23
+ suffixel?: React.ReactNode;
24
+ autoResize?: import("@synerise/ds-input").AutoResizeProp;
25
+ autoResizeProps?: Partial<Pick<import("@synerise/ds-input").AutosizeInputProps, "placeholderIsMinWidth" | "wrapperClassName" | "wrapperStyle" | "extraWidth">>;
26
+ expandable?: boolean;
27
+ expandableTooltip?: React.ReactNode;
28
+ } & Omit<import("@synerise/ds-form-field").ContentAboveProps, "id" | "rightSide"> & import("@synerise/ds-form-field").ContentBelowProps & import("antd/lib/input").InputProps & React.RefAttributes<HTMLInputElement>>, any, {}, never>;
22
29
  export declare const PlaceholderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
23
30
  export declare const Placeholder: import("styled-components").StyledComponent<"div", any, {
24
31
  height: number;
@@ -1,41 +1,39 @@
1
+ function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ import React, { forwardRef } from 'react';
1
4
  import styled, { css } from 'styled-components';
2
- import DSDropdown from '@synerise/ds-dropdown';
3
5
  import Icon from '@synerise/ds-icon';
4
6
  import { Input } from '@synerise/ds-input';
5
7
  import { Label } from '@synerise/ds-typography';
6
- export var Dropdown = styled(DSDropdown).withConfig({
7
- displayName: "TimePickerstyles__Dropdown",
8
- componentId: "sc-yk19n0-0"
9
- })(["margin:0;"]);
10
8
  export var Container = styled.div.withConfig({
11
9
  displayName: "TimePickerstyles__Container",
12
- componentId: "sc-yk19n0-1"
10
+ componentId: "sc-5k0z0v-0"
13
11
  })(["min-width:104px;max-width:208px;width:inherit;position:relative;"]);
14
12
  export var OverlayContainer = styled.div.withConfig({
15
13
  displayName: "TimePickerstyles__OverlayContainer",
16
- componentId: "sc-yk19n0-2"
14
+ componentId: "sc-5k0z0v-1"
17
15
  })(["background-color:", ";border-radius:3px;display:flex;flex-direction:row;flex-wrap:nowrap;overflow:hidden;"], function (props) {
18
16
  return props.theme.palette.white;
19
17
  });
20
18
  export var Unit = styled.div.withConfig({
21
19
  displayName: "TimePickerstyles__Unit",
22
- componentId: "sc-yk19n0-3"
20
+ componentId: "sc-5k0z0v-2"
23
21
  })(["display:flex;flex-direction:column;width:100%;overflow:hidden;.scrollbar-container{margin-right:-11px;}"]);
24
22
  export var UnitSeperator = styled.div.withConfig({
25
23
  displayName: "TimePickerstyles__UnitSeperator",
26
- componentId: "sc-yk19n0-4"
24
+ componentId: "sc-5k0z0v-3"
27
25
  })(["width:1px;height:inherit;display:flex;flex-shrink:0;background-color:", ";"], function (props) {
28
26
  return props.theme.palette['grey-200'];
29
27
  });
30
28
  export var CellText = styled(Label).withConfig({
31
29
  displayName: "TimePickerstyles__CellText",
32
- componentId: "sc-yk19n0-5"
30
+ componentId: "sc-5k0z0v-4"
33
31
  })(["&&{width:22px;height:18px;text-align:center;color:", ";transition:color 0.3s;}"], function (props) {
34
32
  return props.theme.palette['grey-600'];
35
33
  });
36
34
  export var Cell = styled.button.withConfig({
37
35
  displayName: "TimePickerstyles__Cell",
38
- componentId: "sc-yk19n0-6"
36
+ componentId: "sc-5k0z0v-5"
39
37
  })(["height:32px;width:100%;text-align:center;display:flex;flex-shrink:0;align-items:center;justify-content:center;transition:background-color 0.3s;cursor:pointer;background-color:", ";&&{border:none;padding:0;}&:hover{background-color:", ";", "{color:", ";}}&:disabled{&&{cursor:not-allowed;background-color:", ";", "}", "{cursor:not-allowed;opacity:0.4;}}", ";"], function (props) {
40
38
  return props.theme.palette.white;
41
39
  }, function (props) {
@@ -51,27 +49,32 @@ export var Cell = styled.button.withConfig({
51
49
  });
52
50
  export var ClearIcon = styled(Icon).withConfig({
53
51
  displayName: "TimePickerstyles__ClearIcon",
54
- componentId: "sc-yk19n0-7"
52
+ componentId: "sc-5k0z0v-6"
55
53
  })(["&&,&&:hover{svg{color:", ";fill:", ";}}"], function (props) {
56
54
  return props.theme.palette['red-600'];
57
55
  }, function (props) {
58
56
  return props.theme.palette['red-600'];
59
57
  });
60
- export var TimePickerInput = styled(Input).withConfig({
58
+ export var TimePickerInput = styled(/*#__PURE__*/forwardRef(function (_ref, ref) {
59
+ var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
60
+ return /*#__PURE__*/React.createElement(Input, _extends({
61
+ ref: ref
62
+ }, props));
63
+ })).withConfig({
61
64
  displayName: "TimePickerstyles__TimePickerInput",
62
- componentId: "sc-yk19n0-8"
63
- })(["&:not(.active){input{&:focus{box-shadow:none;background-color:", ";border-color:", ";}}}"], function (props) {
65
+ componentId: "sc-5k0z0v-7"
66
+ })(["margin-bottom:0;&:not(.active){input{&:focus{box-shadow:none;background-color:", ";border-color:", ";}}}"], function (props) {
64
67
  return props.theme.palette.white;
65
68
  }, function (props) {
66
69
  return props.theme.palette['grey-300'];
67
70
  });
68
71
  export var PlaceholderWrapper = styled.div.withConfig({
69
72
  displayName: "TimePickerstyles__PlaceholderWrapper",
70
- componentId: "sc-yk19n0-9"
73
+ componentId: "sc-5k0z0v-8"
71
74
  })(["width:100%;position:relative;"]);
72
75
  export var Placeholder = styled.div.withConfig({
73
76
  displayName: "TimePickerstyles__Placeholder",
74
- componentId: "sc-yk19n0-10"
77
+ componentId: "sc-5k0z0v-9"
75
78
  })(["height:", "px;"], function (props) {
76
79
  return props.height;
77
80
  });
@@ -1,8 +1,9 @@
1
1
  import type dayjs from 'dayjs';
2
2
  import type { CSSProperties, ReactNode } from 'react';
3
3
  import type { DateToFormatOptions } from '@synerise/ds-core';
4
- import type { DropdownProps } from '@synerise/ds-dropdown';
4
+ import type { DropdownSharedProps } from '@synerise/ds-dropdown';
5
5
  import type { InputProps } from '@synerise/ds-input';
6
+ import { type PopoverTriggerType } from '@synerise/ds-popover';
6
7
  export type ClockModes = 'AM' | 'PM';
7
8
  export type TimePickerDisabledUnits = {
8
9
  disabledSeconds?: number[];
@@ -16,7 +17,7 @@ export type TimePickerProps = TimePickerDisabledUnits & {
16
17
  containerStyle?: CSSProperties;
17
18
  defaultOpen?: boolean;
18
19
  disabled?: boolean;
19
- dropdownProps?: Partial<DropdownProps>;
20
+ dropdownProps?: Partial<Omit<DropdownSharedProps, 'children' | 'overlay' | 'open' | 'onOpenChange' | 'disabled'>>;
20
21
  inputProps?: Partial<InputProps>;
21
22
  onChange?: (value: Date | undefined, timeString: string) => void;
22
23
  onClockModeChange?: (mode: string) => void;
@@ -28,7 +29,7 @@ export type TimePickerProps = TimePickerDisabledUnits & {
28
29
  * @deprecated use `valueFormatOptions` instead
29
30
  */
30
31
  timeFormat?: string;
31
- trigger?: ('click' | 'hover' | 'contextMenu')[];
32
+ trigger?: PopoverTriggerType[];
32
33
  units?: dayjs.UnitType[];
33
34
  /**
34
35
  * @deprecated use DSProvider::dataFormatConfig instead
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-time-picker",
3
- "version": "1.1.29",
3
+ "version": "1.2.0",
4
4
  "description": "TimePicker UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,12 +35,12 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-dropdown": "^1.0.34",
39
- "@synerise/ds-icon": "^1.7.3",
40
- "@synerise/ds-input": "^1.4.2",
41
- "@synerise/ds-scrollbar": "^1.1.9",
42
- "@synerise/ds-tooltip": "^1.2.1",
43
- "@synerise/ds-typography": "^1.0.22",
38
+ "@synerise/ds-dropdown": "^1.1.0",
39
+ "@synerise/ds-icon": "^1.8.0",
40
+ "@synerise/ds-input": "^1.5.0",
41
+ "@synerise/ds-scrollbar": "^1.2.0",
42
+ "@synerise/ds-tooltip": "^1.3.0",
43
+ "@synerise/ds-typography": "^1.0.23",
44
44
  "dayjs": "^1.8.19",
45
45
  "debounce": "^1.2.0",
46
46
  "lodash": "^4.17.21"
@@ -52,5 +52,5 @@
52
52
  "react-intl": ">=3.12.0 <= 6.8",
53
53
  "styled-components": "^5.3.3"
54
54
  },
55
- "gitHead": "73989f3707121812fcd54f3e89e80f6228298689"
55
+ "gitHead": "cbbb7d9f155735bcc4035d8fd8a7813878d6e051"
56
56
  }