@clickhouse/click-ui 0.0.169 → 0.0.171

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.
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
8
- import { keyframes, styled, useTheme, createGlobalStyle, ThemeProvider as ThemeProvider$1 } from "styled-components";
8
+ import styled$1, { keyframes, styled, useTheme, createGlobalStyle, ThemeProvider as ThemeProvider$1 } from "styled-components";
9
9
  import * as React from "react";
10
10
  import React__default, { forwardRef, useCallback, createContext, useMemo, createElement as createElement$1, useContext, useRef, useEffect, useState, Children, isValidElement, cloneElement, Fragment, useLayoutEffect, useReducer, useId, PureComponent, Component, memo } from "react";
11
11
  import * as ReactDOM from "react-dom";
@@ -217,6 +217,7 @@ const FolderOpen = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w
217
217
  ] });
218
218
  const FolderClosed = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeWidth: 1.5, d: "M19 19H3C2.44772 19 2 18.5523 2 18V6C2 5.44772 2.44772 5 3 5H6.62869C6.98835 5 7.32032 5.19315 7.49805 5.50583L8.34405 6.99417C8.52179 7.30685 8.85375 7.5 9.21342 7.5H19C19.5523 7.5 20 7.94772 20 8.5V9.5V18C20 18.5523 19.5523 19 19 19Z" }) });
219
219
  const Gift = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx("path", { fill: "#161517", stroke: "#161517", strokeWidth: 0.6, d: "M19.306 6.276h-3.704a2.52 2.52 0 0 0 .752-1.805C16.354 3.11 15.296 2 13.997 2c-.937 0-1.745.578-2.125 1.41-.386-.56-1.013-.928-1.722-.928-1.172 0-2.126 1-2.126 2.23 0 .61.234 1.161.612 1.564H4.694C3.76 6.276 3 7.073 3 8.053v1.285c0 .919.67 1.677 1.523 1.767v8.64c0 1.244.964 2.255 2.15 2.255h10.655c1.185 0 2.149-1.011 2.149-2.254v-8.641c.854-.09 1.523-.848 1.523-1.767V8.052c0-.979-.76-1.776-1.694-1.776Zm-7.03-1.805c0-.995.772-1.804 1.721-1.804.949 0 1.72.81 1.72 1.804 0 .996-.771 1.805-1.72 1.805h-1.72V4.471Zm-3.617.242c0-.862.669-1.564 1.49-1.564.823 0 1.492.702 1.492 1.564v1.563H10.15c-.822 0-1.49-.701-1.49-1.563ZM3.635 9.338V8.052c0-.611.475-1.11 1.058-1.11h5.457l1.532.001v3.504H4.693c-.583 0-1.058-.498-1.058-1.11ZM5.16 19.746v-8.632h6.523v10.22h-5.01c-.834 0-1.513-.713-1.513-1.588Zm13.682 0c0 .875-.679 1.588-1.514 1.588h-5.01v-10.22h6.525v8.632Zm1.523-10.408c0 .612-.474 1.11-1.057 1.11h-6.99V6.942h6.99c.583 0 1.058.498 1.058 1.11v1.285Z" }) });
220
+ const Globe = (props) => /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx("path", { d: "M21 12C21 16.9706 16.9706 21 12 21M21 12C21 7.02944 16.9706 3 12 3M21 12H3M12 21C7.02944 21 3 16.9706 3 12M12 21C14.2512 18.5355 15.5305 15.3372 15.6 12C15.5305 8.66283 14.2512 5.46452 12 3M12 21C9.74885 18.5355 8.46952 15.3372 8.4 12C8.46952 8.66283 9.74885 5.46452 12 3M3 12C3 7.02944 7.02944 3 12 3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
220
221
  const Home = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: [
221
222
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M4 8.6V21h16V8.6" }),
222
223
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "m2 10 10-7 10 7M15 21v-6a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v6" })
@@ -389,8 +390,13 @@ const Speed = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org
389
390
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12.007 10.313A1.69 1.69 0 0 1 13.688 12v.008a1.689 1.689 0 1 1-1.681-1.695M10.807 13.194l-1.25 1.25M16.202 7.798 13.201 10.8" }),
390
391
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M18.367 5.634A9.004 9.004 0 1 1 12 2.997v3" })
391
392
  ] });
393
+ const Square = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx("rect", { x: "3.75", y: "3.75", width: "16.5", height: "16.5", rx: "1.25", stroke: "white", strokeWidth: "1.5" }) });
392
394
  const Star = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 2.896L14.935 8.889L21.5 9.856L16.75 14.518L17.871 21.104L12 17.993L6.129 21.104L7.25 14.518L2.5 9.856L9.064 8.889L12 2.896Z", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
393
- const Stop = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx("rect", { x: "3.75", y: "3.75", width: "16.5", height: "16.5", rx: "1.25", stroke: "white", strokeWidth: "1.5" }) });
395
+ const Stop = (props) => /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
396
+ /* @__PURE__ */ jsx("mask", { id: "path-1-inside-1_9731_929", fill: "white", children: /* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "6", height: "6", rx: "0.4" }) }),
397
+ /* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "6", height: "6", rx: "0.4", fill: "white", stroke: "white", strokeWidth: "3", mask: "url(#path-1-inside-1_9731_929)" }),
398
+ /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 21V21C7.029 21 3 16.971 3 12V12C3 7.029 7.029 3 12 3V3C16.971 3 21 7.029 21 12V12C21 16.971 16.971 21 12 21Z", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
399
+ ] });
394
400
  const Support = (props) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...props, children: [
395
401
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M16 18H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2Z", clipRule: "evenodd" }),
396
402
  /* @__PURE__ */ jsx("path", { stroke: "#161517", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M10.467 11.504v-.207c0-.678.419-1.045.839-1.327.41-.276.82-.636.82-1.3a1.659 1.659 0 0 0-3.318 0M10.466 13.843a.148.148 0 0 0-.15.15.15.15 0 1 0 .15-.15" }),
@@ -589,7 +595,7 @@ const SandGlass = (props) => /* @__PURE__ */ jsxs("svg", { width: "24", height:
589
595
  /* @__PURE__ */ jsx("path", { d: "M8 4V8C8 8.63 8.296 9.222 8.8 9.6L12 12L15.2 9.6C15.704 9.222 16 8.63 16 8V4", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
590
596
  /* @__PURE__ */ jsx("path", { d: "M16 20V16C16 15.37 15.704 14.778 15.2 14.4L12 12L8.8 14.4C8.296 14.778 8 15.37 8 16V20", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
591
597
  ] });
592
- const Calendar = (props) => /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
598
+ const Calendar$1 = (props) => /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
593
599
  /* @__PURE__ */ jsx("rect", { x: "2.99609", y: "2.99658", width: "18.0075", height: "18.0075", rx: "3", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
594
600
  /* @__PURE__ */ jsx("path", { d: "M21.0036 7.99826H2.99609", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
595
601
  /* @__PURE__ */ jsx("path", { d: "M17.3022 11.4997C17.3022 11.5273 17.2798 11.5497 17.2522 11.5497C17.2245 11.5497 17.2021 11.5273 17.2021 11.4997C17.2021 11.4721 17.2245 11.4497 17.2522 11.4497", stroke: "#161517", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
@@ -688,7 +694,7 @@ const ICONS_MAP = {
688
694
  briefcase: Briefcase,
689
695
  building: Building,
690
696
  "burger-menu": BurgerMenu,
691
- calendar: Calendar,
697
+ calendar: Calendar$1,
692
698
  "calendar-with-time": CalendarWithTime,
693
699
  cards: Cards,
694
700
  "cell-tower": CellTower,
@@ -738,6 +744,7 @@ const ICONS_MAP = {
738
744
  "folder-open": FolderOpen,
739
745
  gear: Gear,
740
746
  gift: Gift,
747
+ globe: Globe,
741
748
  "git-merge": GitMerge,
742
749
  history: HistoryIcon,
743
750
  home: Home,
@@ -791,6 +798,7 @@ const ICONS_MAP = {
791
798
  sparkle: Sparkle,
792
799
  speaker: Speaker,
793
800
  speed: Speed,
801
+ square: Square,
794
802
  star: Star,
795
803
  stop: Stop,
796
804
  support: Support,
@@ -12454,14 +12462,14 @@ function listLanguages() {
12454
12462
  return high.listLanguages();
12455
12463
  }
12456
12464
  function registerAlias(name2, alias) {
12457
- var map = name2;
12465
+ var map2 = name2;
12458
12466
  var key;
12459
12467
  if (alias) {
12460
- map = {};
12461
- map[name2] = alias;
12468
+ map2 = {};
12469
+ map2[name2] = alias;
12462
12470
  }
12463
- for (key in map) {
12464
- high.registerAliases(map[key], { languageName: key });
12471
+ for (key in map2) {
12472
+ high.registerAliases(map2[key], { languageName: key });
12465
12473
  }
12466
12474
  }
12467
12475
  function Emitter(options) {
@@ -13678,6 +13686,778 @@ const CodeBlock = ({
13678
13686
  }, showLineNumbers, wrapLines: wrap || wrapLines, wrapLongLines: wrap || wrapLines, children })
13679
13687
  ] });
13680
13688
  };
13689
+ const constructFromSymbol = Symbol.for("constructDateFrom");
13690
+ function constructFrom(date, value) {
13691
+ if (typeof date === "function")
13692
+ return date(value);
13693
+ if (date && typeof date === "object" && constructFromSymbol in date)
13694
+ return date[constructFromSymbol](value);
13695
+ if (date instanceof Date)
13696
+ return new date.constructor(value);
13697
+ return new Date(value);
13698
+ }
13699
+ function toDate(argument, context) {
13700
+ return constructFrom(context || argument, argument);
13701
+ }
13702
+ function addDays(date, amount, options) {
13703
+ const _date = toDate(date, options == null ? void 0 : options.in);
13704
+ if (isNaN(amount))
13705
+ return constructFrom(date, NaN);
13706
+ if (!amount)
13707
+ return _date;
13708
+ _date.setDate(_date.getDate() + amount);
13709
+ return _date;
13710
+ }
13711
+ function addMonths(date, amount, options) {
13712
+ const _date = toDate(date, options == null ? void 0 : options.in);
13713
+ if (isNaN(amount))
13714
+ return constructFrom(date, NaN);
13715
+ if (!amount) {
13716
+ return _date;
13717
+ }
13718
+ const dayOfMonth = _date.getDate();
13719
+ const endOfDesiredMonth = constructFrom(date, _date.getTime());
13720
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
13721
+ const daysInMonth = endOfDesiredMonth.getDate();
13722
+ if (dayOfMonth >= daysInMonth) {
13723
+ return endOfDesiredMonth;
13724
+ } else {
13725
+ _date.setFullYear(
13726
+ endOfDesiredMonth.getFullYear(),
13727
+ endOfDesiredMonth.getMonth(),
13728
+ dayOfMonth
13729
+ );
13730
+ return _date;
13731
+ }
13732
+ }
13733
+ function isWeekend(date, options) {
13734
+ const day = toDate(date, options == null ? void 0 : options.in).getDay();
13735
+ return day === 0 || day === 6;
13736
+ }
13737
+ let defaultOptions = {};
13738
+ function getDefaultOptions() {
13739
+ return defaultOptions;
13740
+ }
13741
+ function startOfWeek(date, options) {
13742
+ var _a, _b, _c, _d;
13743
+ const defaultOptions2 = getDefaultOptions();
13744
+ const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
13745
+ const _date = toDate(date, options == null ? void 0 : options.in);
13746
+ const day = _date.getDay();
13747
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
13748
+ _date.setDate(_date.getDate() - diff);
13749
+ _date.setHours(0, 0, 0, 0);
13750
+ return _date;
13751
+ }
13752
+ function normalizeDates(context, ...dates) {
13753
+ const normalize = constructFrom.bind(
13754
+ null,
13755
+ dates.find((date) => typeof date === "object")
13756
+ );
13757
+ return dates.map(normalize);
13758
+ }
13759
+ function addWeeks(date, amount, options) {
13760
+ return addDays(date, amount * 7, options);
13761
+ }
13762
+ function startOfMonth(date, options) {
13763
+ const _date = toDate(date, options == null ? void 0 : options.in);
13764
+ _date.setDate(1);
13765
+ _date.setHours(0, 0, 0, 0);
13766
+ return _date;
13767
+ }
13768
+ function getDate(date, options) {
13769
+ return toDate(date, options == null ? void 0 : options.in).getDate();
13770
+ }
13771
+ function getDay(date, options) {
13772
+ return toDate(date, options == null ? void 0 : options.in).getDay();
13773
+ }
13774
+ function getDaysInMonth(date, options) {
13775
+ const _date = toDate(date, options == null ? void 0 : options.in);
13776
+ const year = _date.getFullYear();
13777
+ const monthIndex = _date.getMonth();
13778
+ const lastDayOfMonth = constructFrom(_date, 0);
13779
+ lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);
13780
+ lastDayOfMonth.setHours(0, 0, 0, 0);
13781
+ return lastDayOfMonth.getDate();
13782
+ }
13783
+ function isEqual$1(leftDate, rightDate) {
13784
+ return +toDate(leftDate) === +toDate(rightDate);
13785
+ }
13786
+ function setDay(date, day, options) {
13787
+ var _a, _b;
13788
+ const defaultOptions2 = getDefaultOptions();
13789
+ const weekStartsOn = defaultOptions2.weekStartsOn ?? ((_b = (_a = defaultOptions2.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? 0;
13790
+ const date_ = toDate(date, options == null ? void 0 : options.in);
13791
+ const currentDay = date_.getDay();
13792
+ const remainder = day % 7;
13793
+ const dayIndex = (remainder + 7) % 7;
13794
+ const delta = 7 - weekStartsOn;
13795
+ const diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;
13796
+ return addDays(date_, diff, options);
13797
+ }
13798
+ function isSameMonth(laterDate, earlierDate, options) {
13799
+ const [laterDate_, earlierDate_] = normalizeDates(
13800
+ options == null ? void 0 : options.in,
13801
+ laterDate,
13802
+ earlierDate
13803
+ );
13804
+ return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
13805
+ }
13806
+ function isSameYear(laterDate, earlierDate, options) {
13807
+ const [laterDate_, earlierDate_] = normalizeDates(
13808
+ options == null ? void 0 : options.in,
13809
+ laterDate,
13810
+ earlierDate
13811
+ );
13812
+ return laterDate_.getFullYear() === earlierDate_.getFullYear();
13813
+ }
13814
+ function subDays(date, amount, options) {
13815
+ return addDays(date, -amount, options);
13816
+ }
13817
+ function setHours(date, hours, options) {
13818
+ const _date = toDate(date, options == null ? void 0 : options.in);
13819
+ _date.setHours(hours);
13820
+ return _date;
13821
+ }
13822
+ function setMilliseconds(date, milliseconds, options) {
13823
+ const _date = toDate(date, options == null ? void 0 : options.in);
13824
+ _date.setMilliseconds(milliseconds);
13825
+ return _date;
13826
+ }
13827
+ function setMinutes(date, minutes, options) {
13828
+ const date_ = toDate(date, options == null ? void 0 : options.in);
13829
+ date_.setMinutes(minutes);
13830
+ return date_;
13831
+ }
13832
+ function setSeconds(date, seconds, options) {
13833
+ const _date = toDate(date, options == null ? void 0 : options.in);
13834
+ _date.setSeconds(seconds);
13835
+ return _date;
13836
+ }
13837
+ function subMonths(date, amount, options) {
13838
+ return addMonths(date, -amount, options);
13839
+ }
13840
+ function subWeeks(date, amount, options) {
13841
+ return addWeeks(date, -amount, options);
13842
+ }
13843
+ var CalendarViewtype = /* @__PURE__ */ ((CalendarViewtype2) => {
13844
+ CalendarViewtype2["Month"] = "month";
13845
+ CalendarViewtype2["Week"] = "week";
13846
+ CalendarViewtype2["Day"] = "day";
13847
+ return CalendarViewtype2;
13848
+ })(CalendarViewtype || {});
13849
+ var CalendarViewType_default = CalendarViewtype;
13850
+ function arrayOf(count) {
13851
+ return [...new Array(count).keys()];
13852
+ }
13853
+ var randomId = 0;
13854
+ var map = /* @__PURE__ */ new Map();
13855
+ function generateID(prefix2) {
13856
+ if (map.has(prefix2)) {
13857
+ const id = map.get(prefix2);
13858
+ const newId = id + 1;
13859
+ map.set(prefix2, newId);
13860
+ randomId = newId;
13861
+ } else {
13862
+ const id = 1;
13863
+ map.set(prefix2, id);
13864
+ randomId = id;
13865
+ }
13866
+ return `${prefix2}-${randomId}`;
13867
+ }
13868
+ function resetTimeOfDate(date) {
13869
+ return setHours(setMinutes(setSeconds(setMilliseconds(date, 0), 0), 0), 0);
13870
+ }
13871
+ function isSameDate(baseDate, targetDate) {
13872
+ const base = resetTimeOfDate(baseDate);
13873
+ const target = resetTimeOfDate(targetDate);
13874
+ return isEqual$1(base, target);
13875
+ }
13876
+ function isSameYearAndMonth(baseDate, targetDate) {
13877
+ return isSameMonth(targetDate, baseDate) && isSameYear(targetDate, baseDate);
13878
+ }
13879
+ function parseDate(date) {
13880
+ return {
13881
+ year: date.getFullYear(),
13882
+ month: date.getMonth(),
13883
+ day: date.getDate()
13884
+ };
13885
+ }
13886
+ function pipe(...fns) {
13887
+ return (...initialParams) => fns.reduce((value, fn, index2) => {
13888
+ const params = index2 === 0 ? value : [value];
13889
+ return fn(...params);
13890
+ }, initialParams);
13891
+ }
13892
+ function pipeWith(value, ...fns) {
13893
+ return pipe(
13894
+ ...fns
13895
+ )(value);
13896
+ }
13897
+ function withKey(arr, keyPrefix) {
13898
+ return arr.map((value) => {
13899
+ return {
13900
+ ...value,
13901
+ key: generateID(keyPrefix)
13902
+ };
13903
+ });
13904
+ }
13905
+ function withDateProps(baseDate, cursorDate) {
13906
+ return function(cell) {
13907
+ const { value: targetDate } = cell;
13908
+ const isCurrentMonth = isSameYearAndMonth(cursorDate, targetDate);
13909
+ const isCurrentDate = isSameDate(baseDate, targetDate);
13910
+ const isWeekend$1 = isWeekend(targetDate);
13911
+ return {
13912
+ ...cell,
13913
+ date: getDate(targetDate),
13914
+ isCurrentMonth,
13915
+ isCurrentDate,
13916
+ isWeekend: isWeekend$1
13917
+ };
13918
+ };
13919
+ }
13920
+ function withKeyProps(keyPrefix) {
13921
+ return function(cell) {
13922
+ return {
13923
+ ...cell,
13924
+ key: generateID(keyPrefix)
13925
+ };
13926
+ };
13927
+ }
13928
+ function createCalendarInfo(cursorDate, { weekStartsOn }) {
13929
+ const { year, month, day } = parseDate(cursorDate);
13930
+ const startWeekdayInMonth = getStartWeekdayInMonth(cursorDate, weekStartsOn);
13931
+ const weeksInMonth = getWeeksInMonth(cursorDate, startWeekdayInMonth);
13932
+ const weekendDays = arrayOf(7).map((index2) => ({
13933
+ value: setDay(cursorDate, index2 + weekStartsOn)
13934
+ }));
13935
+ const getDateCellByIndex = (weekIndex, dayIndex) => {
13936
+ const day2 = weekIndex * 7 + dayIndex - startWeekdayInMonth + 1;
13937
+ return { value: new Date(year, month, day2) };
13938
+ };
13939
+ return {
13940
+ cursorDate,
13941
+ year,
13942
+ month,
13943
+ day,
13944
+ weekStartsOn,
13945
+ startWeekdayInMonth,
13946
+ weeksInMonth,
13947
+ weekendDays,
13948
+ today: {
13949
+ weekIndex: getCurrentWeekIndex(day, startWeekdayInMonth),
13950
+ dateIndex: getDay(cursorDate)
13951
+ },
13952
+ getDateCellByIndex
13953
+ };
13954
+ }
13955
+ function getStartWeekdayInMonth(date, weekStartsOn) {
13956
+ const monthStartsAt = (startOfMonth(date).getDay() - weekStartsOn) % 7;
13957
+ return monthStartsAt < 0 ? monthStartsAt + 7 : monthStartsAt;
13958
+ }
13959
+ function getWeeksInMonth(date, startWeekdayInMonth) {
13960
+ const totalDaysOfMonth = getDaysInMonth(date);
13961
+ return Math.ceil((startWeekdayInMonth + totalDaysOfMonth) / 7);
13962
+ }
13963
+ function getCurrentWeekIndex(day, startWeekdayInMonth) {
13964
+ if ((day + startWeekdayInMonth) % 7 > 0) {
13965
+ return Math.floor((day + startWeekdayInMonth) / 7);
13966
+ }
13967
+ return Math.floor((day + startWeekdayInMonth) / 7) - 1;
13968
+ }
13969
+ function useIsMounted() {
13970
+ const [mounted, setMounted] = useState(false);
13971
+ useEffect(() => {
13972
+ setMounted(true);
13973
+ }, []);
13974
+ return mounted;
13975
+ }
13976
+ function useCalendar({
13977
+ defaultDate,
13978
+ defaultWeekStart = 0,
13979
+ defaultViewType = CalendarViewType_default.Month
13980
+ } = {}) {
13981
+ const isMounted = useIsMounted();
13982
+ const baseDate = useMemo(() => {
13983
+ return defaultDate != null ? new Date(defaultDate) : /* @__PURE__ */ new Date();
13984
+ }, [defaultDate, isMounted]);
13985
+ const [weekStartsOn, setWeekStartsOn] = useState(defaultWeekStart);
13986
+ const [cursorDate, setCursorDate] = useState(baseDate);
13987
+ const [viewType, setViewType] = useState(defaultViewType);
13988
+ const calendar = createCalendarInfo(cursorDate, { weekStartsOn });
13989
+ const { weekendDays, weeksInMonth, today, getDateCellByIndex } = calendar;
13990
+ const getHeaders = useCallback(
13991
+ (viewType2) => {
13992
+ switch (viewType2) {
13993
+ case CalendarViewType_default.Month:
13994
+ case CalendarViewType_default.Week:
13995
+ return {
13996
+ weekDays: withKey(weekendDays, "weekdays")
13997
+ };
13998
+ case CalendarViewType_default.Day:
13999
+ default:
14000
+ return {
14001
+ weekDays: withKey([{ value: cursorDate }], "weekdays")
14002
+ };
14003
+ }
14004
+ },
14005
+ [cursorDate, weekendDays]
14006
+ );
14007
+ const createMatrix = useCallback(
14008
+ (weeksInMonth2) => ({
14009
+ value: arrayOf(weeksInMonth2).map((weekIndex) => {
14010
+ return {
14011
+ key: generateID("weeks"),
14012
+ value: arrayOf(7).map((dayIndex) => {
14013
+ return pipeWith(
14014
+ getDateCellByIndex(weekIndex, dayIndex),
14015
+ withDateProps(baseDate, cursorDate),
14016
+ withKeyProps("days")
14017
+ );
14018
+ })
14019
+ };
14020
+ })
14021
+ }),
14022
+ [baseDate, cursorDate, getDateCellByIndex]
14023
+ );
14024
+ const getBody = useCallback(
14025
+ (viewType2) => {
14026
+ var _a;
14027
+ const matrix2 = createMatrix(weeksInMonth);
14028
+ const { weekIndex, dateIndex } = today;
14029
+ return {
14030
+ [CalendarViewType_default.Month]: matrix2,
14031
+ [CalendarViewType_default.Week]: {
14032
+ value: [matrix2.value[weekIndex]]
14033
+ },
14034
+ [CalendarViewType_default.Day]: {
14035
+ value: [
14036
+ {
14037
+ key: "week-day-type",
14038
+ value: [(_a = matrix2.value[weekIndex]) == null ? void 0 : _a.value[dateIndex]]
14039
+ }
14040
+ ]
14041
+ }
14042
+ }[viewType2];
14043
+ },
14044
+ [createMatrix, today, weeksInMonth]
14045
+ );
14046
+ const setNext = useMemo(() => {
14047
+ switch (viewType) {
14048
+ case CalendarViewType_default.Month:
14049
+ return (date) => addMonths(startOfMonth(date), 1);
14050
+ case CalendarViewType_default.Week:
14051
+ return (date) => addWeeks(startOfWeek(date, { weekStartsOn }), 1);
14052
+ case CalendarViewType_default.Day:
14053
+ return (date) => addDays(date, 1);
14054
+ }
14055
+ }, [viewType, weekStartsOn]);
14056
+ const setPrev = useMemo(() => {
14057
+ switch (viewType) {
14058
+ case CalendarViewType_default.Month:
14059
+ return (date) => subMonths(startOfMonth(date), 1);
14060
+ case CalendarViewType_default.Week:
14061
+ return (date) => subWeeks(startOfWeek(date, { weekStartsOn }), 1);
14062
+ case CalendarViewType_default.Day:
14063
+ return (date) => subDays(date, 1);
14064
+ }
14065
+ }, [viewType, weekStartsOn]);
14066
+ return useMemo(
14067
+ () => ({
14068
+ ...calendar,
14069
+ headers: getHeaders(viewType),
14070
+ body: getBody(viewType),
14071
+ navigation: {
14072
+ toNext: () => setCursorDate((date) => setNext(date)),
14073
+ toPrev: () => setCursorDate((date) => setPrev(date)),
14074
+ setToday: () => setCursorDate(/* @__PURE__ */ new Date()),
14075
+ setDate: (date) => setCursorDate(date)
14076
+ },
14077
+ view: {
14078
+ type: viewType,
14079
+ setViewType,
14080
+ setWeekStartsOn,
14081
+ isMonthView: viewType === CalendarViewType_default.Month,
14082
+ isWeekView: viewType === CalendarViewType_default.Week,
14083
+ isDayView: viewType === CalendarViewType_default.Day,
14084
+ showMonthView: () => setViewType(CalendarViewType_default.Month),
14085
+ showWeekView: () => setViewType(CalendarViewType_default.Week),
14086
+ showDayView: () => setViewType(CalendarViewType_default.Day)
14087
+ }
14088
+ }),
14089
+ [calendar, getBody, getHeaders, setNext, setPrev, viewType]
14090
+ );
14091
+ }
14092
+ const Wrapper$4 = styled.div.withConfig({
14093
+ componentId: "sc-1pvd2nj-0"
14094
+ })(["width:inherit;display:flex;align-items:center;justify-content:space-between;align-items:center;span:first-of-type{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}", ""], ({
14095
+ theme: theme2,
14096
+ $error,
14097
+ $resize
14098
+ }) => `
14099
+ gap: ${theme2.click.field.space.gap};
14100
+ border-radius: ${theme2.click.field.radii.all};
14101
+ font: ${theme2.click.field.typography.fieldText.default};
14102
+ color: ${theme2.click.field.color.text.default};
14103
+ border: 1px solid ${theme2.click.field.color.stroke.default};
14104
+ background: ${theme2.click.field.color.background.default};
14105
+
14106
+ *:autofill,
14107
+ *:-webkit-autofill {
14108
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.default} inset;
14109
+ -webkit-text-fill-color: ${theme2.click.field.color.text.default};
14110
+ caret-color: ${theme2.click.field.color.text.default};
14111
+ }
14112
+
14113
+ &:hover {
14114
+ border: 1px solid ${theme2.click.field.color.stroke.hover};
14115
+ background: ${theme2.click.field.color.background.hover};
14116
+ color: ${theme2.click.field.color.text.hover};
14117
+
14118
+ *:autofill,
14119
+ *:-webkit-autofill {
14120
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.hover} inset;
14121
+ -webkit-text-fill-color: ${theme2.click.field.color.text.hover};
14122
+ caret-color: ${theme2.click.field.color.text.hover};
14123
+ }
14124
+ }
14125
+ ${$resize === "none" ? "" : `
14126
+ resize: ${$resize};
14127
+ overflow: auto;
14128
+ `}
14129
+ padding: 0 ${theme2.click.field.space.x};
14130
+ ${$error ? `
14131
+ font: ${theme2.click.field.typography.fieldText.error};
14132
+ border: 1px solid ${theme2.click.field.color.stroke.error};
14133
+ background: ${theme2.click.field.color.background.active};
14134
+ color: ${theme2.click.field.color.text.error};
14135
+
14136
+ *:autofill,
14137
+ *:-webkit-autofill {
14138
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.error} inset;
14139
+ -webkit-text-fill-color: ${theme2.click.field.color.text.error};
14140
+ caret-color: ${theme2.click.field.color.text.error};
14141
+ }
14142
+
14143
+ &:hover {
14144
+ border: 1px solid ${theme2.click.field.color.stroke.error};
14145
+ color: ${theme2.click.field.color.text.error};
14146
+ *:autofill,
14147
+ *:-webkit-autofill {
14148
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.error} inset;
14149
+ -webkit-text-fill-color: ${theme2.click.field.color.text.error};
14150
+ caret-color: ${theme2.click.field.color.text.error};
14151
+ }
14152
+ }
14153
+ ` : `
14154
+ &:focus-within,
14155
+ &[data-state="open"] {
14156
+ font: ${theme2.click.field.typography.fieldText.active};
14157
+ border: 1px solid ${theme2.click.field.color.stroke.active};
14158
+ background: ${theme2.click.field.color.background.active};
14159
+ color: ${theme2.click.field.color.text.active};
14160
+
14161
+ *:autofill,
14162
+ *:-webkit-autofill {
14163
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.active} inset;
14164
+ -webkit-text-fill-color: ${theme2.click.field.color.text.active};
14165
+ caret-color: ${theme2.click.field.color.text.active};
14166
+ }
14167
+ }
14168
+ `};
14169
+ &:disabled, &.disabled {
14170
+ font: ${theme2.click.field.typography.fieldText.disabled};
14171
+ border: 1px solid ${theme2.click.field.color.stroke.disabled};
14172
+ background: ${theme2.click.field.color.background.disabled};
14173
+ color: ${theme2.click.field.color.text.disabled};
14174
+
14175
+ *:autofill,
14176
+ *:-webkit-autofill {
14177
+ -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.disabled} inset;
14178
+ -webkit-text-fill-color: ${theme2.click.field.color.text.disabled};
14179
+ caret-color: ${theme2.click.field.color.text.disabled};
14180
+ }
14181
+ }
14182
+ `);
14183
+ const StyledLabel = styled(Label$1).withConfig({
14184
+ componentId: "sc-1pvd2nj-1"
14185
+ })(["", ""], ({
14186
+ $labelColor
14187
+ }) => `
14188
+ ${$labelColor ? `color: ${$labelColor};` : ""}
14189
+ `);
14190
+ const InputWrapper = ({
14191
+ className,
14192
+ id,
14193
+ label = "",
14194
+ labelColor,
14195
+ error: error2,
14196
+ disabled,
14197
+ children,
14198
+ orientation,
14199
+ dir,
14200
+ resize = "none"
14201
+ }) => {
14202
+ return /* @__PURE__ */ jsxs(FormRoot, { $orientation: orientation, $dir: dir, $addLabelPadding: true, children: [
14203
+ /* @__PURE__ */ jsxs(FormElementContainer, { children: [
14204
+ /* @__PURE__ */ jsx(Wrapper$4, { $error: !!error2, $resize: resize, "data-resize": resize, className: disabled ? `disabled ${className}` : className, children }),
14205
+ !!error2 && error2 !== true && /* @__PURE__ */ jsx(Error$1, { children: error2 })
14206
+ ] }),
14207
+ label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: id, disabled, error: !!error2, $labelColor: labelColor, children: label })
14208
+ ] });
14209
+ };
14210
+ const InputElement = styled.input.withConfig({
14211
+ componentId: "sc-1pvd2nj-2"
14212
+ })(["background:transparent;border:none;outline:none;width:100%;color:inherit;font:inherit;", ""], ({
14213
+ theme: theme2
14214
+ }) => `
14215
+ padding: ${theme2.click.field.space.y} 0;
14216
+ &::placeholder {
14217
+ color: ${theme2.click.field.color.placeholder.default};
14218
+ }
14219
+
14220
+ &:disabled, &.disabled {
14221
+ &::placeholder {
14222
+ color: ${theme2.click.field.color.placeholder.disabled};
14223
+ }
14224
+ `);
14225
+ const NumberInputElement = styled(InputElement).withConfig({
14226
+ componentId: "sc-1pvd2nj-3"
14227
+ })(["", ""], ({
14228
+ $hideControls
14229
+ }) => `
14230
+ ${$hideControls ? `
14231
+ &::-webkit-outer-spin-button,
14232
+ &::-webkit-inner-spin-button {
14233
+ -webkit-appearance: none;
14234
+ margin: 0;
14235
+ }
14236
+
14237
+ -moz-appearance: textfield;
14238
+ ` : ""}
14239
+ `);
14240
+ const TextAreaElement = styled.textarea.withConfig({
14241
+ componentId: "sc-1pvd2nj-4"
14242
+ })(["background:transparent;border:none;outline:none;width:100%;color:inherit;font:inherit;resize:none;", ""], ({
14243
+ theme: theme2
14244
+ }) => `
14245
+ padding: ${theme2.click.field.space.y} 0;
14246
+ align-self: stretch;
14247
+ &::placeholder {
14248
+ color: ${theme2.click.field.color.placeholder.default};
14249
+ }
14250
+ `);
14251
+ styled(InputWrapper).withConfig({
14252
+ componentId: "sc-1pvd2nj-5"
14253
+ })(["resize:vertical;overflow:auto;color:red;"]);
14254
+ const IconButton = styled.button.withConfig({
14255
+ componentId: "sc-1pvd2nj-6"
14256
+ })(["background:transparent;color:inherit;border:none;padding:0;outline:none;&:not(:disabled){cursor:pointer;}", ""], ({
14257
+ theme: theme2,
14258
+ $show
14259
+ }) => `
14260
+ padding: ${theme2.click.field.space.y} 0;
14261
+ visibility: ${$show ? "visible" : "hidden"};
14262
+ `);
14263
+ styled.svg.withConfig({
14264
+ componentId: "sc-1pvd2nj-7"
14265
+ })(["", ""], ({
14266
+ theme: theme2
14267
+ }) => `
14268
+ &:first-of-type {
14269
+ padding-left: ${theme2.click.field.space.gap};
14270
+ }
14271
+ &:last-of-type {
14272
+ padding-right: ${theme2.click.field.space.x};
14273
+ }
14274
+ `);
14275
+ const locale = "en-US";
14276
+ const weekdayFormatter = new Intl.DateTimeFormat(locale, {
14277
+ weekday: "short"
14278
+ });
14279
+ const headerDateFormatter = new Intl.DateTimeFormat(locale, {
14280
+ month: "short",
14281
+ year: "numeric"
14282
+ });
14283
+ const selectedDateFormatter = new Intl.DateTimeFormat(locale, {
14284
+ day: "2-digit",
14285
+ month: "short",
14286
+ year: "numeric"
14287
+ });
14288
+ const explicitWidth = "250px";
14289
+ const HighlightedInputWrapper = styled$1(InputWrapper).withConfig({
14290
+ componentId: "sc-1kfphgn-0"
14291
+ })(["", " width:", ";}"], ({
14292
+ $isActive,
14293
+ theme: theme2
14294
+ }) => {
14295
+ return `border: ${theme2.click.datePicker.dateOption.stroke} solid ${$isActive ? theme2.click.datePicker.dateOption.color.stroke.active : theme2.click.field.color.stroke.default};`;
14296
+ }, explicitWidth);
14297
+ const DatePickerContainer = styled$1(Container).withConfig({
14298
+ componentId: "sc-1kfphgn-1"
14299
+ })(["background:", ";"], ({
14300
+ theme: theme2
14301
+ }) => theme2.click.datePicker.dateOption.color.background.default);
14302
+ const UnselectableTitle = styled$1.h2.withConfig({
14303
+ componentId: "sc-1kfphgn-2"
14304
+ })(["", " user-select:none;"], ({
14305
+ theme: theme2
14306
+ }) => `
14307
+ color: ${theme2.click.datePicker.color.title.default};
14308
+ font: ${theme2.click.datePicker.typography.title.default};
14309
+ `);
14310
+ const DateTable = styled$1.table.withConfig({
14311
+ componentId: "sc-1kfphgn-3"
14312
+ })(["border-collapse:separate;border-spacing:0;font:", " table-layout:fixed;user-select:none;width:", ";thead tr{height:", ";}tbody{cursor:pointer;}td,th{", ";padding:4px;}"], ({
14313
+ theme: theme2
14314
+ }) => theme2.typography.styles.product.text.normal.md, explicitWidth, ({
14315
+ theme: theme2
14316
+ }) => theme2.click.datePicker.dateOption.size.height, ({
14317
+ theme: theme2
14318
+ }) => `border: ${theme2.click.datePicker.dateOption.stroke} solid ${theme2.click.datePicker.dateOption.color.stroke.default}`);
14319
+ const DateTableHeader = styled$1.th.withConfig({
14320
+ componentId: "sc-1kfphgn-4"
14321
+ })(["", " width:14%;"], ({
14322
+ theme: theme2
14323
+ }) => `
14324
+ color: ${theme2.click.datePicker.color.daytitle.default};
14325
+ font: ${theme2.click.datePicker.typography.daytitle.default};
14326
+ `);
14327
+ const DateTableCell = styled$1.td.withConfig({
14328
+ componentId: "sc-1kfphgn-5"
14329
+ })(["", " ", " ", " text-align:center;", " &:hover{", ";}"], ({
14330
+ theme: theme2
14331
+ }) => `
14332
+ border-radius: ${theme2.click.datePicker.dateOption.radii.default};
14333
+ font: ${theme2.click.datePicker.dateOption.typography.label.default};
14334
+ `, ({
14335
+ $isCurrentMonth,
14336
+ $isDisabled,
14337
+ theme: theme2
14338
+ }) => (!$isCurrentMonth || $isDisabled) && `
14339
+ color: ${theme2.click.datePicker.dateOption.color.label.disabled};
14340
+ font: ${theme2.click.datePicker.dateOption.typography.label.disabled};
14341
+ `, ({
14342
+ $isSelected,
14343
+ theme: theme2
14344
+ }) => $isSelected && `
14345
+ background: ${theme2.click.datePicker.dateOption.color.background.active};
14346
+ color: ${theme2.click.datePicker.dateOption.color.label.active};
14347
+ `, ({
14348
+ $isToday,
14349
+ theme: theme2
14350
+ }) => $isToday && `font: ${theme2.click.datePicker.dateOption.typography.label.active};`, ({
14351
+ $isDisabled,
14352
+ theme: theme2
14353
+ }) => `border: ${theme2.click.datePicker.dateOption.stroke} solid ${$isDisabled ? theme2.click.datePicker.dateOption.color.stroke.disabled : theme2.click.datePicker.dateOption.color.stroke.hover}`);
14354
+ const DatePickerInput = ({
14355
+ isActive,
14356
+ disabled,
14357
+ id,
14358
+ placeholder,
14359
+ selectedDate
14360
+ }) => {
14361
+ const defaultId = useId();
14362
+ const formattedSelectedDate = selectedDate instanceof Date ? selectedDateFormatter.format(selectedDate) : "";
14363
+ return /* @__PURE__ */ jsxs(HighlightedInputWrapper, { $isActive: isActive, disabled, id: id ?? defaultId, children: [
14364
+ /* @__PURE__ */ jsx(SvgImage, { name: "calendar" }),
14365
+ /* @__PURE__ */ jsx(InputElement, { "data-testid": "datepicker-input", placeholder, readOnly: true, value: formattedSelectedDate })
14366
+ ] });
14367
+ };
14368
+ const Calendar = ({
14369
+ closeDatepicker,
14370
+ futureDatesDisabled,
14371
+ selectedDate,
14372
+ setSelectedDate
14373
+ }) => {
14374
+ const calendarOptions = {
14375
+ defaultWeekStart: 1
14376
+ };
14377
+ if (selectedDate) {
14378
+ calendarOptions.defaultDate = selectedDate;
14379
+ }
14380
+ const {
14381
+ body,
14382
+ headers,
14383
+ month,
14384
+ navigation,
14385
+ year
14386
+ } = useCalendar(calendarOptions);
14387
+ const handleNextClick = () => {
14388
+ navigation.toNext();
14389
+ };
14390
+ const handlePreviousClick = () => {
14391
+ navigation.toPrev();
14392
+ };
14393
+ const headerDate = /* @__PURE__ */ new Date();
14394
+ headerDate.setMonth(month);
14395
+ headerDate.setFullYear(year);
14396
+ return /* @__PURE__ */ jsxs(DatePickerContainer, { "data-testid": "datepicker-calendar-container", isResponsive: false, fillWidth: false, orientation: "vertical", padding: "sm", children: [
14397
+ /* @__PURE__ */ jsxs(Container, { isResponsive: false, justifyContent: "space-between", orientation: "horizontal", children: [
14398
+ /* @__PURE__ */ jsx(IconButton$1, { icon: "chevron-left", onClick: handlePreviousClick, size: "sm", type: "ghost" }),
14399
+ /* @__PURE__ */ jsx(UnselectableTitle, { children: headerDateFormatter.format(headerDate) }),
14400
+ /* @__PURE__ */ jsx(IconButton$1, { icon: "chevron-right", onClick: handleNextClick, size: "sm", type: "ghost" })
14401
+ ] }),
14402
+ /* @__PURE__ */ jsxs(DateTable, { children: [
14403
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: headers.weekDays.map(({
14404
+ key,
14405
+ value: date
14406
+ }) => {
14407
+ return /* @__PURE__ */ jsx(DateTableHeader, { children: weekdayFormatter.format(date) }, key);
14408
+ }) }) }),
14409
+ /* @__PURE__ */ jsx("tbody", { children: body.value.map(({
14410
+ key: weekKey,
14411
+ value: week
14412
+ }) => {
14413
+ return /* @__PURE__ */ jsx("tr", { children: week.map(({
14414
+ date,
14415
+ isCurrentMonth,
14416
+ key: dayKey,
14417
+ value: fullDate
14418
+ }) => {
14419
+ const isSelected = selectedDate ? isSameDate(selectedDate, fullDate) : false;
14420
+ const today = /* @__PURE__ */ new Date();
14421
+ const isCurrentDate = isSameDate(today, fullDate);
14422
+ const isDisabled = futureDatesDisabled ? fullDate > today : false;
14423
+ return /* @__PURE__ */ jsx(DateTableCell, { $isCurrentMonth: isCurrentMonth, $isDisabled: isDisabled, $isSelected: isSelected, $isToday: isCurrentDate, onClick: () => {
14424
+ if (isDisabled) {
14425
+ return false;
14426
+ }
14427
+ setSelectedDate(fullDate);
14428
+ closeDatepicker();
14429
+ }, children: date }, dayKey);
14430
+ }) }, weekKey);
14431
+ }) })
14432
+ ] })
14433
+ ] });
14434
+ };
14435
+ const DatePicker = ({
14436
+ date,
14437
+ disabled = false,
14438
+ futureDatesDisabled = false,
14439
+ onSelectDate,
14440
+ placeholder
14441
+ }) => {
14442
+ const [isOpen, setIsOpen] = useState(false);
14443
+ const [selectedDate, setSelectedDate] = useState();
14444
+ useEffect(() => {
14445
+ if (date) {
14446
+ setSelectedDate(date);
14447
+ }
14448
+ }, [date]);
14449
+ const closeDatePicker = () => {
14450
+ setIsOpen(false);
14451
+ };
14452
+ const handleSelectDate = (selectedDate2) => {
14453
+ setSelectedDate(selectedDate2);
14454
+ onSelectDate(selectedDate2);
14455
+ };
14456
+ return /* @__PURE__ */ jsxs(Dropdown, { onOpenChange: setIsOpen, open: isOpen, children: [
14457
+ /* @__PURE__ */ jsx(Dropdown.Trigger, { disabled, children: /* @__PURE__ */ jsx(DatePickerInput, { "data-testid": "datepicker-inpcontainer", disabled, isActive: isOpen, placeholder, selectedDate }) }),
14458
+ /* @__PURE__ */ jsx(Dropdown.Content, { align: "start", children: /* @__PURE__ */ jsx(Calendar, { closeDatepicker: closeDatePicker, futureDatesDisabled, selectedDate, setSelectedDate: handleSelectDate }) })
14459
+ ] });
14460
+ };
13681
14461
  const $5d3850c4d0b4e6c7$var$DIALOG_NAME = "Dialog";
13682
14462
  const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
13683
14463
  const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
@@ -14345,9 +15125,9 @@ const GridContainer$1 = ({
14345
15125
  overflow,
14346
15126
  ...props
14347
15127
  }) => {
14348
- return /* @__PURE__ */ jsx(Wrapper$4, { $alignItems: alignItems, $alignContent: alignContent, $columnGap: columnGap, $gap: gap, $gridAutoColumns: gridAutoColumns, $gridAutoFlow: gridAutoFlow, $gridAutoRows: gridAutoRows, $gridTemplateAreas: gridTemplateAreas, $gridTemplateColumns: gridTemplateColumns, $gridTemplateRows: gridTemplateRows, $gridTemplate: gridTemplate, $inline: inline, $isResponsive: isResponsive, $justifyContent: justifyContent, $justifyItems: justifyItems, $rowGap: rowGap, $height: height, $maxHeight: maxHeight, $minHeight: minHeight, $fillWidth: fillWidth, $maxWidth: maxWidth, $minWidth: minWidth, $overflow: overflow, "data-testid": "grid-container", ...props, children });
15128
+ return /* @__PURE__ */ jsx(Wrapper$3, { $alignItems: alignItems, $alignContent: alignContent, $columnGap: columnGap, $gap: gap, $gridAutoColumns: gridAutoColumns, $gridAutoFlow: gridAutoFlow, $gridAutoRows: gridAutoRows, $gridTemplateAreas: gridTemplateAreas, $gridTemplateColumns: gridTemplateColumns, $gridTemplateRows: gridTemplateRows, $gridTemplate: gridTemplate, $inline: inline, $isResponsive: isResponsive, $justifyContent: justifyContent, $justifyItems: justifyItems, $rowGap: rowGap, $height: height, $maxHeight: maxHeight, $minHeight: minHeight, $fillWidth: fillWidth, $maxWidth: maxWidth, $minWidth: minWidth, $overflow: overflow, "data-testid": "grid-container", ...props, children });
14349
15129
  };
14350
- const Wrapper$4 = styled.div.withConfig({
15130
+ const Wrapper$3 = styled.div.withConfig({
14351
15131
  componentId: "sc-r57kdn-0"
14352
15132
  })(["align-items:", ";align-content:", ";display:", ";", ";", ";", ";", ";", ";", ";", ";justify-content:", ";justify-items:", ";", " ", " ", " ", " @media (max-width:", "){grid-template-columns:", ";}"], ({
14353
15133
  $alignItems = "stretch"
@@ -31669,188 +32449,6 @@ const _Link = ({
31669
32449
  icon && /* @__PURE__ */ jsx(IconWrapper$1, { $size: size2, children: /* @__PURE__ */ jsx(SvgImage, { name: icon, className: "external-icon", "data-testid": icon }) })
31670
32450
  ] });
31671
32451
  const Link = forwardRef(_Link);
31672
- const Wrapper$3 = styled.div.withConfig({
31673
- componentId: "sc-1pvd2nj-0"
31674
- })(["width:inherit;display:flex;align-items:center;justify-content:space-between;align-items:center;span:first-of-type{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}", ""], ({
31675
- theme: theme2,
31676
- $error,
31677
- $resize
31678
- }) => `
31679
- gap: ${theme2.click.field.space.gap};
31680
- border-radius: ${theme2.click.field.radii.all};
31681
- font: ${theme2.click.field.typography.fieldText.default};
31682
- color: ${theme2.click.field.color.text.default};
31683
- border: 1px solid ${theme2.click.field.color.stroke.default};
31684
- background: ${theme2.click.field.color.background.default};
31685
-
31686
- *:autofill,
31687
- *:-webkit-autofill {
31688
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.default} inset;
31689
- -webkit-text-fill-color: ${theme2.click.field.color.text.default};
31690
- caret-color: ${theme2.click.field.color.text.default};
31691
- }
31692
-
31693
- &:hover {
31694
- border: 1px solid ${theme2.click.field.color.stroke.hover};
31695
- background: ${theme2.click.field.color.background.hover};
31696
- color: ${theme2.click.field.color.text.hover};
31697
-
31698
- *:autofill,
31699
- *:-webkit-autofill {
31700
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.hover} inset;
31701
- -webkit-text-fill-color: ${theme2.click.field.color.text.hover};
31702
- caret-color: ${theme2.click.field.color.text.hover};
31703
- }
31704
- }
31705
- ${$resize === "none" ? "" : `
31706
- resize: ${$resize};
31707
- overflow: auto;
31708
- `}
31709
- padding: 0 ${theme2.click.field.space.x};
31710
- ${$error ? `
31711
- font: ${theme2.click.field.typography.fieldText.error};
31712
- border: 1px solid ${theme2.click.field.color.stroke.error};
31713
- background: ${theme2.click.field.color.background.active};
31714
- color: ${theme2.click.field.color.text.error};
31715
-
31716
- *:autofill,
31717
- *:-webkit-autofill {
31718
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.error} inset;
31719
- -webkit-text-fill-color: ${theme2.click.field.color.text.error};
31720
- caret-color: ${theme2.click.field.color.text.error};
31721
- }
31722
-
31723
- &:hover {
31724
- border: 1px solid ${theme2.click.field.color.stroke.error};
31725
- color: ${theme2.click.field.color.text.error};
31726
- *:autofill,
31727
- *:-webkit-autofill {
31728
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.error} inset;
31729
- -webkit-text-fill-color: ${theme2.click.field.color.text.error};
31730
- caret-color: ${theme2.click.field.color.text.error};
31731
- }
31732
- }
31733
- ` : `
31734
- &:focus-within,
31735
- &[data-state="open"] {
31736
- font: ${theme2.click.field.typography.fieldText.active};
31737
- border: 1px solid ${theme2.click.field.color.stroke.active};
31738
- background: ${theme2.click.field.color.background.active};
31739
- color: ${theme2.click.field.color.text.active};
31740
-
31741
- *:autofill,
31742
- *:-webkit-autofill {
31743
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.active} inset;
31744
- -webkit-text-fill-color: ${theme2.click.field.color.text.active};
31745
- caret-color: ${theme2.click.field.color.text.active};
31746
- }
31747
- }
31748
- `};
31749
- &:disabled, &.disabled {
31750
- font: ${theme2.click.field.typography.fieldText.disabled};
31751
- border: 1px solid ${theme2.click.field.color.stroke.disabled};
31752
- background: ${theme2.click.field.color.background.disabled};
31753
- color: ${theme2.click.field.color.text.disabled};
31754
-
31755
- *:autofill,
31756
- *:-webkit-autofill {
31757
- -webkit-box-shadow: 0 0 0px 50vh ${theme2.click.field.color.background.disabled} inset;
31758
- -webkit-text-fill-color: ${theme2.click.field.color.text.disabled};
31759
- caret-color: ${theme2.click.field.color.text.disabled};
31760
- }
31761
- }
31762
- `);
31763
- const StyledLabel = styled(Label$1).withConfig({
31764
- componentId: "sc-1pvd2nj-1"
31765
- })(["", ""], ({
31766
- $labelColor
31767
- }) => `
31768
- ${$labelColor ? `color: ${$labelColor};` : ""}
31769
- `);
31770
- const InputWrapper = ({
31771
- id,
31772
- label = "",
31773
- labelColor,
31774
- error: error2,
31775
- disabled,
31776
- children,
31777
- orientation,
31778
- dir,
31779
- resize = "none"
31780
- }) => {
31781
- return /* @__PURE__ */ jsxs(FormRoot, { $orientation: orientation, $dir: dir, $addLabelPadding: true, children: [
31782
- /* @__PURE__ */ jsxs(FormElementContainer, { children: [
31783
- /* @__PURE__ */ jsx(Wrapper$3, { $error: !!error2, $resize: resize, "data-resize": resize, className: disabled ? "disabled" : "", children }),
31784
- !!error2 && error2 !== true && /* @__PURE__ */ jsx(Error$1, { children: error2 })
31785
- ] }),
31786
- label && /* @__PURE__ */ jsx(StyledLabel, { htmlFor: id, disabled, error: !!error2, $labelColor: labelColor, children: label })
31787
- ] });
31788
- };
31789
- const InputElement = styled.input.withConfig({
31790
- componentId: "sc-1pvd2nj-2"
31791
- })(["background:transparent;border:none;outline:none;width:100%;color:inherit;font:inherit;", ""], ({
31792
- theme: theme2
31793
- }) => `
31794
- padding: ${theme2.click.field.space.y} 0;
31795
- &::placeholder {
31796
- color: ${theme2.click.field.color.placeholder.default};
31797
- }
31798
-
31799
- &:disabled, &.disabled {
31800
- &::placeholder {
31801
- color: ${theme2.click.field.color.placeholder.disabled};
31802
- }
31803
- `);
31804
- const NumberInputElement = styled(InputElement).withConfig({
31805
- componentId: "sc-1pvd2nj-3"
31806
- })(["", ""], ({
31807
- $hideControls
31808
- }) => `
31809
- ${$hideControls ? `
31810
- &::-webkit-outer-spin-button,
31811
- &::-webkit-inner-spin-button {
31812
- -webkit-appearance: none;
31813
- margin: 0;
31814
- }
31815
-
31816
- -moz-appearance: textfield;
31817
- ` : ""}
31818
- `);
31819
- const TextAreaElement = styled.textarea.withConfig({
31820
- componentId: "sc-1pvd2nj-4"
31821
- })(["background:transparent;border:none;outline:none;width:100%;color:inherit;font:inherit;resize:none;", ""], ({
31822
- theme: theme2
31823
- }) => `
31824
- padding: ${theme2.click.field.space.y} 0;
31825
- align-self: stretch;
31826
- &::placeholder {
31827
- color: ${theme2.click.field.color.placeholder.default};
31828
- }
31829
- `);
31830
- styled(InputWrapper).withConfig({
31831
- componentId: "sc-1pvd2nj-5"
31832
- })(["resize:vertical;overflow:auto;color:red;"]);
31833
- const IconButton = styled.button.withConfig({
31834
- componentId: "sc-1pvd2nj-6"
31835
- })(["background:transparent;color:inherit;border:none;padding:0;outline:none;&:not(:disabled){cursor:pointer;}", ""], ({
31836
- theme: theme2,
31837
- $show
31838
- }) => `
31839
- padding: ${theme2.click.field.space.y} 0;
31840
- visibility: ${$show ? "visible" : "hidden"};
31841
- `);
31842
- styled.svg.withConfig({
31843
- componentId: "sc-1pvd2nj-7"
31844
- })(["", ""], ({
31845
- theme: theme2
31846
- }) => `
31847
- &:first-of-type {
31848
- padding-left: ${theme2.click.field.space.gap};
31849
- }
31850
- &:last-of-type {
31851
- padding-right: ${theme2.click.field.space.x};
31852
- }
31853
- `);
31854
32452
  const NumberField = forwardRef(({
31855
32453
  disabled,
31856
32454
  label,
@@ -39707,8 +40305,8 @@ function isKeyable$1(value) {
39707
40305
  }
39708
40306
  var _isKeyable = isKeyable$1;
39709
40307
  var isKeyable = _isKeyable;
39710
- function getMapData$4(map, key) {
39711
- var data = map.__data__;
40308
+ function getMapData$4(map2, key) {
40309
+ var data = map2.__data__;
39712
40310
  return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
39713
40311
  }
39714
40312
  var _getMapData = getMapData$4;
@@ -41085,6 +41683,41 @@ const click$3 = {
41085
41683
  }
41086
41684
  }
41087
41685
  },
41686
+ datePicker: {
41687
+ dateOption: {
41688
+ color: {
41689
+ label: {
41690
+ "default": "#161517",
41691
+ hover: "#161517",
41692
+ active: "#ffffff",
41693
+ disabled: "#a0a0a0",
41694
+ range: "#161517"
41695
+ },
41696
+ background: {
41697
+ "default": "#ffffff",
41698
+ hover: "#ffffff",
41699
+ active: "#151515",
41700
+ disabled: "#ffffff",
41701
+ range: "#e6e7e9"
41702
+ },
41703
+ stroke: {
41704
+ "default": "#ffffff",
41705
+ hover: "#151515",
41706
+ active: "#151515",
41707
+ disabled: "#ffffff",
41708
+ range: "#e6e7e9"
41709
+ }
41710
+ }
41711
+ },
41712
+ color: {
41713
+ title: {
41714
+ "default": "lch(10.2 1.39 305)"
41715
+ },
41716
+ daytitle: {
41717
+ "default": "#696e79"
41718
+ }
41719
+ }
41720
+ },
41088
41721
  global: {
41089
41722
  color: {
41090
41723
  text: {
@@ -42690,6 +43323,41 @@ const click$2 = {
42690
43323
  }
42691
43324
  }
42692
43325
  },
43326
+ datePicker: {
43327
+ dateOption: {
43328
+ color: {
43329
+ label: {
43330
+ "default": "#ffffff",
43331
+ hover: "#ffffff",
43332
+ active: "#1F1F1C",
43333
+ disabled: "#a0a0a0",
43334
+ range: "#ffffff"
43335
+ },
43336
+ background: {
43337
+ "default": "#1F1F1C",
43338
+ hover: "#1F1F1C",
43339
+ active: "#FAFF69",
43340
+ disabled: "#1F1F1C",
43341
+ range: "#323232"
43342
+ },
43343
+ stroke: {
43344
+ "default": "#1F1F1C",
43345
+ hover: "#FAFF69",
43346
+ active: "#FAFF69",
43347
+ disabled: "#1F1F1C",
43348
+ range: "#323232"
43349
+ }
43350
+ }
43351
+ },
43352
+ color: {
43353
+ title: {
43354
+ "default": "rgb(97.5% 97.5% 97.5%)"
43355
+ },
43356
+ daytitle: {
43357
+ "default": "#b3b6bd"
43358
+ }
43359
+ }
43360
+ },
42693
43361
  global: {
42694
43362
  color: {
42695
43363
  background: {
@@ -43470,8 +44138,8 @@ const click$1 = {
43470
44138
  },
43471
44139
  stroke: {
43472
44140
  "default": "#62de85",
43473
- hover: "#66FF73",
43474
- active: "#66FF73",
44141
+ hover: "#62de85",
44142
+ active: "#62de85",
43475
44143
  disabled: "#c0c0c0"
43476
44144
  },
43477
44145
  check: {
@@ -44330,6 +44998,41 @@ const click$1 = {
44330
44998
  }
44331
44999
  }
44332
45000
  },
45001
+ datePicker: {
45002
+ dateOption: {
45003
+ color: {
45004
+ label: {
45005
+ "default": "#161517",
45006
+ hover: "#161517",
45007
+ active: "#ffffff",
45008
+ disabled: "#a0a0a0",
45009
+ range: "#161517"
45010
+ },
45011
+ background: {
45012
+ "default": "#ffffff",
45013
+ hover: "#ffffff",
45014
+ active: "#151515",
45015
+ disabled: "#ffffff",
45016
+ range: "#e6e7e9"
45017
+ },
45018
+ stroke: {
45019
+ "default": "#ffffff",
45020
+ hover: "#151515",
45021
+ active: "#151515",
45022
+ disabled: "#ffffff",
45023
+ range: "#e6e7e9"
45024
+ }
45025
+ }
45026
+ },
45027
+ color: {
45028
+ title: {
45029
+ "default": "lch(11.1 1.37 305)"
45030
+ },
45031
+ daytitle: {
45032
+ "default": "#696e79"
45033
+ }
45034
+ }
45035
+ },
44333
45036
  global: {
44334
45037
  color: {
44335
45038
  background: {
@@ -45590,8 +46293,8 @@ const click = {
45590
46293
  },
45591
46294
  stroke: {
45592
46295
  "default": "#62de85",
45593
- hover: "#66FF73",
45594
- active: "#66FF73",
46296
+ hover: "#62de85",
46297
+ active: "#62de85",
45595
46298
  disabled: "#c0c0c0"
45596
46299
  },
45597
46300
  check: {
@@ -47142,6 +47845,10 @@ const click = {
47142
47845
  narrow: {
47143
47846
  width: "21rem",
47144
47847
  height: "100%"
47848
+ },
47849
+ widest: {
47850
+ width: "55rem",
47851
+ height: "100vh"
47145
47852
  }
47146
47853
  },
47147
47854
  typography: {
@@ -47345,6 +48052,73 @@ const click = {
47345
48052
  }
47346
48053
  }
47347
48054
  },
48055
+ datePicker: {
48056
+ dateOption: {
48057
+ space: {
48058
+ gap: "2px"
48059
+ },
48060
+ radii: {
48061
+ "default": "0.25rem",
48062
+ range: "0"
48063
+ },
48064
+ stroke: "1px",
48065
+ size: {
48066
+ height: "2rem",
48067
+ width: "2rem"
48068
+ },
48069
+ typography: {
48070
+ label: {
48071
+ "default": `400 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`,
48072
+ hover: `400 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`,
48073
+ active: `600 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`,
48074
+ disabled: `400 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`,
48075
+ range: `400 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`
48076
+ }
48077
+ },
48078
+ color: {
48079
+ label: {
48080
+ "default": "#161517",
48081
+ hover: "#161517",
48082
+ active: "#ffffff",
48083
+ disabled: "#a0a0a0",
48084
+ range: "#161517"
48085
+ },
48086
+ background: {
48087
+ "default": "#ffffff",
48088
+ hover: "#ffffff",
48089
+ active: "#151515",
48090
+ disabled: "#ffffff",
48091
+ range: "#e6e7e9"
48092
+ },
48093
+ stroke: {
48094
+ "default": "#ffffff",
48095
+ hover: "#151515",
48096
+ active: "#151515",
48097
+ disabled: "#ffffff",
48098
+ range: "#e6e7e9"
48099
+ }
48100
+ }
48101
+ },
48102
+ space: {
48103
+ gap: "0.25rem"
48104
+ },
48105
+ typography: {
48106
+ daytitle: {
48107
+ "default": `400 0.75rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`
48108
+ },
48109
+ title: {
48110
+ "default": `600 0.875rem/1.5 "Inter", '"SF Pro Display"', -apple-system, BlinkMacSystemFont, '"Segoe UI"', Roboto, Oxygen, Ubuntu, Cantarell, '"Open Sans"', '"Helvetica Neue"', sans-serif;`
48111
+ }
48112
+ },
48113
+ color: {
48114
+ title: {
48115
+ "default": "lch(11.1 1.37 305)"
48116
+ },
48117
+ daytitle: {
48118
+ "default": "#696e79"
48119
+ }
48120
+ }
48121
+ },
47348
48122
  global: {
47349
48123
  color: {
47350
48124
  background: {
@@ -48220,6 +48994,7 @@ export {
48220
48994
  Container,
48221
48995
  ContextMenu,
48222
48996
  DangerAlert,
48997
+ DatePicker,
48223
48998
  Dialog,
48224
48999
  Dropdown,
48225
49000
  EllipsisContent,