@epam/ai-dial-ui-kit 0.16.0-dev.20 → 0.16.0-dev.21

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,87 @@
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
+ import { useMemo as p, useRef as x, useEffect as h } from "react";
3
+ import { mergeClasses as b } from "../../../utils/merge-classes.js";
4
+ const g = Array.from({ length: 24 }, (n, r) => String(r).padStart(2, "0")), y = Array.from(
5
+ { length: 60 },
6
+ (n, r) => String(r).padStart(2, "0")
7
+ ), S = "flex w-full shrink-0 items-center justify-center rounded-lg px-3 py-2 dial-small-text text-primary hover:bg-control-accent-alpha-hover focus:outline-hidden focus-visible:outline focus-visible:outline-focus", v = "bg-control-accent text-control-permanent hover:bg-control-accent", u = ({
8
+ label: n,
9
+ options: r,
10
+ selected: l,
11
+ onSelect: s
12
+ }) => {
13
+ const t = x(null);
14
+ h(() => {
15
+ const e = t.current, o = e?.querySelector('[aria-selected="true"]');
16
+ !e || !o || (e.scrollTop = o.offsetTop - e.clientHeight / 2 + o.offsetHeight / 2);
17
+ }, []);
18
+ const f = (e) => {
19
+ const o = Array.from(
20
+ e.currentTarget.querySelectorAll("button")
21
+ ), a = o.indexOf(document.activeElement), i = {
22
+ ArrowDown: o[a + 1],
23
+ ArrowUp: o[a - 1],
24
+ Home: o[0],
25
+ End: o[o.length - 1]
26
+ }[e.key];
27
+ i && (e.preventDefault(), i.focus());
28
+ }, m = l ?? r[0];
29
+ return /* @__PURE__ */ c(
30
+ "div",
31
+ {
32
+ ref: t,
33
+ role: "listbox",
34
+ "aria-label": n,
35
+ tabIndex: -1,
36
+ className: "flex h-56 flex-1 flex-col gap-0.5 overflow-y-auto",
37
+ onKeyDown: f,
38
+ children: r.map((e) => /* @__PURE__ */ c(
39
+ "button",
40
+ {
41
+ type: "button",
42
+ role: "option",
43
+ "aria-selected": e === l,
44
+ tabIndex: e === m ? 0 : -1,
45
+ className: b(
46
+ S,
47
+ e === l && v
48
+ ),
49
+ onClick: () => s(e),
50
+ children: e
51
+ },
52
+ e
53
+ ))
54
+ }
55
+ );
56
+ }, T = ({
57
+ value: n,
58
+ onSelect: r
59
+ }) => {
60
+ const [l, s] = p(() => {
61
+ const t = /^(\d{2}):(\d{2})$/.exec(n);
62
+ return t ? [t[1], t[2]] : [void 0, void 0];
63
+ }, [n]);
64
+ return /* @__PURE__ */ d("div", { className: "flex w-[168px] gap-1", children: [
65
+ /* @__PURE__ */ c(
66
+ u,
67
+ {
68
+ label: "Hours",
69
+ options: g,
70
+ selected: l,
71
+ onSelect: (t) => r(`${t}:${s ?? "00"}`, !1)
72
+ }
73
+ ),
74
+ /* @__PURE__ */ c(
75
+ u,
76
+ {
77
+ label: "Minutes",
78
+ options: y,
79
+ selected: s,
80
+ onSelect: (t) => r(`${l ?? "00"}:${t}`, !0)
81
+ }
82
+ )
83
+ ] });
84
+ };
85
+ export {
86
+ T as TimePickerPanel
87
+ };
@@ -1,57 +1,59 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { IconChevronRight as o, IconChevronLeft as n, IconCalendar as l } from "@tabler/icons-react";
3
- import { DIAL_KIT_ICON_STROKE as r } from "../constants/icon.js";
4
- import { DIAL_ICON_SIZE as t } from "../../../constants/icon.js";
2
+ import { IconChevronRight as o, IconChevronLeft as l, IconCalendar as n } from "@tabler/icons-react";
3
+ import { DIAL_KIT_ICON_STROKE as t } from "../constants/icon.js";
4
+ import { DIAL_ICON_SIZE as r } from "../../../constants/icon.js";
5
5
  import { CalendarMode as e } from "../../../types/calendar.js";
6
- const u = "en-GB", f = {
6
+ const p = "en-GB", f = {
7
7
  [e.Date]: "Select date",
8
8
  [e.DateTime]: "Select date and time",
9
9
  [e.Time]: "--:--",
10
10
  [e.Weekday]: "Select day"
11
- }, x = (
11
+ }, b = (
12
12
  // TODO: check after design review for input
13
13
  "flex w-full items-center justify-between gap-2 rounded-xl border border-secondary bg-layer-raised px-4 py-3 dial-small-text text-primary outline-hidden transition-colors hover:border-accent-alpha focus-within:border-accent-focus"
14
14
  ), y = (
15
15
  // TODO: check after design review for input
16
16
  "!cursor-not-allowed !border-transparent bg-layer-sunken text-control-disable-primary hover:!border-transparent"
17
- ), b = "!border-error", h = "z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md", C = "flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus", N = "bg-control-accent text-control-permanent", v = "text-accent dial-small-semi-text", D = "text-control-disable-primary", s = "text-secondary", I = /* @__PURE__ */ a(
18
- l,
17
+ ), x = "!border-error", h = "z-floating flex w-[248px] flex-col gap-4 rounded-lg bg-layer-raised px-2 py-4 shadow-md", v = "z-floating rounded-lg bg-layer-raised p-2 shadow-md", C = "absolute end-2 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-lg text-secondary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus disabled:cursor-not-allowed disabled:text-control-disable-primary disabled:hover:bg-transparent", g = "flex size-10 items-center justify-center rounded-full dial-small-text text-primary hover:bg-control-accent-alpha-hover hover:text-primary focus:outline-hidden focus-visible:outline focus-visible:outline-focus", N = "bg-control-accent text-control-permanent", D = "text-accent dial-small-semi-text", I = "text-control-disable-primary", s = "text-secondary", w = /* @__PURE__ */ a(
18
+ n,
19
19
  {
20
- size: t.MD,
21
- stroke: r,
20
+ size: r.MD,
21
+ stroke: t,
22
22
  "aria-hidden": "true",
23
23
  className: s
24
24
  }
25
- ), g = {
25
+ ), S = {
26
26
  prev: /* @__PURE__ */ a(
27
- n,
27
+ l,
28
28
  {
29
- size: t.SM,
30
- stroke: r,
29
+ size: r.SM,
30
+ stroke: t,
31
31
  "aria-hidden": "true"
32
32
  }
33
33
  ),
34
34
  next: /* @__PURE__ */ a(
35
35
  o,
36
36
  {
37
- size: t.SM,
38
- stroke: r,
37
+ size: r.SM,
38
+ stroke: t,
39
39
  "aria-hidden": "true"
40
40
  }
41
41
  )
42
42
  };
43
43
  export {
44
- u as DEFAULT_CALENDAR_LOCALE,
45
- C as calendarDayButtonBaseClassName,
46
- D as calendarDayOutsideClassName,
44
+ p as DEFAULT_CALENDAR_LOCALE,
45
+ g as calendarDayButtonBaseClassName,
46
+ I as calendarDayOutsideClassName,
47
47
  N as calendarDaySelectedClassName,
48
- v as calendarDayTodayClassName,
49
- x as calendarFieldBaseClassName,
48
+ D as calendarDayTodayClassName,
49
+ b as calendarFieldBaseClassName,
50
50
  y as calendarFieldDisabledClassName,
51
51
  s as calendarFieldIconClassName,
52
- b as calendarFieldInvalidClassName,
53
- I as calendarIcon,
52
+ x as calendarFieldInvalidClassName,
53
+ w as calendarIcon,
54
54
  f as calendarModeDefaultPlaceholder,
55
- g as calendarNavIcons,
56
- h as calendarPopoverClassName
55
+ S as calendarNavIcons,
56
+ h as calendarPopoverClassName,
57
+ C as timePickerButtonClassName,
58
+ v as timePickerPopoverClassName
57
59
  };
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.16.0-dev.20",
3
- "generatedAt": "2026-10-20T10:24:28.217Z",
2
+ "version": "0.16.0-dev.21",
3
+ "generatedAt": "2026-10-20T14:10:43.721Z",
4
4
  "kit": {
5
5
  "name": "@epam/ai-dial-ui-kit",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",
@@ -423,7 +423,7 @@
423
423
  },
424
424
  {
425
425
  "name": "Calendar",
426
- "category": "Components_2_0",
426
+ "category": "Components_2_0/Calendar",
427
427
  "generation": "2.0",
428
428
  "description": "A date/time picker supporting four selection modes.\naliases: DatePicker|DateTimePicker\nDesign system 2.0\n\nRenders a text-field trigger that opens a rounded month-grid popover for\nthe `date`/`datetime` modes, a masked `\"HH:mm\"` text field for `time`, and\na popover list of weekday names for `weekday`. Month/weekday names and\ndate formatting are localized via the `locale` prop.",
429
429
  "props": [
@@ -521,6 +521,13 @@
521
521
  "required": false,
522
522
  "defaultValue": "false",
523
523
  "description": "Shows the viewer's timezone (e.g. `(GMT+01:00) Europe/Berlin`) at the trailing edge of the time fields (`time` mode and the `datetime` popover footer)"
524
+ },
525
+ {
526
+ "name": "showTimePicker",
527
+ "type": "boolean",
528
+ "required": false,
529
+ "defaultValue": "true",
530
+ "description": "`time` mode only: shows a clock button that opens an hour/minute list popover next to the typeable field"
524
531
  }
525
532
  ],
526
533
  "examples": [