@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,179 @@
1
+ import clsx from "clsx";
2
+ import {
3
+ BackgroundColorTokens,
4
+ BorderColorTokens,
5
+ Elevation,
6
+ ItemsAlign,
7
+ JustifyAlign,
8
+ Sizing,
9
+ } from "../types";
10
+ import { ComponentProps, CSSProperties } from "react";
11
+
12
+ type StackProps = {
13
+ children: React.ReactNode;
14
+ horizontal?: boolean;
15
+ horizontalMobile?: boolean;
16
+ padding?: boolean;
17
+ paddingX?: boolean;
18
+ sizing?: Sizing;
19
+ flexShrink?: number;
20
+ flexGrow?: number;
21
+ elevation?: Elevation;
22
+ rounded?: boolean;
23
+ centered?: boolean;
24
+ width?: number | "full" | "fit";
25
+ maxWidth?: number;
26
+ minWidth?: number;
27
+ height?: number | "full";
28
+ maxHeight?: number;
29
+ borderColor?: BorderColorTokens;
30
+ backgroundColor?: BackgroundColorTokens;
31
+ overflowY?: "hidden" | "scroll" | "auto" | "inherit";
32
+ overflowX?: "hidden" | "scroll" | "auto" | "inherit";
33
+ zIndex?: number;
34
+ position?: CSSProperties['position'];
35
+ top?: number;
36
+ left?: number;
37
+ } & FlexProps &
38
+ Omit<ComponentProps<"div">, "className">;
39
+
40
+ export interface FlexProps {
41
+ items?: ItemsAlign;
42
+ justify?: JustifyAlign;
43
+ grow?: boolean;
44
+ flexGrow?: string | number;
45
+ flexShrink?: string | number;
46
+ }
47
+
48
+ const useFlexClassNames = ({ items, justify, grow }: FlexProps) =>
49
+ clsx(
50
+ "flex",
51
+ items === "start" && "items-start",
52
+ grow && "grow",
53
+ items === "start" && "items-start",
54
+ items === "center" && "items-center",
55
+ items === "end" && "items-end",
56
+ items === "start-center" && "items-start desktop:items-center",
57
+ justify === "start" && "justify-start",
58
+ justify === "center" && "justify-center",
59
+ justify === "end" && "justify-end",
60
+ justify === "end" && "justify-end",
61
+ justify === "between" && "justify-between",
62
+ justify === "around" && "justify-around",
63
+ );
64
+
65
+ export const Stack = ({
66
+ children,
67
+ items,
68
+ justify,
69
+ grow,
70
+ padding,
71
+ paddingX,
72
+ horizontal,
73
+ horizontalMobile,
74
+ elevation = 0,
75
+ rounded,
76
+ centered,
77
+ width,
78
+ maxWidth,
79
+ minWidth,
80
+ height,
81
+ maxHeight,
82
+ borderColor,
83
+ backgroundColor,
84
+ sizing = "none",
85
+ overflowY = "inherit",
86
+ overflowX = "inherit",
87
+ flexShrink,
88
+ flexGrow,
89
+ position,
90
+ top,
91
+ left
92
+ }: StackProps) => {
93
+ const flexClassNames = useFlexClassNames({ items, justify, grow });
94
+
95
+ return (
96
+ <div
97
+ style={{
98
+ height:
99
+ height === "full"
100
+ ? "100%"
101
+ : height !== undefined
102
+ ? `${height}px`
103
+ : undefined,
104
+ maxHeight: maxHeight !== undefined ? `${maxHeight}px` : undefined,
105
+ maxWidth: maxWidth !== undefined ? `${maxWidth}px` : undefined,
106
+ width:
107
+ width !== undefined && typeof width === "number"
108
+ ? `${width}px`
109
+ : undefined,
110
+ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined,
111
+ border: borderColor
112
+ ? `1px solid var(--color-${borderColor})`
113
+ : undefined,
114
+ backgroundColor: backgroundColor
115
+ ? `var(--color-${backgroundColor})`
116
+ : undefined,
117
+ flexGrow: flexGrow !== undefined ? flexGrow : undefined,
118
+ flexShrink: flexShrink !== undefined ? flexShrink : undefined,
119
+ position: position !== undefined ? position : undefined,
120
+ top: top !== undefined ? `${top}px` : undefined,
121
+ left: left !== undefined ? `${left}px` : undefined,
122
+ }}
123
+ className={clsx(
124
+ "scrollbar-thin",
125
+ width !== "fit" && "w-full",
126
+ width === "full" && "w-full",
127
+ centered && "mx-auto",
128
+ overflowY == "auto" && "overflow-y-auto",
129
+ overflowY == "hidden" && "overflow-y-hidden",
130
+ overflowY == "scroll" && "overflow-y-scroll",
131
+ overflowX == "auto" && "overflow-x-auto",
132
+ overflowX == "hidden" && "overflow-x-hidden",
133
+ overflowX == "scroll" && "overflow-x-scroll",
134
+ padding &&
135
+ sizing === "container" &&
136
+ "p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding",
137
+ padding &&
138
+ sizing === "layout" &&
139
+ "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
140
+ padding &&
141
+ sizing === "layout-group" &&
142
+ "p-mobile-layout-group-padding desktop:p-desktop-layout-group-padding compact:p-desktop-compact-layout-group-padding",
143
+ padding &&
144
+ sizing === "component" &&
145
+ "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
146
+ paddingX &&
147
+ sizing === "container" &&
148
+ "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding",
149
+ paddingX &&
150
+ sizing === "layout" &&
151
+ "px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding",
152
+ paddingX &&
153
+ sizing === "layout-group" &&
154
+ "px-mobile-layout-group-padding desktop:px-desktop-layout-group-padding compact:px-desktop-compact-layout-group-padding",
155
+ paddingX &&
156
+ sizing === "component" &&
157
+ "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding",
158
+ horizontal ? "desktop:flex-row" : "desktop:flex-col",
159
+ horizontalMobile ? "flex-row" : "flex-col",
160
+ flexClassNames,
161
+ sizing === "layout-group" &&
162
+ "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
163
+ sizing === "layout" &&
164
+ "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
165
+ sizing === "container" &&
166
+ "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
167
+ sizing === "component" &&
168
+ "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-compact-component-gap",
169
+ elevation === 0 && "shadow-none",
170
+ elevation === 2 && "shadow-2",
171
+ elevation === 4 && "shadow-4",
172
+ elevation === 16 && "shadow-16",
173
+ rounded && "rounded",
174
+ )}
175
+ >
176
+ {children}
177
+ </div>
178
+ );
179
+ };
@@ -0,0 +1,51 @@
1
+ import { PropsWithChildren } from "react";
2
+ import { Label } from "./Label";
3
+ import clsx from "clsx";
4
+
5
+ type StatusPillProps = PropsWithChildren<{
6
+ intent?: "neutral" | "warning" | "success" | "critical";
7
+ state?: "in-progress" | "completed";
8
+ }>;
9
+
10
+
11
+ export const StatusPill = ({
12
+ children,
13
+ state = "in-progress",
14
+ intent = "neutral",
15
+ ...props
16
+ }: StatusPillProps) => {
17
+ const textColor = clsx(
18
+ state === "completed" && ["neutral", "critical"].includes(intent)
19
+ ? "text-text-on-action-primary-normal"
20
+ : "text-neutral-500",
21
+ );
22
+
23
+ const backgroundColor = clsx({
24
+ "bg-neutral-200": intent === "neutral" && state === "in-progress",
25
+ "bg-text-primary-normal": intent === "neutral" && state === "completed",
26
+ "bg-warning-200": intent === "warning" && state === "in-progress",
27
+ "bg-background-warning-normal":
28
+ intent === "warning" && state === "completed",
29
+ "bg-success-200": intent === "success" && state === "in-progress",
30
+ "bg-background-success-normal":
31
+ intent === "success" && state === "completed",
32
+ "bg-critical-200": intent === "critical" && state === "in-progress",
33
+ "bg-background-critical-normal":
34
+ intent === "critical" && state === "completed",
35
+ });
36
+
37
+ return (
38
+ <div
39
+ {...props}
40
+ className={clsx(
41
+ "px-desktop-component-padding py-desktop-compact-component-padding rounded flex items-center",
42
+ textColor,
43
+ backgroundColor,
44
+ )}
45
+ >
46
+ <Label>{children}</Label>
47
+ </div>
48
+ );
49
+ };
50
+
51
+ StatusPill.displayName = "StatusPill";
@@ -0,0 +1,91 @@
1
+ "use client";
2
+ import { Button } from "./Button";
3
+ import { InputBase } from "./Input";
4
+ import { Icon } from "./Icon";
5
+ import clsx from "clsx";
6
+
7
+ type StepperProps = {
8
+ error?: boolean;
9
+ disabled?: boolean;
10
+ id?: string;
11
+ value: number;
12
+ setValue: React.Dispatch<React.SetStateAction<number>>;
13
+ onIncrease?: () => void;
14
+ onDecrease?: () => void;
15
+ };
16
+
17
+ export const Stepper = ({
18
+ error,
19
+ disabled,
20
+ value,
21
+ setValue,
22
+ onDecrease,
23
+ onIncrease,
24
+ ...props
25
+ }: StepperProps) => {
26
+ function handleIncrease() {
27
+ setValue((prevVal) => prevVal + 1);
28
+ onIncrease?.();
29
+ }
30
+
31
+ function handleDecrease() {
32
+ setValue((prevVal) => prevVal - 1);
33
+ onDecrease?.();
34
+ }
35
+
36
+ return (
37
+ <div className="flex items-center gap-desktop-component-gap">
38
+ <Button
39
+ iconOnly
40
+ variant="tertiary"
41
+ leftIcon={
42
+ <span
43
+ className={clsx(
44
+ !disabled || (value > 0 && "text-icon-action-primary-normal"),
45
+ disabled || (value === 0 && "text-icon-action-primary-disabled"),
46
+ "contents",
47
+ )}
48
+ >
49
+ <Icon name="remove" />
50
+ </span>
51
+ }
52
+ onClick={handleDecrease}
53
+ disabled={disabled || value === 0}
54
+ />
55
+
56
+ <div className="flex-1">
57
+ <InputBase
58
+ {...props}
59
+ id={props.id}
60
+ type="number"
61
+ align="center"
62
+ value={value}
63
+ onChange={(e) => setValue(+e.target.value)}
64
+ error={error}
65
+ disabled={disabled}
66
+ className="!w-6 !h-4.5 !px-0 disabled:!text-text-on-action-primary-disabled disabled:!bg-background-action-secondary-disabled disabled:!border-border-primary-normal"
67
+ />
68
+ </div>
69
+
70
+ <Button
71
+ iconOnly
72
+ variant="tertiary"
73
+ leftIcon={
74
+ <span
75
+ className={clsx(
76
+ !disabled && "text-icon-action-primary-normal",
77
+ disabled && "text-icon-action-primary-disabled",
78
+ "contents",
79
+ )}
80
+ >
81
+ <Icon name="add" />
82
+ </span>
83
+ }
84
+ onClick={handleIncrease}
85
+ disabled={disabled}
86
+ />
87
+ </div>
88
+ );
89
+ };
90
+
91
+ Stepper.displayName = "Stepper";
@@ -0,0 +1,44 @@
1
+ import clsx from "clsx";
2
+ import { AsProps, TextAttributes, TypographyProps } from "../types";
3
+ import { typography } from "../classNames";
4
+
5
+ type Tags = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
6
+
7
+ type SubheaderProps = {
8
+ as?: Tags;
9
+ } & AsProps<Tags> &
10
+ TextAttributes &
11
+ TypographyProps;
12
+
13
+ export const Subheader = ({
14
+ className,
15
+ children,
16
+ as = "span",
17
+ align,
18
+ color,
19
+ tall,
20
+ ...props
21
+ }: SubheaderProps) => {
22
+ const Element = as;
23
+ return (
24
+ <Element
25
+ className={clsx(
26
+ typography.subheader,
27
+ className,
28
+ align === "left" && "text-left",
29
+ align === "center" && "text-center",
30
+ align === "right" && "text-right",
31
+ tall && "!leading-6",
32
+ )}
33
+ style={{
34
+ ...props.style,
35
+ color: color ? `var(--color-${color})` : undefined,
36
+ }}
37
+ {...props}
38
+ >
39
+ {children}
40
+ </Element>
41
+ );
42
+ };
43
+
44
+ Subheader.displayName = "Subheader";
@@ -0,0 +1,34 @@
1
+ import clsx from "clsx";
2
+ import { HTMLAttributes, PropsWithChildren } from "react";
3
+
4
+ type SurfaceProps = HTMLAttributes<HTMLDivElement> &
5
+ PropsWithChildren<{
6
+ className?: string;
7
+ elevation?: 0 | 2 | 4 | 16;
8
+ }>;
9
+
10
+ export const Surface = ({
11
+ children,
12
+ className,
13
+ elevation = 0,
14
+ ...props
15
+ }: SurfaceProps) => {
16
+ return (
17
+ <div
18
+ className={clsx(
19
+ "rounded-base",
20
+ {
21
+ "shadow-2": elevation === 2,
22
+ "shadow-4": elevation === 4,
23
+ "shadow-16": elevation === 16,
24
+ },
25
+ className,
26
+ )}
27
+ {...props}
28
+ >
29
+ {children}
30
+ </div>
31
+ );
32
+ };
33
+
34
+ Surface.displayName = "Surface";