@dmsi/wedgekit-react 0.0.551 → 0.0.552

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 (137) hide show
  1. package/package.json +2 -3
  2. package/src/brand.css +0 -125
  3. package/src/classNames.ts +0 -174
  4. package/src/components/AccessChangerTabItem.tsx +0 -71
  5. package/src/components/Accordion.tsx +0 -108
  6. package/src/components/Alert.tsx +0 -81
  7. package/src/components/Breadcrumbs.tsx +0 -142
  8. package/src/components/Button.tsx +0 -216
  9. package/src/components/CalendarRange.tsx +0 -628
  10. package/src/components/Caption.tsx +0 -144
  11. package/src/components/Card.tsx +0 -88
  12. package/src/components/Checkbox.tsx +0 -206
  13. package/src/components/CompactImagesPreview.tsx +0 -135
  14. package/src/components/ContentTab.tsx +0 -84
  15. package/src/components/ContentTabs.tsx +0 -136
  16. package/src/components/DMSiLogo.tsx +0 -33
  17. package/src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx +0 -35
  18. package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +0 -74
  19. package/src/components/DataGrid/PinnedColumns.tsx +0 -183
  20. package/src/components/DataGrid/TableBody/LoadingCell.tsx +0 -44
  21. package/src/components/DataGrid/TableBody/TableBodyRow.tsx +0 -157
  22. package/src/components/DataGrid/TableBody/index.tsx +0 -185
  23. package/src/components/DataGrid/index.tsx +0 -756
  24. package/src/components/DataGrid/types.ts +0 -98
  25. package/src/components/DataGrid/utils.tsx +0 -15
  26. package/src/components/DataGridCell.tsx +0 -526
  27. package/src/components/DataTable.tsx +0 -881
  28. package/src/components/DateInput.tsx +0 -306
  29. package/src/components/DateRangeInput.tsx +0 -758
  30. package/src/components/DebugJson.tsx +0 -28
  31. package/src/components/Display.tsx +0 -66
  32. package/src/components/EditingContext.tsx +0 -43
  33. package/src/components/EmptyCartIcon.tsx +0 -18
  34. package/src/components/FilterGroup.tsx +0 -264
  35. package/src/components/FullViewportBox.tsx +0 -19
  36. package/src/components/Grid.tsx +0 -97
  37. package/src/components/Heading.tsx +0 -72
  38. package/src/components/HorizontalDivider.tsx +0 -22
  39. package/src/components/Icon.tsx +0 -39
  40. package/src/components/ImagePlaceholder.tsx +0 -22
  41. package/src/components/Input.tsx +0 -609
  42. package/src/components/InputGroup.tsx +0 -59
  43. package/src/components/Label.tsx +0 -46
  44. package/src/components/Link.tsx +0 -117
  45. package/src/components/List.tsx +0 -18
  46. package/src/components/ListGroup.tsx +0 -82
  47. package/src/components/LiveChatComponent.tsx +0 -56
  48. package/src/components/LoadingScrim.tsx +0 -33
  49. package/src/components/LogoAgilityTopBar.tsx +0 -54
  50. package/src/components/LogoDMSiTopBar.tsx +0 -33
  51. package/src/components/LogoMillworkTopBar.tsx +0 -119
  52. package/src/components/MainBar.tsx +0 -91
  53. package/src/components/MaxViewportBox.tsx +0 -19
  54. package/src/components/Menu.tsx +0 -316
  55. package/src/components/MenuOption.tsx +0 -330
  56. package/src/components/MobileDataGrid/ColumnList.tsx +0 -66
  57. package/src/components/MobileDataGrid/ColumnSelector/index.tsx +0 -97
  58. package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +0 -25
  59. package/src/components/MobileDataGrid/GridContextProvider/index.tsx +0 -132
  60. package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +0 -10
  61. package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +0 -27
  62. package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +0 -138
  63. package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +0 -81
  64. package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +0 -42
  65. package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +0 -68
  66. package/src/components/MobileDataGrid/dataGridReducer.ts +0 -55
  67. package/src/components/MobileDataGrid/index.tsx +0 -92
  68. package/src/components/MobileDataGrid/types.ts +0 -4
  69. package/src/components/Modal.tsx +0 -312
  70. package/src/components/ModalButtons.tsx +0 -62
  71. package/src/components/ModalContent.tsx +0 -31
  72. package/src/components/ModalHeader.tsx +0 -78
  73. package/src/components/ModalScrim.tsx +0 -42
  74. package/src/components/NavigationTab.tsx +0 -95
  75. package/src/components/NavigationTabs.tsx +0 -70
  76. package/src/components/NestedMenu.tsx +0 -131
  77. package/src/components/Notification.tsx +0 -128
  78. package/src/components/OptionPill.tsx +0 -139
  79. package/src/components/OrderCheckIcon.tsx +0 -19
  80. package/src/components/PDFViewer/DownloadIcon.tsx +0 -25
  81. package/src/components/PDFViewer/PDFElement.tsx +0 -90
  82. package/src/components/PDFViewer/PDFNavigation.tsx +0 -68
  83. package/src/components/PDFViewer/PDFPage.tsx +0 -34
  84. package/src/components/PDFViewer/index.tsx +0 -128
  85. package/src/components/Pagination.tsx +0 -182
  86. package/src/components/Paragraph.tsx +0 -55
  87. package/src/components/Password.tsx +0 -62
  88. package/src/components/ProductImagePreview/CarouselPagination.tsx +0 -54
  89. package/src/components/ProductImagePreview/MobileImageCarousel.tsx +0 -226
  90. package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +0 -219
  91. package/src/components/ProductImagePreview/Thumbnail.tsx +0 -55
  92. package/src/components/ProductImagePreview/ZoomWindow.tsx +0 -136
  93. package/src/components/ProductImagePreview/index.tsx +0 -182
  94. package/src/components/ProductImagePreview/useProductImagePreview.ts +0 -211
  95. package/src/components/ProjectBar.tsx +0 -82
  96. package/src/components/Radio.tsx +0 -146
  97. package/src/components/Search.tsx +0 -152
  98. package/src/components/SearchResultImage/index.tsx +0 -39
  99. package/src/components/Select.tsx +0 -114
  100. package/src/components/SideMenu.tsx +0 -30
  101. package/src/components/SideMenuGroup.tsx +0 -95
  102. package/src/components/SideMenuItem.tsx +0 -109
  103. package/src/components/SimpleTable.tsx +0 -77
  104. package/src/components/SkeletonParagraph.tsx +0 -31
  105. package/src/components/Spinner.tsx +0 -32
  106. package/src/components/Stack.tsx +0 -347
  107. package/src/components/StatusPill.tsx +0 -59
  108. package/src/components/Stepper.tsx +0 -128
  109. package/src/components/Subheader.tsx +0 -50
  110. package/src/components/Surface.tsx +0 -37
  111. package/src/components/Swatch.tsx +0 -1341
  112. package/src/components/Textarea.tsx +0 -102
  113. package/src/components/Theme.tsx +0 -27
  114. package/src/components/Time.tsx +0 -460
  115. package/src/components/Toast.tsx +0 -268
  116. package/src/components/Tooltip.tsx +0 -159
  117. package/src/components/TopBar.tsx +0 -139
  118. package/src/components/Upload.tsx +0 -107
  119. package/src/components/WorldpayIframe.tsx +0 -7
  120. package/src/components/index.ts +0 -34
  121. package/src/components/useMenuSystem.tsx +0 -456
  122. package/src/components/useMounted.tsx +0 -14
  123. package/src/darkmode.css +0 -278
  124. package/src/fonts.css +0 -23
  125. package/src/hooks/index.ts +0 -4
  126. package/src/hooks/useInfiniteScroll.tsx +0 -40
  127. package/src/hooks/useKeydown.ts +0 -42
  128. package/src/hooks/useMatchesMedia.ts +0 -18
  129. package/src/hooks/useTableLayout.ts +0 -106
  130. package/src/index.css +0 -800
  131. package/src/index.tsx +0 -5
  132. package/src/types.ts +0 -150
  133. package/src/utils/date.ts +0 -236
  134. package/src/utils/formatting.tsx +0 -81
  135. package/src/utils/index.ts +0 -4
  136. package/src/utils/mergeObjectArrays.ts +0 -18
  137. package/src/utils.ts +0 -24
@@ -1,347 +0,0 @@
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
- import { paddingYUsingLayoutGroupGap } from "../classNames";
12
-
13
- type StackProps = {
14
- children: React.ReactNode;
15
- horizontal?: boolean;
16
- horizontalMobile?: boolean;
17
- padding?: boolean;
18
- paddingX?: boolean;
19
- paddingY?: boolean;
20
- paddingBottom?: boolean;
21
- paddingTop?: boolean;
22
- paddingLeft?: boolean;
23
- paddingRight?: boolean;
24
- margin?: boolean;
25
- marginX?: boolean;
26
- marginY?: boolean;
27
- sizing?: Sizing;
28
- flexShrink?: number;
29
- flexGrow?: number;
30
- elevation?: Elevation;
31
- rounded?: boolean;
32
- centered?: boolean;
33
- width?: number | "full" | "fit" | "max";
34
- maxWidth?: number | string;
35
- minWidth?: number;
36
- height?: string | number | "full";
37
- minHeight?: number | string;
38
- maxHeight?: number | string;
39
- borderColor?: BorderColorTokens;
40
- borderTopColor?: BorderColorTokens;
41
- borderRightColor?: BorderColorTokens;
42
- borderBottomColor?: BorderColorTokens;
43
- borderLeftColor?: BorderColorTokens;
44
- backgroundColor?: BackgroundColorTokens;
45
- overflowY?: "hidden" | "scroll" | "auto" | "inherit";
46
- overflowX?: "hidden" | "scroll" | "auto" | "inherit";
47
- zIndex?: number;
48
- position?: CSSProperties["position"];
49
- top?: number;
50
- bottom?: number;
51
- left?: number;
52
- id?: string;
53
- testid?: string;
54
- noGap?: boolean;
55
- marginTop?: boolean;
56
- marginBottom?: boolean;
57
- className?: string;
58
- } & FlexProps &
59
- Omit<ComponentProps<"div">, "className" | "id">;
60
-
61
- export interface FlexProps {
62
- items?: ItemsAlign;
63
- justify?: JustifyAlign;
64
- grow?: boolean;
65
- flexGrow?: string | number;
66
- flexShrink?: string | number;
67
- flexWrap?: "wrap" | "wrap-reverse";
68
- }
69
-
70
- const getFlexClassNames = ({ items, justify, grow }: FlexProps) =>
71
- clsx(
72
- "flex",
73
- items === "start" && "items-start",
74
- grow && "grow",
75
- items === "start" && "items-start",
76
- items === "center" && "items-center",
77
- items === "end" && "items-end",
78
- items === "start-center" && "items-start desktop:items-center",
79
- justify === "start" && "justify-start",
80
- justify === "center" && "justify-center",
81
- justify === "end" && "justify-end",
82
- justify === "end" && "justify-end",
83
- justify === "between" && "justify-between",
84
- justify === "around" && "justify-around",
85
- );
86
-
87
- const useGapClassNames = (sizing: Sizing) => {
88
- return clsx(
89
- sizing === "layout-group" &&
90
- "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
91
- sizing === "layout" &&
92
- "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
93
- sizing === "container" &&
94
- "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
95
- sizing === "component" &&
96
- "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-compact-component-gap",
97
- );
98
- };
99
-
100
- export const Stack = ({
101
- children,
102
- items,
103
- justify,
104
- grow,
105
- padding,
106
- paddingX,
107
- paddingY,
108
- paddingBottom,
109
- paddingTop,
110
- paddingLeft,
111
- paddingRight,
112
- margin,
113
- marginX,
114
- marginY,
115
- horizontal,
116
- horizontalMobile,
117
- elevation = 0,
118
- rounded,
119
- centered,
120
- width,
121
- minHeight,
122
- maxWidth,
123
- minWidth,
124
- height,
125
- maxHeight,
126
- borderColor,
127
- borderTopColor,
128
- borderRightColor,
129
- borderBottomColor,
130
- borderLeftColor,
131
- backgroundColor,
132
- sizing = "none",
133
- overflowY = "inherit",
134
- overflowX = "inherit",
135
- flexShrink,
136
- flexGrow,
137
- position,
138
- top,
139
- left,
140
- id,
141
- noGap,
142
- marginTop,
143
- marginBottom,
144
- testid,
145
- bottom,
146
- zIndex,
147
- flexWrap,
148
- className,
149
- ...props
150
- }: StackProps) => {
151
- const flexClassNames = getFlexClassNames({ items, justify, grow });
152
- const gapClassNames = useGapClassNames(sizing);
153
-
154
- return (
155
- <div
156
- id={id}
157
- data-testid={testid}
158
- {...props}
159
- style={{
160
- height:
161
- height === "full"
162
- ? "100%"
163
- : height !== undefined
164
- ? `${height}px`
165
- : undefined,
166
- maxHeight:
167
- maxHeight !== undefined
168
- ? isNaN(+maxHeight)
169
- ? maxHeight
170
- : `${maxHeight}px`
171
- : props.style?.maxHeight,
172
- maxWidth:
173
- maxWidth !== undefined
174
- ? isNaN(+maxWidth)
175
- ? maxWidth
176
- : `${maxWidth}px`
177
- : props.style?.maxWidth,
178
- minHeight:
179
- minHeight !== undefined
180
- ? isNaN(+minHeight)
181
- ? minHeight
182
- : `${minHeight}px`
183
- : props.style?.minHeight,
184
-
185
- width:
186
- width !== undefined && typeof width === "number"
187
- ? `${width}px`
188
- : undefined,
189
- minWidth: minWidth !== undefined ? `${minWidth}px` : undefined,
190
- border: borderColor
191
- ? `1px solid var(--color-${borderColor})`
192
- : undefined,
193
- borderTop: borderTopColor
194
- ? `1px solid var(--color-${borderTopColor})`
195
- : undefined,
196
- borderRight: borderRightColor
197
- ? `1px solid var(--color-${borderRightColor})`
198
- : undefined,
199
- borderBottom: borderBottomColor
200
- ? `1px solid var(--color-${borderBottomColor})`
201
- : undefined,
202
- borderLeft: borderLeftColor
203
- ? `1px solid var(--color-${borderLeftColor})`
204
- : undefined,
205
- backgroundColor: backgroundColor
206
- ? `var(--color-${backgroundColor})`
207
- : undefined,
208
- flexGrow: flexGrow !== undefined ? flexGrow : undefined,
209
- flexShrink: flexShrink !== undefined ? flexShrink : undefined,
210
- position: position !== undefined ? position : undefined,
211
- top: top !== undefined ? `${top}px` : undefined,
212
- bottom: bottom !== undefined ? `${bottom}px` : undefined,
213
- left: left !== undefined ? `${left}px` : undefined,
214
- borderBlock: props.style?.borderBlock,
215
- marginInline: props.style?.marginInline,
216
- zIndex: zIndex !== undefined ? zIndex : undefined,
217
- flexWrap: flexWrap,
218
- paddingInline: props.style?.paddingInline,
219
- gap: props.style?.gap,
220
- ...props.style,
221
- }}
222
- className={clsx(
223
- "scrollbar-thin",
224
- "max-w-screen",
225
- width !== "fit" && "w-full",
226
- width === "full" && "w-full",
227
- width === "max" && "w-max",
228
- centered && "mx-auto",
229
- overflowY == "auto" && "overflow-y-auto",
230
- overflowY == "hidden" && "overflow-y-hidden",
231
- overflowY == "scroll" && "overflow-y-scroll",
232
- overflowX == "auto" && "overflow-x-auto",
233
- overflowX == "hidden" && "overflow-x-hidden",
234
- overflowX == "scroll" && "overflow-x-scroll",
235
- padding &&
236
- sizing === "container" &&
237
- "p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding",
238
- padding &&
239
- sizing === "layout" &&
240
- "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
241
- padding &&
242
- sizing === "layout-group" &&
243
- "p-mobile-layout-group-padding desktop:p-desktop-layout-group-padding compact:p-desktop-compact-layout-group-padding",
244
- padding &&
245
- sizing === "component" &&
246
- "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
247
- paddingX &&
248
- sizing === "container" &&
249
- "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding",
250
- paddingX &&
251
- sizing === "layout" &&
252
- "px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding",
253
- paddingX &&
254
- sizing === "layout-group" &&
255
- "px-mobile-layout-group-padding desktop:px-desktop-layout-group-padding compact:px-desktop-compact-layout-group-padding",
256
- paddingX &&
257
- sizing === "component" &&
258
- "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding",
259
- paddingY &&
260
- sizing === "container" &&
261
- "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding",
262
- paddingY &&
263
- sizing === "layout" &&
264
- "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
265
- paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
266
- paddingY &&
267
- sizing === "component" &&
268
- "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
269
- paddingBottom &&
270
- sizing === "container" &&
271
- "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
272
- paddingBottom &&
273
- sizing === "layout" &&
274
- "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
275
- paddingBottom &&
276
- sizing === "layout-group" &&
277
- "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
278
- paddingBottom &&
279
- sizing === "component" &&
280
- "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
281
- paddingTop &&
282
- sizing === "container" &&
283
- "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
284
- paddingTop &&
285
- sizing === "layout" &&
286
- "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
287
- paddingTop &&
288
- sizing === "layout-group" &&
289
- "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
290
- paddingTop &&
291
- sizing === "component" &&
292
- "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
293
- paddingLeft &&
294
- sizing === "container" &&
295
- "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
296
- paddingLeft &&
297
- sizing === "layout" &&
298
- "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
299
- paddingLeft &&
300
- sizing === "layout-group" &&
301
- "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
302
- paddingLeft &&
303
- sizing === "component" &&
304
- "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
305
- paddingRight &&
306
- sizing === "container" &&
307
- "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
308
- paddingRight &&
309
- sizing === "layout" &&
310
- "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
311
- paddingRight &&
312
- sizing === "layout-group" &&
313
- "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
314
- paddingRight &&
315
- sizing === "component" &&
316
- "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
317
- margin &&
318
- sizing === "container" &&
319
- "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
320
- marginX &&
321
- sizing === "container" &&
322
- "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
323
- marginTop &&
324
- sizing === "container" &&
325
- "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
326
- marginBottom &&
327
- sizing === "container" &&
328
- "mb-mobile-container-padding desktop:mb-desktop-container-padding compact:mb-compact-container-padding",
329
- marginY &&
330
- sizing === "container" &&
331
- "my-mobile-container-padding desktop:my-desktop-container-padding compact:my-compact-container-padding",
332
- horizontal ? "desktop:flex-row" : "desktop:flex-col",
333
- horizontalMobile ? "flex-row" : "flex-col",
334
- flexClassNames,
335
- !noGap && gapClassNames,
336
- elevation === 0 && "shadow-none",
337
- elevation === 2 && "shadow-2",
338
- elevation === 4 && "shadow-4",
339
- elevation === 16 && "shadow-16",
340
- rounded && "rounded",
341
- className
342
- )}
343
- >
344
- {children}
345
- </div>
346
- );
347
- };
@@ -1,59 +0,0 @@
1
- import { PropsWithChildren } from "react";
2
- import { Label } from "./Label";
3
- import clsx from "clsx";
4
- import { componentPaddingYUsingComponentGap, paddingXUsingLayoutGroupGap } from "../classNames";
5
-
6
- type StatusPillProps = PropsWithChildren<{
7
- id?: string;
8
- testid?: string;
9
- intent?: "neutral" | "warning" | "success" | "critical";
10
- state?: "in-progress" | "completed";
11
- }>;
12
-
13
- export const StatusPill = ({
14
- children,
15
- state = "in-progress",
16
- intent = "neutral",
17
- id,
18
- testid,
19
- ...props
20
- }: StatusPillProps) => {
21
- const textColor = clsx(
22
- state === "completed" && ["neutral", "critical"].includes(intent)
23
- ? "text-text-on-action-primary-normal"
24
- : "text-neutral-500",
25
- );
26
-
27
- const backgroundColor = clsx({
28
- "bg-neutral-200": intent === "neutral" && state === "in-progress",
29
- "bg-text-primary-normal": intent === "neutral" && state === "completed",
30
- "bg-warning-200": intent === "warning" && state === "in-progress",
31
- "bg-background-warning-normal":
32
- intent === "warning" && state === "completed",
33
- "bg-success-200": intent === "success" && state === "in-progress",
34
- "bg-background-success-normal":
35
- intent === "success" && state === "completed",
36
- "bg-critical-200": intent === "critical" && state === "in-progress",
37
- "bg-background-critical-normal":
38
- intent === "critical" && state === "completed",
39
- });
40
-
41
- return (
42
- <div
43
- id={id}
44
- data-testid={testid}
45
- {...props}
46
- className={clsx(
47
- "rounded flex items-center",
48
- textColor,
49
- backgroundColor,
50
- paddingXUsingLayoutGroupGap,
51
- componentPaddingYUsingComponentGap
52
- )}
53
- >
54
- <Label id={id ? `${id}-label` : undefined} testid={testid ? `${testid}-label` : undefined}>{children}</Label>
55
- </div>
56
- );
57
- };
58
-
59
- StatusPill.displayName = "StatusPill";
@@ -1,128 +0,0 @@
1
- "use client";
2
- import { Button } from "./Button";
3
- import { InputBase } from "./Input";
4
- import { Icon } from "./Icon";
5
- import clsx from "clsx";
6
- import { componentGap } from "../classNames";
7
-
8
- type StepperProps = {
9
- error?: boolean;
10
- disabled?: boolean;
11
- id?: string;
12
- testid?: string;
13
- value: number;
14
- setValue: React.Dispatch<React.SetStateAction<number>>;
15
- onIncrease?: () => void;
16
- onDecrease?: () => void;
17
- min?: number;
18
- max?: number;
19
- };
20
-
21
- export const Stepper = ({
22
- error,
23
- disabled,
24
- value,
25
- setValue,
26
- onDecrease,
27
- onIncrease,
28
- id,
29
- testid,
30
- min,
31
- max,
32
- ...props
33
- }: StepperProps) => {
34
- function handleIncrease() {
35
- if (max != null && value >= max) {
36
- return;
37
- }
38
-
39
- setValue((prevVal) => prevVal + 1);
40
-
41
- onIncrease?.();
42
- }
43
-
44
- function handleDecrease() {
45
- if (min != null && value <= min) {
46
- return;
47
- }
48
-
49
- setValue((prevVal) => prevVal - 1);
50
-
51
- onDecrease?.();
52
- }
53
-
54
- return (
55
- <div
56
- id={id}
57
- data-testid={testid}
58
- className={clsx("flex items-center", componentGap)}
59
- >
60
- <Button
61
- id={id ? `${id}-decrease-button` : undefined}
62
- testid={testid ? `${testid}-decrease-button` : undefined}
63
- iconOnly
64
- variant="tertiary"
65
- leftIcon={
66
- <span
67
- className={clsx(
68
- !disabled || (value > 0 && "text-icon-action-primary-normal"),
69
- disabled || (value === 0 && "text-icon-action-primary-disabled"),
70
- "contents",
71
- )}
72
- >
73
- <Icon name="remove" />
74
- </span>
75
- }
76
- onClick={handleDecrease}
77
- disabled={disabled || value <= 0 || (min != null && value <= min)}
78
- />
79
-
80
- <div className="flex-1">
81
- <InputBase
82
- {...props}
83
- id={id ? `${id}-input` : undefined}
84
- testid={testid ? `${testid}-input` : undefined}
85
- type="number"
86
- align="center"
87
- value={value}
88
- onChange={(e) => {
89
- const nextValue = +e.target.value;
90
- const lessThanMinimum = min != null && nextValue < min;
91
- const greaterThanMaximum = max != null && nextValue > max;
92
-
93
- if (lessThanMinimum || greaterThanMaximum) {
94
- return;
95
- }
96
-
97
- setValue(nextValue);
98
- }}
99
- error={error}
100
- disabled={disabled}
101
- 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"
102
- />
103
- </div>
104
-
105
- <Button
106
- id={id ? `${id}-increase-button` : undefined}
107
- testid={testid ? `${testid}-increase-button` : undefined}
108
- iconOnly
109
- variant="tertiary"
110
- leftIcon={
111
- <span
112
- className={clsx(
113
- !disabled && "text-icon-action-primary-normal",
114
- disabled && "text-icon-action-primary-disabled",
115
- "contents",
116
- )}
117
- >
118
- <Icon name="add" />
119
- </span>
120
- }
121
- onClick={handleIncrease}
122
- disabled={disabled || (max != null && value >= max)}
123
- />
124
- </div>
125
- );
126
- };
127
-
128
- Stepper.displayName = "Stepper";
@@ -1,50 +0,0 @@
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
- id?: string;
10
- testid?: string;
11
- } & AsProps<Tags> &
12
- TextAttributes &
13
- TypographyProps;
14
-
15
- export const Subheader = ({
16
- className,
17
- children,
18
- as = "span",
19
- align,
20
- color,
21
- tall,
22
- id,
23
- testid,
24
- ...props
25
- }: SubheaderProps) => {
26
- const Element = as;
27
- return (
28
- <Element
29
- id={id}
30
- data-testid={testid}
31
- className={clsx(
32
- typography.subheader,
33
- className,
34
- align === "left" && "text-left",
35
- align === "center" && "text-center",
36
- align === "right" && "text-right",
37
- tall && "!leading-6",
38
- )}
39
- style={{
40
- ...props.style,
41
- color: color ? `var(--color-${color})` : undefined,
42
- }}
43
- {...props}
44
- >
45
- {children}
46
- </Element>
47
- );
48
- };
49
-
50
- Subheader.displayName = "Subheader";
@@ -1,37 +0,0 @@
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
- id?: string;
9
- }>;
10
-
11
- export const Surface = ({
12
- children,
13
- className,
14
- elevation = 0,
15
- id,
16
- ...props
17
- }: SurfaceProps) => {
18
- return (
19
- <div
20
- id={id}
21
- className={clsx(
22
- "rounded-base",
23
- {
24
- "shadow-2": elevation === 2,
25
- "shadow-4": elevation === 4,
26
- "shadow-16": elevation === 16,
27
- },
28
- className,
29
- )}
30
- {...props}
31
- >
32
- {children}
33
- </div>
34
- );
35
- };
36
-
37
- Surface.displayName = "Surface";