@dmsi/wedgekit-react 0.0.2

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 (263) hide show
  1. package/README.md +35 -0
  2. package/dist/chunk-27KIIUAR.js +59 -0
  3. package/dist/chunk-2G2E2JMA.js +123 -0
  4. package/dist/chunk-4C66DLIJ.js +51 -0
  5. package/dist/chunk-4RD5ZF2V.js +55 -0
  6. package/dist/chunk-4RJKB7LC.js +14 -0
  7. package/dist/chunk-4T7F5BZZ.js +26 -0
  8. package/dist/chunk-5GOBP2JS.js +53 -0
  9. package/dist/chunk-6ZY524ID.js +42 -0
  10. package/dist/chunk-AWQSSKCK.js +32 -0
  11. package/dist/chunk-BNHSAFMP.js +93 -0
  12. package/dist/chunk-BWRHL2AG.js +439 -0
  13. package/dist/chunk-DKKYR6DS.js +132 -0
  14. package/dist/chunk-E5ALT5W7.js +182 -0
  15. package/dist/chunk-FY7PTP6E.js +322 -0
  16. package/dist/chunk-GTCSRHPF.js +119 -0
  17. package/dist/chunk-I2UVVKQI.js +12 -0
  18. package/dist/chunk-IGQVA7SC.js +41 -0
  19. package/dist/chunk-K3IKUSZW.js +59 -0
  20. package/dist/chunk-KENSVWOY.js +151 -0
  21. package/dist/chunk-KX3O6GJ6.js +138 -0
  22. package/dist/chunk-L4UM372R.js +253 -0
  23. package/dist/chunk-ORMEWXMH.js +37 -0
  24. package/dist/chunk-Q3FKEKIN.js +23 -0
  25. package/dist/chunk-SEKKGFM6.js +28 -0
  26. package/dist/chunk-SY3HT54E.js +91 -0
  27. package/dist/chunk-TAW5ZZ4Z.js +346 -0
  28. package/dist/chunk-TRUPPHBQ.js +109 -0
  29. package/dist/chunk-TU55CHXU.js +30 -0
  30. package/dist/chunk-TWZZB4WO.js +114 -0
  31. package/dist/chunk-TYI74BSP.js +62 -0
  32. package/dist/chunk-U42SKNR6.js +104 -0
  33. package/dist/chunk-UU3FA6LV.js +72 -0
  34. package/dist/chunk-WVUIIBRR.js +51 -0
  35. package/dist/chunk-XUIPGYP5.js +39 -0
  36. package/dist/chunk-Z4UCFUF7.js +299 -0
  37. package/dist/components/Breadcrumbs.cjs +376 -0
  38. package/dist/components/Breadcrumbs.js +90 -0
  39. package/dist/components/Button.cjs +319 -0
  40. package/dist/components/Button.js +8 -0
  41. package/dist/components/CalendarRange.cjs +520 -0
  42. package/dist/components/CalendarRange.js +13 -0
  43. package/dist/components/Caption.cjs +283 -0
  44. package/dist/components/Caption.js +80 -0
  45. package/dist/components/Checkbox.cjs +378 -0
  46. package/dist/components/Checkbox.js +11 -0
  47. package/dist/components/ContentTab.cjs +382 -0
  48. package/dist/components/ContentTab.js +10 -0
  49. package/dist/components/ContentTabs.cjs +472 -0
  50. package/dist/components/ContentTabs.js +98 -0
  51. package/dist/components/DMSiLogo.cjs +79 -0
  52. package/dist/components/DMSiLogo.js +56 -0
  53. package/dist/components/DataGrid.cjs +3113 -0
  54. package/dist/components/DataGrid.js +758 -0
  55. package/dist/components/DataGridCell.cjs +1907 -0
  56. package/dist/components/DataGridCell.js +24 -0
  57. package/dist/components/DataTable.cjs +791 -0
  58. package/dist/components/DataTable.js +720 -0
  59. package/dist/components/DateInput.cjs +1130 -0
  60. package/dist/components/DateInput.js +170 -0
  61. package/dist/components/DateRangeInput.cjs +1131 -0
  62. package/dist/components/DateRangeInput.js +171 -0
  63. package/dist/components/DebugJson.cjs +50 -0
  64. package/dist/components/DebugJson.js +27 -0
  65. package/dist/components/Display.cjs +234 -0
  66. package/dist/components/Display.js +12 -0
  67. package/dist/components/EditingContext.cjs +73 -0
  68. package/dist/components/EditingContext.js +35 -0
  69. package/dist/components/FilterGroup.cjs +1431 -0
  70. package/dist/components/FilterGroup.js +231 -0
  71. package/dist/components/FullViewportBox.cjs +35 -0
  72. package/dist/components/FullViewportBox.js +12 -0
  73. package/dist/components/Grid.cjs +69 -0
  74. package/dist/components/Grid.js +36 -0
  75. package/dist/components/GridContainer.cjs +125 -0
  76. package/dist/components/GridContainer.js +92 -0
  77. package/dist/components/Heading.cjs +238 -0
  78. package/dist/components/Heading.js +14 -0
  79. package/dist/components/HorizontalDivider.cjs +33 -0
  80. package/dist/components/HorizontalDivider.js +10 -0
  81. package/dist/components/Icon.cjs +98 -0
  82. package/dist/components/Icon.js +7 -0
  83. package/dist/components/Input.cjs +672 -0
  84. package/dist/components/Input.js +21 -0
  85. package/dist/components/InputGroup.cjs +270 -0
  86. package/dist/components/InputGroup.js +60 -0
  87. package/dist/components/Label.cjs +223 -0
  88. package/dist/components/Label.js +8 -0
  89. package/dist/components/Link.cjs +262 -0
  90. package/dist/components/Link.js +8 -0
  91. package/dist/components/List.cjs +37 -0
  92. package/dist/components/List.js +14 -0
  93. package/dist/components/LiveChatComponent.cjs +63 -0
  94. package/dist/components/LiveChatComponent.js +40 -0
  95. package/dist/components/LogoAgilityTopBar.cjs +115 -0
  96. package/dist/components/LogoAgilityTopBar.js +92 -0
  97. package/dist/components/LogoDMSiTopBar.cjs +79 -0
  98. package/dist/components/LogoDMSiTopBar.js +7 -0
  99. package/dist/components/LogoMillworkTopBar.cjs +221 -0
  100. package/dist/components/LogoMillworkTopBar.js +198 -0
  101. package/dist/components/MainBar.cjs +211 -0
  102. package/dist/components/MainBar.js +65 -0
  103. package/dist/components/Menu.cjs +437 -0
  104. package/dist/components/Menu.js +11 -0
  105. package/dist/components/MenuOption.cjs +483 -0
  106. package/dist/components/MenuOption.js +13 -0
  107. package/dist/components/MobileDataGrid.cjs +658 -0
  108. package/dist/components/MobileDataGrid.js +125 -0
  109. package/dist/components/Modal.cjs +783 -0
  110. package/dist/components/Modal.js +245 -0
  111. package/dist/components/ModalButtons.cjs +385 -0
  112. package/dist/components/ModalButtons.js +10 -0
  113. package/dist/components/ModalContent.cjs +57 -0
  114. package/dist/components/ModalContent.js +7 -0
  115. package/dist/components/ModalHeader.cjs +426 -0
  116. package/dist/components/ModalHeader.js +11 -0
  117. package/dist/components/ModalScrim.cjs +64 -0
  118. package/dist/components/ModalScrim.js +7 -0
  119. package/dist/components/NavigationTab.cjs +431 -0
  120. package/dist/components/NavigationTab.js +10 -0
  121. package/dist/components/NavigationTabs.cjs +477 -0
  122. package/dist/components/NavigationTabs.js +56 -0
  123. package/dist/components/Notification.cjs +640 -0
  124. package/dist/components/Notification.js +117 -0
  125. package/dist/components/OptionPill.cjs +478 -0
  126. package/dist/components/OptionPill.js +11 -0
  127. package/dist/components/Paragraph.cjs +231 -0
  128. package/dist/components/Paragraph.js +8 -0
  129. package/dist/components/Password.cjs +700 -0
  130. package/dist/components/Password.js +53 -0
  131. package/dist/components/ProjectBar.cjs +242 -0
  132. package/dist/components/ProjectBar.js +63 -0
  133. package/dist/components/Radio.cjs +349 -0
  134. package/dist/components/Radio.js +131 -0
  135. package/dist/components/Search.cjs +767 -0
  136. package/dist/components/Search.js +12 -0
  137. package/dist/components/Select.cjs +758 -0
  138. package/dist/components/Select.js +12 -0
  139. package/dist/components/SideMenu.cjs +54 -0
  140. package/dist/components/SideMenu.js +21 -0
  141. package/dist/components/SideMenuGroup.cjs +422 -0
  142. package/dist/components/SideMenuGroup.js +83 -0
  143. package/dist/components/SideMenuItem.cjs +388 -0
  144. package/dist/components/SideMenuItem.js +70 -0
  145. package/dist/components/Stack.cjs +138 -0
  146. package/dist/components/Stack.js +7 -0
  147. package/dist/components/StatusPill.cjs +265 -0
  148. package/dist/components/StatusPill.js +52 -0
  149. package/dist/components/Stepper.cjs +885 -0
  150. package/dist/components/Stepper.js +105 -0
  151. package/dist/components/Subheader.cjs +226 -0
  152. package/dist/components/Subheader.js +8 -0
  153. package/dist/components/Surface.cjs +98 -0
  154. package/dist/components/Surface.js +40 -0
  155. package/dist/components/Swatch.cjs +1728 -0
  156. package/dist/components/Swatch.js +1319 -0
  157. package/dist/components/Textarea.cjs +269 -0
  158. package/dist/components/Textarea.js +96 -0
  159. package/dist/components/Theme.cjs +36 -0
  160. package/dist/components/Theme.js +7 -0
  161. package/dist/components/Time.cjs +1118 -0
  162. package/dist/components/Time.js +353 -0
  163. package/dist/components/Toast.cjs +644 -0
  164. package/dist/components/Toast.js +218 -0
  165. package/dist/components/Tooltip.cjs +273 -0
  166. package/dist/components/Tooltip.js +9 -0
  167. package/dist/components/TopBar.cjs +352 -0
  168. package/dist/components/TopBar.js +132 -0
  169. package/dist/components/useInfiniteScroll.cjs +57 -0
  170. package/dist/components/useInfiniteScroll.js +8 -0
  171. package/dist/components/useMatchesMedia.cjs +53 -0
  172. package/dist/components/useMatchesMedia.js +9 -0
  173. package/dist/components/useMenuSystem.cjs +358 -0
  174. package/dist/components/useMenuSystem.js +11 -0
  175. package/dist/components/useMounted.cjs +39 -0
  176. package/dist/components/useMounted.js +8 -0
  177. package/dist/fonts.css +21 -0
  178. package/dist/icons-light[FILL]-PPZXOLWS.woff2 +0 -0
  179. package/dist/icons-normal[FILL]-PPZXOLWS.woff2 +0 -0
  180. package/dist/index.css +4401 -0
  181. package/dist/open-sans-55T6A4JE.woff2 +0 -0
  182. package/dist/types.cjs +18 -0
  183. package/dist/types.js +0 -0
  184. package/package.json +66 -0
  185. package/src/brand.css +125 -0
  186. package/src/classNames.ts +144 -0
  187. package/src/components/Breadcrumbs.tsx +116 -0
  188. package/src/components/Button.tsx +210 -0
  189. package/src/components/CalendarRange.tsx +429 -0
  190. package/src/components/Caption.tsx +101 -0
  191. package/src/components/Checkbox.tsx +196 -0
  192. package/src/components/ContentTab.tsx +66 -0
  193. package/src/components/ContentTabs.tsx +103 -0
  194. package/src/components/DMSiLogo.tsx +32 -0
  195. package/src/components/DataGrid.tsx +948 -0
  196. package/src/components/DataGridCell.tsx +384 -0
  197. package/src/components/DataTable.tsx +835 -0
  198. package/src/components/DateInput.tsx +188 -0
  199. package/src/components/DateRangeInput.tsx +179 -0
  200. package/src/components/DebugJson.tsx +24 -0
  201. package/src/components/Display.tsx +60 -0
  202. package/src/components/EditingContext.tsx +40 -0
  203. package/src/components/FilterGroup.tsx +234 -0
  204. package/src/components/FullViewportBox.tsx +11 -0
  205. package/src/components/Grid.tsx +75 -0
  206. package/src/components/GridContainer.tsx +124 -0
  207. package/src/components/Heading.tsx +66 -0
  208. package/src/components/HorizontalDivider.tsx +3 -0
  209. package/src/components/Icon.tsx +36 -0
  210. package/src/components/Input.tsx +511 -0
  211. package/src/components/InputGroup.tsx +51 -0
  212. package/src/components/Label.tsx +40 -0
  213. package/src/components/Link.tsx +106 -0
  214. package/src/components/List.tsx +10 -0
  215. package/src/components/LiveChatComponent.tsx +56 -0
  216. package/src/components/LogoAgilityTopBar.tsx +53 -0
  217. package/src/components/LogoDMSiTopBar.tsx +32 -0
  218. package/src/components/LogoMillworkTopBar.tsx +118 -0
  219. package/src/components/MainBar.tsx +83 -0
  220. package/src/components/Menu.tsx +286 -0
  221. package/src/components/MenuOption.tsx +275 -0
  222. package/src/components/MobileDataGrid.tsx +135 -0
  223. package/src/components/Modal.tsx +271 -0
  224. package/src/components/ModalButtons.tsx +44 -0
  225. package/src/components/ModalContent.tsx +23 -0
  226. package/src/components/ModalHeader.tsx +41 -0
  227. package/src/components/ModalScrim.tsx +35 -0
  228. package/src/components/NavigationTab.tsx +89 -0
  229. package/src/components/NavigationTabs.tsx +63 -0
  230. package/src/components/Notification.tsx +120 -0
  231. package/src/components/OptionPill.tsx +114 -0
  232. package/src/components/Paragraph.tsx +49 -0
  233. package/src/components/Password.tsx +46 -0
  234. package/src/components/ProjectBar.tsx +76 -0
  235. package/src/components/Radio.tsx +140 -0
  236. package/src/components/Search.tsx +129 -0
  237. package/src/components/Select.tsx +104 -0
  238. package/src/components/SideMenu.tsx +21 -0
  239. package/src/components/SideMenuGroup.tsx +81 -0
  240. package/src/components/SideMenuItem.tsx +90 -0
  241. package/src/components/Stack.tsx +179 -0
  242. package/src/components/StatusPill.tsx +51 -0
  243. package/src/components/Stepper.tsx +91 -0
  244. package/src/components/Subheader.tsx +44 -0
  245. package/src/components/Surface.tsx +34 -0
  246. package/src/components/Swatch.tsx +1066 -0
  247. package/src/components/Textarea.tsx +101 -0
  248. package/src/components/Theme.tsx +13 -0
  249. package/src/components/Time.tsx +438 -0
  250. package/src/components/Toast.tsx +244 -0
  251. package/src/components/Tooltip.tsx +137 -0
  252. package/src/components/TopBar.tsx +124 -0
  253. package/src/components/useInfiniteScroll.tsx +40 -0
  254. package/src/components/useMatchesMedia.tsx +28 -0
  255. package/src/components/useMenuSystem.tsx +367 -0
  256. package/src/components/useMounted.tsx +14 -0
  257. package/src/darkmode.css +140 -0
  258. package/src/fonts.css +23 -0
  259. package/src/index.css +509 -0
  260. package/src/index.tsx +2 -0
  261. package/src/types.ts +149 -0
  262. package/src/utils/formatting.tsx +81 -0
  263. package/src/utils.ts +23 -0
@@ -0,0 +1,182 @@
1
+ import {
2
+ useMatchesMobile
3
+ } from "./chunk-SEKKGFM6.js";
4
+ import {
5
+ Label
6
+ } from "./chunk-4C66DLIJ.js";
7
+ import {
8
+ Paragraph
9
+ } from "./chunk-K3IKUSZW.js";
10
+ import {
11
+ Icon
12
+ } from "./chunk-IGQVA7SC.js";
13
+ import {
14
+ baseTransition,
15
+ componentGap,
16
+ componentPadding
17
+ } from "./chunk-KX3O6GJ6.js";
18
+ import {
19
+ __spreadProps,
20
+ __spreadValues
21
+ } from "./chunk-ORMEWXMH.js";
22
+
23
+ // src/components/MenuOption.tsx
24
+ import clsx from "clsx";
25
+ import { useId, useRef } from "react";
26
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
27
+ var MenuOption = ({
28
+ children,
29
+ disabled = false,
30
+ variant = "normal",
31
+ value,
32
+ before,
33
+ after,
34
+ subMenu,
35
+ onClick,
36
+ selected,
37
+ ref,
38
+ onSubMenuHover,
39
+ onSubMenuLeave,
40
+ onSubMenuEnter,
41
+ toggleMenu,
42
+ subMenuLevel = 1,
43
+ currentSubMenuLevel,
44
+ closeSubMenuLevel,
45
+ activeMenu,
46
+ mobilePositionTo,
47
+ highlightMatchingText = false,
48
+ menuValue
49
+ }) => {
50
+ const uniqueId = useId();
51
+ const internalRef = useRef(null);
52
+ const actualRef = ref || internalRef;
53
+ const menuId = useRef(`menu-${uniqueId}`);
54
+ const isMobile = useMatchesMobile();
55
+ const handleMouseEnter = () => {
56
+ if (subMenu && onSubMenuHover && !disabled) {
57
+ onSubMenuHover(menuId.current, subMenuLevel);
58
+ }
59
+ };
60
+ const handleMouseLeave = () => {
61
+ if (subMenu && onSubMenuLeave && !disabled) {
62
+ onSubMenuLeave(subMenuLevel);
63
+ }
64
+ };
65
+ const handleSubMenuEnter = () => {
66
+ if (onSubMenuEnter) {
67
+ onSubMenuEnter();
68
+ }
69
+ };
70
+ const additionalAttributes = {
71
+ "data-selected": selected || null
72
+ };
73
+ const svgStyles = clsx(
74
+ "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
75
+ );
76
+ const textLabelStyles = clsx("w-full whitespace-nowrap !leading-6");
77
+ const normalStyles = variant === "normal" && !disabled && clsx(
78
+ "bg-transparent text-text-primary-normal",
79
+ "hover:bg-background-action-secondary-hover",
80
+ "focus:bg-background-action-secondary-hover",
81
+ "data-selected:bg-background-action-secondary-hover",
82
+ "active:bg-background-action-secondary-active"
83
+ );
84
+ const normalDisabledStyles = variant === "normal" && disabled && clsx("text-text-primary-disabled");
85
+ const actionStyles = variant === "action" && !disabled && clsx(
86
+ "text-action-400 bg-transparent",
87
+ "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
88
+ "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
89
+ "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
90
+ "active:bg-background-action-secondary-active active:text-text-action-active"
91
+ );
92
+ const actionDisabledStyles = variant === "action" && disabled && clsx("text-text-action-disabled");
93
+ const disabledStyles = disabled && clsx("bg-transparent cursor-default pointer-events-none");
94
+ const renderChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
95
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
96
+ /* @__PURE__ */ jsxs(
97
+ "div",
98
+ __spreadProps(__spreadValues({
99
+ ref: actualRef,
100
+ className: clsx(
101
+ "flex items-center cursor-pointer w-full text-left relative outline-none",
102
+ svgStyles,
103
+ componentGap,
104
+ componentPadding,
105
+ baseTransition,
106
+ normalStyles,
107
+ normalDisabledStyles,
108
+ actionStyles,
109
+ actionDisabledStyles,
110
+ disabledStyles
111
+ ),
112
+ "data-value": value || children,
113
+ onClick: () => {
114
+ onClick == null ? void 0 : onClick(menuId.current, value || children);
115
+ if (subMenu) {
116
+ toggleMenu(menuId.current, subMenuLevel);
117
+ }
118
+ },
119
+ onMouseEnter: handleMouseEnter,
120
+ onMouseLeave: handleMouseLeave
121
+ }, additionalAttributes), {
122
+ tabIndex: -1,
123
+ role: "menuitem",
124
+ "aria-haspopup": subMenu ? "menu" : void 0,
125
+ children: [
126
+ before && /* @__PURE__ */ jsx("div", { className: "shrink-0 flex items-center", children: before }),
127
+ variant === "action" ? /* @__PURE__ */ jsx(Label, { padded: true, className: textLabelStyles, children: renderChildren }) : /* @__PURE__ */ jsx(Paragraph, { padded: true, className: textLabelStyles, children: renderChildren }),
128
+ renderAfterProp()
129
+ ]
130
+ })
131
+ ),
132
+ subMenu && /* @__PURE__ */ jsx(
133
+ "div",
134
+ {
135
+ onMouseEnter: handleSubMenuEnter,
136
+ onMouseLeave: handleMouseLeave,
137
+ "data-submenu-parent": menuId.current,
138
+ "data-menu-level": subMenuLevel + 1,
139
+ children: subMenu({ menuId: menuId.current, positionTo: actualRef, mobilePositionTo, position: "right", subMenuLevel, mobileBackMenuOption, mobileHide: isMobile && activeMenu !== menuId.current })
140
+ }
141
+ )
142
+ ] });
143
+ function renderAfterProp() {
144
+ if (after) {
145
+ return after;
146
+ }
147
+ if (subMenu && after !== null) {
148
+ return /* @__PURE__ */ jsx(Icon, { name: "chevron_right" });
149
+ }
150
+ }
151
+ function mobileBackMenuOption() {
152
+ if (!isMobile) {
153
+ return;
154
+ }
155
+ return /* @__PURE__ */ jsx(
156
+ MenuOption,
157
+ {
158
+ onClick: () => {
159
+ closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
160
+ },
161
+ variant: "action",
162
+ before: /* @__PURE__ */ jsx(Icon, { name: "chevron_left" }),
163
+ children: "Back"
164
+ }
165
+ );
166
+ }
167
+ };
168
+ MenuOption.displayName = "MenuOption";
169
+ function highlightMatch(text, searchValue) {
170
+ if (!searchValue || !searchValue.trim()) {
171
+ return text;
172
+ }
173
+ const regex = new RegExp(`(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
174
+ const parts = text.split(regex);
175
+ return parts.map(
176
+ (part, index) => regex.test(part) ? /* @__PURE__ */ jsx("span", { className: "font-bold", children: part }, index) : part
177
+ );
178
+ }
179
+
180
+ export {
181
+ MenuOption
182
+ };
@@ -0,0 +1,322 @@
1
+ import {
2
+ Icon
3
+ } from "./chunk-IGQVA7SC.js";
4
+ import {
5
+ componentGap,
6
+ componentPadding,
7
+ componentPaddingXUsingComponentGap,
8
+ componentPaddingYUsingComponentGap,
9
+ paddingUsingComponentGap,
10
+ typography
11
+ } from "./chunk-KX3O6GJ6.js";
12
+ import {
13
+ __objRest,
14
+ __spreadProps,
15
+ __spreadValues
16
+ } from "./chunk-ORMEWXMH.js";
17
+
18
+ // src/components/CalendarRange.tsx
19
+ import clsx from "clsx";
20
+ import React, { useState } from "react";
21
+ import { Temporal } from "@js-temporal/polyfill";
22
+ import { jsx, jsxs } from "react/jsx-runtime";
23
+ function isWeekend(date) {
24
+ return date.dayOfWeek === 6 || date.dayOfWeek === 7;
25
+ }
26
+ function DateCell(_a) {
27
+ var _b = _a, {
28
+ date,
29
+ isInMonth,
30
+ isToday,
31
+ isSelected,
32
+ inRange,
33
+ isDisabled,
34
+ isRangeStart,
35
+ isRangeEnd,
36
+ onClick,
37
+ onMouseEnter,
38
+ onMouseLeave,
39
+ cellPadding = "",
40
+ isRangeDisabled = false
41
+ } = _b, props = __objRest(_b, [
42
+ "date",
43
+ "isInMonth",
44
+ "isToday",
45
+ "isSelected",
46
+ "inRange",
47
+ "isDisabled",
48
+ "isRangeStart",
49
+ "isRangeEnd",
50
+ "onClick",
51
+ "onMouseEnter",
52
+ "onMouseLeave",
53
+ "cellPadding",
54
+ "isRangeDisabled"
55
+ ]);
56
+ return /* @__PURE__ */ jsx(
57
+ "span",
58
+ __spreadProps(__spreadValues({}, props), {
59
+ className: clsx(
60
+ "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
61
+ typography.caption,
62
+ cellPadding,
63
+ !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
64
+ !isInMonth && "border-transparent",
65
+ // Today: subtle border ring
66
+ isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
67
+ // Selected: Figma blue, white text, strong shadow
68
+ isSelected && "bg-action-400 text-white border-action-400 z-10",
69
+ !isSelected && !inRange && "rounded-base",
70
+ // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
71
+ (isRangeDisabled || !inRange && isSelected) && "rounded-base",
72
+ inRange && isSelected && "hover:border-action-500",
73
+ // In range: Figma light blue background
74
+ inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
75
+ // Disabled: Figma gray, no pointer, no hover
76
+ isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
77
+ "text-text-primary-normal cursor-pointer",
78
+ // Figma hover: blue bg, blue text (or red text if selected)
79
+ isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
80
+ // Figma active: darker blue bg, white text
81
+ "active:bg-action-300 active:text-white",
82
+ // Figma focus: ring
83
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
84
+ ],
85
+ isRangeStart && "rounded-l",
86
+ isRangeEnd && "rounded-r"
87
+ ),
88
+ tabIndex: isDisabled ? -1 : 0,
89
+ "aria-disabled": isDisabled,
90
+ onClick: () => !isDisabled && isInMonth && onClick(),
91
+ onMouseEnter: () => isInMonth && onMouseEnter(),
92
+ onMouseLeave: () => isInMonth && onMouseLeave(),
93
+ children: isInMonth ? date.day : ""
94
+ })
95
+ );
96
+ }
97
+ function CalendarRange({
98
+ from,
99
+ to,
100
+ onChange,
101
+ isDateAvailable,
102
+ mode = "double",
103
+ cardStyle = false,
104
+ disableRange = false
105
+ }) {
106
+ const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
107
+ const parseDate = (d) => {
108
+ if (!d) return void 0;
109
+ if (typeof d === "number")
110
+ return Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
111
+ if (typeof d === "string") return Temporal.PlainDate.from(d);
112
+ return void 0;
113
+ };
114
+ const fromDate = parseDate(from);
115
+ const toDate = parseDate(to);
116
+ const today = Temporal.Now.plainDateISO();
117
+ const [baseMonth, setBaseMonth] = useState(
118
+ fromDate != null ? fromDate : today.with({ day: 1 })
119
+ );
120
+ const [selecting, setSelecting] = useState("from");
121
+ const [pendingFrom, setPendingFrom] = useState(void 0);
122
+ const [hoveredDate, setHoveredDate] = useState(void 0);
123
+ function getMonthData(monthOffset) {
124
+ const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
125
+ const days = monthDate.daysInMonth;
126
+ const firstDayOffset = monthDate.dayOfWeek % 7;
127
+ return {
128
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
129
+ year: monthDate.year,
130
+ days,
131
+ firstDayOffset,
132
+ date: monthDate
133
+ };
134
+ }
135
+ function handleDayClick(date) {
136
+ if (isDateAvailable && !isDateAvailable(date)) return;
137
+ if (mode === "single" && disableRange) {
138
+ if (onChange) {
139
+ onChange(date.toString(), date.toString());
140
+ }
141
+ return;
142
+ }
143
+ if (selecting === "from") {
144
+ setPendingFrom(date);
145
+ setSelecting("to");
146
+ setHoveredDate(void 0);
147
+ } else if (pendingFrom) {
148
+ if (onChange) {
149
+ const [start, end] = Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
150
+ onChange(start.toString(), end.toString());
151
+ }
152
+ setPendingFrom(void 0);
153
+ setSelecting("from");
154
+ setHoveredDate(void 0);
155
+ }
156
+ }
157
+ function isInRange(date) {
158
+ if (mode === "single" && disableRange) {
159
+ return false;
160
+ }
161
+ if (pendingFrom && selecting === "to" && hoveredDate) {
162
+ const [start, end] = Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
163
+ return Temporal.PlainDate.compare(date, start) >= 0 && Temporal.PlainDate.compare(date, end) <= 0;
164
+ }
165
+ if (!pendingFrom && fromDate && toDate) {
166
+ return Temporal.PlainDate.compare(date, fromDate) >= 0 && Temporal.PlainDate.compare(date, toDate) <= 0;
167
+ }
168
+ return false;
169
+ }
170
+ return /* @__PURE__ */ jsx(
171
+ "div",
172
+ {
173
+ className: clsx(
174
+ "relative bg-background-grouped-primary-normal rounded-base w-fit",
175
+ componentPadding,
176
+ componentGap,
177
+ cardStyle && "shadow-4",
178
+ // baseTransition,
179
+ "overflow-hidden"
180
+ ),
181
+ children: /* @__PURE__ */ jsx(
182
+ "div",
183
+ {
184
+ className: clsx(
185
+ "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
186
+ componentGap,
187
+ paddingUsingComponentGap
188
+ ),
189
+ children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
190
+ const month = getMonthData(offset);
191
+ const totalCells = 42;
192
+ const emptyCells = month.firstDayOffset;
193
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
194
+ /* @__PURE__ */ jsxs(
195
+ "div",
196
+ {
197
+ className: clsx(
198
+ "flex flex-col",
199
+ componentGap,
200
+ componentPadding
201
+ ),
202
+ children: [
203
+ /* @__PURE__ */ jsxs(
204
+ "div",
205
+ {
206
+ className: clsx(
207
+ "flex flex-row items-center justify-between",
208
+ componentGap,
209
+ componentPaddingXUsingComponentGap,
210
+ componentPaddingYUsingComponentGap,
211
+ "mb-3",
212
+ typography.label,
213
+ "text-text-action-primary-normal"
214
+ ),
215
+ children: [
216
+ idx === 0 ? /* @__PURE__ */ jsx(
217
+ "button",
218
+ {
219
+ type: "button",
220
+ className: clsx(
221
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
222
+ componentPadding,
223
+ "mr-1"
224
+ ),
225
+ "aria-label": "Previous month",
226
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
227
+ children: /* @__PURE__ */ jsx(Icon, { name: "chevron_left", size: 24 })
228
+ }
229
+ ) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "mr-1") }),
230
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-desktop-compact-component-padding", children: [
231
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] truncate", children: month.name }),
232
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] px-1 truncate", children: month.year })
233
+ ] }),
234
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ jsx(
235
+ "button",
236
+ {
237
+ type: "button",
238
+ className: clsx(
239
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
240
+ componentPadding,
241
+ "ml-1"
242
+ ),
243
+ "aria-label": "Next month",
244
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
245
+ children: /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 24 })
246
+ }
247
+ ) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "ml-1") })
248
+ ]
249
+ }
250
+ ),
251
+ /* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7 mb-1", componentGap), children: weekDays.map((d) => /* @__PURE__ */ jsx(
252
+ "span",
253
+ {
254
+ className: clsx(
255
+ typography.caption,
256
+ "text-text-secondary-normal text-center"
257
+ ),
258
+ children: d
259
+ },
260
+ d
261
+ )) }),
262
+ /* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
263
+ const day = i - emptyCells + 1;
264
+ const date = month.date.with({ day: 1 }).add({
265
+ days: i - emptyCells
266
+ });
267
+ const isInMonth = day > 0 && day <= month.days;
268
+ const isToday = isInMonth && date.equals(today);
269
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
270
+ const inRange = isInMonth && isInRange(date);
271
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
272
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
273
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
274
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
275
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
276
+ return /* @__PURE__ */ jsx(
277
+ DateCell,
278
+ {
279
+ date,
280
+ isInMonth: !!isInMonth,
281
+ isToday: !!isToday,
282
+ isSelected: !!isSelected,
283
+ inRange: !!inRange,
284
+ isDisabled: !!isDisabled,
285
+ onClick: () => handleDayClick(date),
286
+ onMouseEnter: () => setHoveredDate(date),
287
+ onMouseLeave: () => setHoveredDate(void 0),
288
+ isRangeStart: !!isRangeStart,
289
+ isRangeEnd: !!isRangeEnd,
290
+ isRangeDisabled: mode === "single" && disableRange,
291
+ cellPadding: "p-1.5 md:p-2 lg:p-2.5"
292
+ },
293
+ i
294
+ );
295
+ }) })
296
+ ]
297
+ }
298
+ ),
299
+ mode === "double" && idx === 0 && /* @__PURE__ */ jsx(
300
+ "div",
301
+ {
302
+ className: clsx(
303
+ "self-stretch bg-border-primary-normal rounded-base mx-mobile-component-padding desktop:mx-desktop-component-padding compact:mx-desktop-compact-component-padding",
304
+ // 1px width, full height, matches Figma divider
305
+ "w-px"
306
+ )
307
+ }
308
+ )
309
+ ] }, month.name + month.year);
310
+ })
311
+ }
312
+ )
313
+ }
314
+ );
315
+ }
316
+ var CalendarRange_default = CalendarRange;
317
+
318
+ export {
319
+ isWeekend,
320
+ CalendarRange,
321
+ CalendarRange_default
322
+ };
@@ -0,0 +1,119 @@
1
+ import {
2
+ Input
3
+ } from "./chunk-BWRHL2AG.js";
4
+ import {
5
+ __objRest,
6
+ __spreadValues
7
+ } from "./chunk-ORMEWXMH.js";
8
+
9
+ // src/components/Search.tsx
10
+ import {
11
+ useEffect,
12
+ useId,
13
+ useRef,
14
+ useState
15
+ } from "react";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ var Search = (_a) => {
18
+ var _b = _a, {
19
+ label,
20
+ error,
21
+ children,
22
+ readOnly,
23
+ renderMenu,
24
+ onClick,
25
+ className,
26
+ wrapperClassName,
27
+ removeRoundness
28
+ } = _b, props = __objRest(_b, [
29
+ "label",
30
+ "error",
31
+ "children",
32
+ "readOnly",
33
+ "renderMenu",
34
+ "onClick",
35
+ "className",
36
+ "wrapperClassName",
37
+ "removeRoundness"
38
+ ]);
39
+ const inputRef = useRef(null);
40
+ const inputContainerRef = useRef(null);
41
+ const preventFocusOnInitialRender = useRef(true);
42
+ const [show, setShow] = useState(false);
43
+ const [clearing, setClearing] = useState(false);
44
+ const uniqueId = useId();
45
+ const searchMenuName = `search-menu-${uniqueId}`;
46
+ useEffect(() => {
47
+ var _a2;
48
+ if (preventFocusOnInitialRender.current) {
49
+ preventFocusOnInitialRender.current = false;
50
+ return;
51
+ }
52
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
53
+ }, [props.value]);
54
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ /* @__PURE__ */ jsx(
56
+ Input,
57
+ __spreadValues({
58
+ variant: "search",
59
+ inputContainerRef,
60
+ ref: inputRef,
61
+ label,
62
+ wrapperClassName,
63
+ onClick: (e) => {
64
+ if (props.disabled || readOnly) {
65
+ return;
66
+ }
67
+ if (clearing) {
68
+ setClearing(false);
69
+ return;
70
+ }
71
+ onClick == null ? void 0 : onClick(e);
72
+ setShow(!show);
73
+ },
74
+ onClear: () => {
75
+ setClearing(true);
76
+ },
77
+ onKeyDown: (e) => {
78
+ setShow(true);
79
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
80
+ e.preventDefault();
81
+ const menu = document.querySelector(`[data-menu="${searchMenuName}"]`);
82
+ const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
83
+ if (selectedMenuOption) {
84
+ const allMenuOptions = Array.from((menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []);
85
+ const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
86
+ let targetOption;
87
+ if (e.key === "ArrowDown") {
88
+ targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
89
+ } else {
90
+ targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
91
+ }
92
+ targetOption == null ? void 0 : targetOption.focus();
93
+ } else {
94
+ const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector('[role="menuitem"]:last-child');
95
+ toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
96
+ }
97
+ }
98
+ },
99
+ error,
100
+ readOnly,
101
+ removeRoundness,
102
+ focus: show
103
+ }, props)
104
+ ),
105
+ renderMenu ? renderMenu({
106
+ positionTo: inputContainerRef,
107
+ show,
108
+ setShow,
109
+ topOffset: props.caption ? -16 : null,
110
+ autoFocusOff: true,
111
+ menuName: searchMenuName
112
+ }) : children
113
+ ] });
114
+ };
115
+ Search.displayName = "Search";
116
+
117
+ export {
118
+ Search
119
+ };
@@ -0,0 +1,12 @@
1
+ // src/components/Theme.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ function Theme({
4
+ theme,
5
+ children
6
+ }) {
7
+ return /* @__PURE__ */ jsx("div", { className: "contents", "data-theme": theme, children });
8
+ }
9
+
10
+ export {
11
+ Theme
12
+ };
@@ -0,0 +1,41 @@
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "./chunk-ORMEWXMH.js";
6
+
7
+ // src/components/Icon.tsx
8
+ import clsx from "clsx";
9
+ import { jsx } from "react/jsx-runtime";
10
+ function Icon(_a) {
11
+ var _b = _a, {
12
+ name,
13
+ size = 24,
14
+ variant = "outline"
15
+ } = _b, props = __objRest(_b, [
16
+ "name",
17
+ "size",
18
+ "variant"
19
+ ]);
20
+ const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
21
+ const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
22
+ return /* @__PURE__ */ jsx(
23
+ "span",
24
+ __spreadProps(__spreadValues({}, props), {
25
+ className: clsx(
26
+ "icon",
27
+ `icon-${size}`,
28
+ // size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
29
+ props.className
30
+ ),
31
+ style: __spreadValues({
32
+ fontVariationSettings: variantStyle + `, ${weightStyle}`
33
+ }, props.style),
34
+ children: name
35
+ })
36
+ );
37
+ }
38
+
39
+ export {
40
+ Icon
41
+ };