@noya-app/noya-designsystem 0.1.29 → 0.1.31

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noya-app/noya-designsystem",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "@dnd-kit/sortable": "4.0.0",
16
16
  "@noya-app/noya-colorpicker": "0.1.11",
17
17
  "@noya-app/noya-utils": "0.1.2",
18
- "@noya-app/noya-geometry": "0.1.4",
18
+ "@noya-app/noya-geometry": "0.1.5",
19
19
  "@noya-app/noya-icons": "0.1.4",
20
20
  "@noya-app/noya-keymap": "0.1.2",
21
21
  "@radix-ui/primitive": "^1.0.0",
@@ -46,8 +46,9 @@
46
46
  "@types/react-dom": "*",
47
47
  "@types/react-virtualized": "^9.21.21",
48
48
  "@types/react-window": "^1.8.5",
49
+ "esbuild-plugin-react-virtualized": "1.0.4",
49
50
  "react-virtualized": "9.22.5",
50
- "esbuild-plugin-react-virtualized": "1.0.4"
51
+ "tailwindcss": "^3.4.14"
51
52
  },
52
53
  "peerDependencies": {
53
54
  "react": "*",
@@ -19,7 +19,7 @@ type ButtonVariant =
19
19
  | "floating"
20
20
  | "none";
21
21
 
22
- type ButtonSize = "normal" | "large";
22
+ type ButtonSize = "small" | "normal" | "large";
23
23
 
24
24
  /* ----------------------------------------------------------------------------
25
25
  * Element
@@ -135,8 +135,8 @@ export const ButtonElement = styled.button<{
135
135
  background: "white",
136
136
  color: theme.colors.text,
137
137
  boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
138
- fontSize: "12px",
139
- padding: "0px 4px",
138
+ fontSize: $size === "small" ? "10px" : "12px",
139
+ padding: $size === "small" ? "0px 2px" : "0px 4px",
140
140
  "&:hover": {
141
141
  opacity: 0.8,
142
142
  },
@@ -184,7 +184,9 @@ export interface ButtonRootProps {
184
184
  children: ReactNode;
185
185
  active?: boolean;
186
186
  disabled?: boolean;
187
+ /** @default normal */
187
188
  variant?: ButtonVariant;
189
+ /** @default normal */
188
190
  size?: ButtonSize;
189
191
  tooltip?: ReactNode;
190
192
  onClick?: (event: React.MouseEvent) => void;
@@ -64,39 +64,39 @@ const sizes: Record<
64
64
  };
65
65
 
66
66
  const Grid = styled.div<{
67
- size: GridViewSize;
68
- padding: CSSProperties["padding"];
69
- }>(({ theme, size, padding }) => {
67
+ $size: GridViewSize;
68
+ $padding: CSSProperties["padding"];
69
+ }>(({ theme, $size, $padding }) => {
70
70
  return {
71
71
  color: theme.colors.text,
72
72
  display: "grid",
73
- gridTemplateColumns: `repeat(auto-fill, minmax(${sizes[size].itemWidth}px, 1fr))`,
73
+ gridTemplateColumns: `repeat(auto-fill, minmax(${sizes[$size].itemWidth}px, 1fr))`,
74
74
  // gridAutoRows: `${sizes[size].itemHeight}px`,
75
- gap: `${sizes[size].gap}px`,
75
+ gap: `${sizes[$size].gap}px`,
76
76
  // gridTemplateColumns: `repeat(auto-fill, minmax(
77
77
  // ${size === 'large' ? '280px' : size === 'small' ? '160px' : '116px'}
78
78
  // , 1fr))`,
79
79
  // gridAutoRows:
80
80
  // size === 'large' ? '280px' : size === 'small' ? '170px' : '116px',
81
81
  // gap: size === 'large' || size === 'small' ? `20px` : `12px`,
82
- padding,
82
+ padding: $padding,
83
83
  };
84
84
  });
85
85
 
86
- const Container = styled.div<{ scrollable: boolean }>(
87
- ({ theme, scrollable }) => ({
88
- flex: scrollable ? "1" : "0 0 auto",
86
+ const Container = styled.div<{ $scrollable: boolean }>(
87
+ ({ theme, $scrollable }) => ({
88
+ flex: $scrollable ? "1" : "0 0 auto",
89
89
  display: "flex",
90
90
  flexDirection: "column",
91
91
  })
92
92
  );
93
93
 
94
94
  const ContentContainer = styled.div<{
95
- selected?: boolean;
96
- hovered?: boolean;
97
- bordered: boolean;
98
- disabled: boolean;
99
- }>(({ theme, selected, hovered, bordered, disabled }) => ({
95
+ $selected?: boolean;
96
+ $hovered?: boolean;
97
+ $bordered: boolean;
98
+ $disabled: boolean;
99
+ }>(({ theme, $selected, $hovered, $bordered, $disabled }) => ({
100
100
  display: "flex",
101
101
  flex: "1",
102
102
  backgroundColor: theme.colors.sidebar.background,
@@ -104,18 +104,18 @@ const ContentContainer = styled.div<{
104
104
  justifyContent: "center",
105
105
  borderRadius: "2px",
106
106
  border: `1px solid ${
107
- selected
107
+ $selected
108
108
  ? theme.colors.primary
109
109
  : // : hovered
110
110
  // ? `rgb(132, 63, 255, 0.5)`
111
- bordered
111
+ $bordered
112
112
  ? theme.colors.divider
113
113
  : "transparent"
114
114
  }`,
115
115
  overflow: "hidden",
116
116
 
117
117
  cursor: "pointer",
118
- ...(disabled
118
+ ...($disabled
119
119
  ? { opacity: 0.5 }
120
120
  : {
121
121
  "&:hover": { opacity: 0.85 },
@@ -134,8 +134,8 @@ const ItemContainer = styled.div(({ theme }) => ({
134
134
  },
135
135
  }));
136
136
 
137
- const ItemTitle = styled.span<{ showBackground: boolean }>(
138
- ({ theme, showBackground }) => ({
137
+ const ItemTitle = styled.span<{ $showBackground: boolean }>(
138
+ ({ theme, $showBackground }) => ({
139
139
  ...theme.textStyles.small,
140
140
  lineHeight: "1",
141
141
  color: theme.colors.text,
@@ -145,7 +145,7 @@ const ItemTitle = styled.span<{ showBackground: boolean }>(
145
145
  overflow: "hidden",
146
146
  textOverflow: "ellipsis",
147
147
 
148
- ...(showBackground && {
148
+ ...($showBackground && {
149
149
  background: theme.colors.sidebar.background,
150
150
  // border: `1px solid ${theme.colors.dividerSubtle}`,
151
151
  padding: "2px 4px",
@@ -155,8 +155,8 @@ const ItemTitle = styled.span<{ showBackground: boolean }>(
155
155
  })
156
156
  );
157
157
 
158
- const ItemDescription = styled.span<{ showBackground: boolean }>(
159
- ({ theme, showBackground }) => ({
158
+ const ItemDescription = styled.span<{ $showBackground: boolean }>(
159
+ ({ theme, $showBackground }) => ({
160
160
  ...theme.textStyles.small,
161
161
  fontSize: "0.7rem",
162
162
  lineHeight: "1",
@@ -166,7 +166,7 @@ const ItemDescription = styled.span<{ showBackground: boolean }>(
166
166
  overflow: "hidden",
167
167
  textOverflow: "ellipsis",
168
168
 
169
- ...(showBackground && {
169
+ ...($showBackground && {
170
170
  background: theme.colors.sidebar.background,
171
171
  // border: `1px solid ${theme.colors.dividerSubtle}`,
172
172
  padding: "2px 4px",
@@ -319,10 +319,10 @@ const GridViewItem = forwardRef(function GridViewItem<
319
319
  onKeyDown={handleKeyDown}
320
320
  >
321
321
  <ContentContainer
322
- disabled={disabled}
323
- bordered={bordered}
324
- selected={selected}
325
- hovered={!disabled && hovered}
322
+ $disabled={disabled}
323
+ $bordered={bordered}
324
+ $selected={selected}
325
+ $hovered={!disabled && hovered}
326
326
  onClick={handleClick}
327
327
  onDoubleClick={onDoubleClick}
328
328
  onContextMenu={onContextMenu}
@@ -333,17 +333,17 @@ const GridViewItem = forwardRef(function GridViewItem<
333
333
  {textPosition === "below" && (
334
334
  <>
335
335
  <Spacer.Vertical size={8} />
336
- <ItemTitle showBackground={false}>{title || " "}</ItemTitle>
337
- <ItemDescription showBackground={false}>
336
+ <ItemTitle $showBackground={false}>{title || " "}</ItemTitle>
337
+ <ItemDescription $showBackground={false}>
338
338
  {subtitle || " "}
339
339
  </ItemDescription>
340
340
  </>
341
341
  )}
342
342
  {textPosition === "overlay" && hovered && (title || subtitle) && (
343
343
  <TextOverlay>
344
- {title && <ItemTitle showBackground>{title}</ItemTitle>}
344
+ {title && <ItemTitle $showBackground>{title}</ItemTitle>}
345
345
  {subtitle && (
346
- <ItemDescription showBackground>{subtitle}</ItemDescription>
346
+ <ItemDescription $showBackground>{subtitle}</ItemDescription>
347
347
  )}
348
348
  </TextOverlay>
349
349
  )}
@@ -368,8 +368,10 @@ const GridViewItem = forwardRef(function GridViewItem<
368
368
  <Tooltip
369
369
  content={
370
370
  <Stack.V gap={2}>
371
- <ItemTitle showBackground={false}>{title}</ItemTitle>
372
- <ItemDescription showBackground={false}>{subtitle}</ItemDescription>
371
+ <ItemTitle $showBackground={false}>{title}</ItemTitle>
372
+ <ItemDescription $showBackground={false}>
373
+ {subtitle}
374
+ </ItemDescription>
373
375
  </Stack.V>
374
376
  }
375
377
  >
@@ -432,7 +434,7 @@ function GridViewRoot({
432
434
 
433
435
  return (
434
436
  <GridViewContext.Provider value={contextValue}>
435
- <Container onClick={handleClick} scrollable={scrollable}>
437
+ <Container onClick={handleClick} $scrollable={scrollable}>
436
438
  {scrollable ? <ScrollArea>{children}</ScrollArea> : children}
437
439
  </Container>
438
440
  </GridViewContext.Provider>
@@ -449,7 +451,7 @@ function GridViewSection({
449
451
  const { size } = useContext(GridViewContext);
450
452
 
451
453
  return (
452
- <Grid size={size} padding={padding}>
454
+ <Grid $size={size} $padding={padding}>
453
455
  {children}
454
456
  </Grid>
455
457
  );
@@ -32,21 +32,23 @@ export type InputFieldSize = "small" | "medium" | "large";
32
32
 
33
33
  type InputFieldContextValue = {
34
34
  labelPosition: LabelPosition;
35
- labelSize: number;
36
- hasLabel: boolean;
35
+ labelSize?: number;
36
+ buttonSize?: number;
37
37
  hasDropdown: boolean;
38
+ /** @default medium */
38
39
  size: InputFieldSize;
39
40
  isFocused: boolean;
40
41
  onFocusChange: (isFocused: boolean) => void;
41
42
  inputRef?: ForwardedRef<HTMLInputElement>;
42
43
  setInputRef?: (ref: ForwardedRef<HTMLInputElement>) => void;
43
44
  setLabelWidth?: (width: number) => void;
45
+ setButtonWidth?: (width: number) => void;
44
46
  };
45
47
 
46
48
  const InputFieldContext = createContext<InputFieldContextValue>({
47
49
  labelPosition: "end",
48
- labelSize: 6,
49
- hasLabel: false,
50
+ labelSize: undefined,
51
+ buttonSize: undefined,
50
52
  hasDropdown: false,
51
53
  size: "medium",
52
54
  isFocused: false,
@@ -61,26 +63,31 @@ const LabelContainer = styled.label<{
61
63
  pointerEvents: Property.PointerEvents;
62
64
  $labelPosition: LabelPosition;
63
65
  $hasDropdown: boolean;
64
- }>(({ theme, $labelPosition, $hasDropdown, pointerEvents }) => ({
65
- ...theme.textStyles.label,
66
- fontWeight: "bold",
67
- color: theme.colors.textDisabled,
68
- position: "absolute",
69
- top: 0,
70
- right: $labelPosition === "end" ? 0 : undefined,
71
- bottom: 0,
72
- left: $labelPosition === "start" ? 0 : undefined,
73
- display: "flex",
74
- alignItems: "center",
75
- pointerEvents,
76
- userSelect: "none",
77
- ...($labelPosition === "start"
78
- ? { justifyContent: "flex-start", paddingLeft: "6px" }
79
- : {
80
- justifyContent: "flex-end",
81
- paddingRight: $hasDropdown ? "16px" : "6px",
82
- }),
83
- }));
66
+ $size: InputFieldSize;
67
+ }>(({ theme, $labelPosition, $hasDropdown, pointerEvents, $size }) => {
68
+ const offsetRelativeToSize =
69
+ $size === "large" ? 6 : $size === "medium" ? 2 : 0;
70
+ return {
71
+ ...theme.textStyles.label,
72
+ fontWeight: "bold",
73
+ color: theme.colors.textDisabled,
74
+ position: "absolute",
75
+ top: 0,
76
+ bottom: 0,
77
+ right: $labelPosition === "end" ? offsetRelativeToSize : undefined,
78
+ left: $labelPosition === "start" ? offsetRelativeToSize : undefined,
79
+ display: "flex",
80
+ alignItems: "center",
81
+ pointerEvents,
82
+ userSelect: "none",
83
+ ...($labelPosition === "start"
84
+ ? { justifyContent: "flex-start", paddingLeft: "6px" }
85
+ : {
86
+ justifyContent: "flex-end",
87
+ paddingRight: $hasDropdown ? "16px" : "6px",
88
+ }),
89
+ };
90
+ });
84
91
 
85
92
  interface InputFieldLabelProps {
86
93
  children?: ReactNode;
@@ -88,12 +95,13 @@ interface InputFieldLabelProps {
88
95
  style?: React.CSSProperties;
89
96
  }
90
97
 
98
+ /** Inserts a Label at the start or end of the input given a `labelPosition`on InputField.Root. Should not be used with an InputField.Button */
91
99
  const InputFieldLabel = memo(
92
100
  forwardRef(function InputFieldLabel(
93
101
  { children = false, pointerEvents = "none", style }: InputFieldLabelProps,
94
102
  forwardedRef: ForwardedRef<HTMLLabelElement>
95
103
  ) {
96
- const { labelPosition, hasDropdown, setLabelWidth } =
104
+ const { labelPosition, hasDropdown, setLabelWidth, size } =
97
105
  useContext(InputFieldContext);
98
106
 
99
107
  const ref = useRef<HTMLLabelElement | null>(null);
@@ -110,6 +118,7 @@ const InputFieldLabel = memo(
110
118
 
111
119
  return (
112
120
  <LabelContainer
121
+ $size={size}
113
122
  ref={(element) => {
114
123
  ref.current = element;
115
124
  assignRef(forwardedRef, element);
@@ -179,51 +188,74 @@ const ButtonContainer = styled.span<{ $size: InputFieldSize }>(
179
188
  ({ theme, $size }) => ({
180
189
  position: "absolute",
181
190
  right: $size === "large" ? "9px" : $size === "medium" ? "4px" : "2px",
182
- top: $size === "large" ? "8px" : $size === "medium" ? "4px" : "2px",
191
+ top: $size === "large" ? "10px" : $size === "medium" ? "4px" : "2px",
183
192
  })
184
193
  );
185
194
 
186
- const InputFieldButton = memo(function InputFieldButton({
187
- children,
188
- onClick,
189
- }: {
190
- children?: ReactNode;
191
- onClick?: () => void;
192
- }) {
193
- const { size, inputRef } = useContext(InputFieldContext);
194
-
195
- const defaultHandleClick = useCallback(
196
- (event: React.MouseEvent) => {
197
- if (inputRef && typeof inputRef !== "function") {
198
- inputRef.current?.focus();
199
- // Select all text
200
- inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
201
- }
195
+ /** Inserts a Button at the end of the input. Should not be used with an InputField.Label */
196
+ const InputFieldButton = memo(
197
+ forwardRef(function InputFieldButton(
198
+ {
199
+ children,
200
+ onClick,
201
+ }: {
202
+ children?: ReactNode;
203
+ onClick?: () => void;
204
+ },
205
+ forwardedRef: ForwardedRef<HTMLButtonElement>
206
+ ) {
207
+ const { size, inputRef, setButtonWidth } = useContext(InputFieldContext);
208
+
209
+ const ref = useRef<HTMLButtonElement | null>(null);
210
+
211
+ useLayoutEffect(() => {
212
+ if (!setButtonWidth) return;
213
+
214
+ const width = ref.current?.getBoundingClientRect().width;
215
+
216
+ if (!width) return;
202
217
 
218
+ setButtonWidth(width);
219
+ }, [setButtonWidth]);
220
+
221
+ const defaultHandleClick = useCallback(
222
+ (event: React.MouseEvent) => {
223
+ if (inputRef && typeof inputRef !== "function") {
224
+ inputRef.current?.focus();
225
+ // Select all text
226
+ inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
227
+ }
228
+
229
+ event.preventDefault();
230
+ event.stopPropagation();
231
+ },
232
+ [inputRef]
233
+ );
234
+
235
+ const handlePointerDown = useCallback((event: React.PointerEvent) => {
203
236
  event.preventDefault();
204
237
  event.stopPropagation();
205
- },
206
- [inputRef]
207
- );
208
-
209
- const handlePointerDown = useCallback((event: React.PointerEvent) => {
210
- event.preventDefault();
211
- event.stopPropagation();
212
- }, []);
238
+ }, []);
213
239
 
214
- return (
215
- <ButtonContainer $size={size}>
216
- <Button
217
- variant="floating"
218
- onClick={onClick ?? defaultHandleClick}
219
- onPointerDown={handlePointerDown}
220
- tabIndex={-1}
221
- >
222
- {children}
223
- </Button>
224
- </ButtonContainer>
225
- );
226
- });
240
+ return (
241
+ <ButtonContainer $size={size}>
242
+ <Button
243
+ ref={(element) => {
244
+ ref.current = element;
245
+ assignRef(forwardedRef, element);
246
+ }}
247
+ variant="floating"
248
+ onClick={onClick ?? defaultHandleClick}
249
+ onPointerDown={handlePointerDown}
250
+ tabIndex={-1}
251
+ size={size === "medium" ? "normal" : size}
252
+ >
253
+ {children}
254
+ </Button>
255
+ </ButtonContainer>
256
+ );
257
+ })
258
+ );
227
259
 
228
260
  /* ----------------------------------------------------------------------------
229
261
  * Input
@@ -242,8 +274,7 @@ export const InputElement = styled(TextInput)<{
242
274
  disabled?: boolean;
243
275
  readOnly?: boolean;
244
276
  $labelPosition: LabelPosition;
245
- $labelSize: number;
246
- $hasLabel: boolean;
277
+ $labelSize?: number;
247
278
  $hasDropdown: boolean;
248
279
  $textAlign?: Property.TextAlign;
249
280
  $variant?: InputFieldVariant;
@@ -255,7 +286,6 @@ export const InputElement = styled(TextInput)<{
255
286
  $hasDropdown,
256
287
  $textAlign,
257
288
  disabled,
258
- $hasLabel,
259
289
  readOnly,
260
290
  $variant = "normal",
261
291
  $size,
@@ -288,11 +318,11 @@ export const InputElement = styled(TextInput)<{
288
318
  $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
289
319
  paddingLeft:
290
320
  ($size === "large" ? 10 : $size === "medium" ? 6 : 4) +
291
- ($hasLabel && $labelPosition === "start" ? 6 + $labelSize : 0) +
321
+ ($labelSize && $labelPosition === "start" ? 6 + $labelSize : 0) +
292
322
  "px",
293
323
  paddingRight:
294
324
  ($size === "large" ? 10 : $size === "medium" ? 6 : 4) +
295
- ($hasLabel && $labelPosition === "end" ? 6 + $labelSize : 0) +
325
+ ($labelSize && $labelPosition === "end" ? 6 + $labelSize : 0) +
296
326
  ($hasDropdown ? 11 : 0) +
297
327
  "px",
298
328
  background: theme.colors.inputBackground,
@@ -321,6 +351,7 @@ export const InputElement = styled(TextInput)<{
321
351
  };
322
352
  });
323
353
 
354
+ /** Should always be wrapped in InputField.Root */
324
355
  const InputFieldInput = forwardRef(function InputFieldInput(
325
356
  // onFocusChange should only be passed from the root, never directly
326
357
  {
@@ -337,7 +368,7 @@ const InputFieldInput = forwardRef(function InputFieldInput(
337
368
  labelPosition,
338
369
  labelSize,
339
370
  hasDropdown,
340
- hasLabel,
371
+ buttonSize,
341
372
  size,
342
373
  onFocusChange,
343
374
  setInputRef,
@@ -358,8 +389,7 @@ const InputFieldInput = forwardRef(function InputFieldInput(
358
389
  <InputElement
359
390
  ref={forwardedRef}
360
391
  $labelPosition={labelPosition}
361
- $labelSize={labelSize}
362
- $hasLabel={hasLabel}
392
+ $labelSize={labelSize || buttonSize}
363
393
  $hasDropdown={hasDropdown}
364
394
  $size={size}
365
395
  $variant={variant}
@@ -375,7 +405,6 @@ const InputFieldTypeahead = (props: { prefix: string; value: string }) => {
375
405
  labelPosition,
376
406
  labelSize,
377
407
  hasDropdown,
378
- hasLabel,
379
408
  size,
380
409
  // onFocusChange,
381
410
  } = useContext(InputFieldContext);
@@ -385,7 +414,6 @@ const InputFieldTypeahead = (props: { prefix: string; value: string }) => {
385
414
  as="span"
386
415
  $labelPosition={labelPosition}
387
416
  $labelSize={labelSize}
388
- $hasLabel={hasLabel}
389
417
  $hasDropdown={hasDropdown}
390
418
  $size={size}
391
419
  // onFocusChange={onFocusChange}
@@ -528,24 +556,27 @@ function InputFieldNumberInput(props: InputFieldNumberInputProps) {
528
556
  * Root
529
557
  * ------------------------------------------------------------------------- */
530
558
 
531
- const RootContainer = styled.div<{ $width?: number; $flex?: string }>(
532
- ({ theme, $flex, $width }) => ({
533
- flex: $flex ?? "1",
534
- display: "flex",
535
- flexDirection: "row",
536
- position: "relative",
537
- maxWidth: typeof $width === "number" ? `${$width}px` : undefined,
538
- })
539
- );
559
+ const RootContainer = styled.div<{
560
+ $width?: number;
561
+ $flex?: string;
562
+ }>(({ theme, $flex, $width }) => ({
563
+ flex: $flex ?? "1",
564
+ display: "flex",
565
+ flexDirection: "row",
566
+ position: "relative",
567
+ maxWidth: typeof $width === "number" ? `${$width}px` : undefined,
568
+ }));
540
569
 
541
570
  interface InputFieldRootProps {
542
571
  id?: string;
543
572
  flex?: string;
544
573
  children?: ReactNode;
545
574
  width?: number;
575
+ /** @default end */
546
576
  labelPosition?: LabelPosition;
547
577
  labelSize?: number;
548
578
  hasDropdown?: boolean;
579
+ /** @default medium */
549
580
  size?: InputFieldSize;
550
581
  renderPopoverContent?: (options: { width: number }) => ReactNode;
551
582
  onFocusChange?: (isFocused: boolean) => void;
@@ -571,13 +602,11 @@ function InputFieldRoot({
571
602
  const hasDropdown = childrenArray.some(
572
603
  (child) => isValidElement(child) && child.type === InputFieldDropdownMenu
573
604
  );
574
- const hasLabel = childrenArray.some(
575
- (child) => isValidElement(child) && child.type === InputFieldLabel
576
- );
577
605
 
578
606
  const [isFocused, setIsFocused] = React.useState(false);
579
607
 
580
608
  const [measuredLabelSize, setMeasuredLabelSize] = React.useState<number>();
609
+ const [measuredButtonSize, setMeasuredButtonSize] = React.useState<number>();
581
610
  const [measuredWidth, setMeasuredWidth] = React.useState<number>();
582
611
 
583
612
  const handleFocusChange = useCallback(
@@ -603,22 +632,23 @@ function InputFieldRoot({
603
632
  const contextValue = useMemo(
604
633
  (): InputFieldContextValue => ({
605
634
  labelPosition,
606
- labelSize: measuredLabelSize ?? labelSize ?? 6,
635
+ labelSize: measuredLabelSize ?? labelSize,
636
+ buttonSize: measuredButtonSize,
607
637
  hasDropdown,
608
- hasLabel,
609
638
  size,
610
639
  isFocused,
611
640
  onFocusChange: handleFocusChange,
612
641
  inputRef,
613
642
  setInputRef,
614
643
  setLabelWidth: setMeasuredLabelSize,
644
+ setButtonWidth: setMeasuredButtonSize,
615
645
  }),
616
646
  [
617
647
  labelPosition,
618
648
  measuredLabelSize,
619
649
  labelSize,
650
+ measuredButtonSize,
620
651
  hasDropdown,
621
- hasLabel,
622
652
  size,
623
653
  isFocused,
624
654
  handleFocusChange,
@@ -317,6 +317,7 @@ interface ListViewRowProps<MenuItemType extends string = string> {
317
317
  id?: string;
318
318
  tabIndex?: number;
319
319
  selected?: boolean;
320
+ /** @default 0 */
320
321
  depth?: number;
321
322
  disabled?: boolean;
322
323
  // draggable?: boolean;
@@ -108,6 +108,7 @@ const ToggleGroupItem = forwardRef(function ToggleGroupItem(
108
108
  });
109
109
 
110
110
  type RadioGroupContextValue = {
111
+ /** @default primary */
111
112
  colorScheme?: RadioGroupColorScheme;
112
113
  };
113
114
 
@@ -119,6 +120,7 @@ interface Props {
119
120
  id?: string;
120
121
  value?: string;
121
122
  onValueChange?: (value: string) => void;
123
+ /** @default primary */
122
124
  colorScheme?: RadioGroupColorScheme;
123
125
  allowEmpty?: boolean;
124
126
  children: ReactNode;