Skip to content

Commit ffbf733

Browse files
committed
ref(stories): fix import errors
1 parent a9dc059 commit ffbf733

File tree

7 files changed

+121
-138
lines changed

7 files changed

+121
-138
lines changed

static/app/components/core/button/buttonBar.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ resources:
1313

1414
import {Fragment, useState} from 'react';
1515

16-
import {Button} from 'sentry/components/core/button';
17-
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
16+
import {Button} from '@sentry/scraps/button';
17+
import {ButtonBar} from '@sentry/scraps/button/buttonBar';
18+
1819
import * as Storybook from 'sentry/stories';
1920

20-
import documentation from '!!type-loader!@sentry/scraps/buttonBar';
21+
import documentation from '!!type-loader!@sentry/scraps/button/buttonBar';
2122

2223
export {documentation};
2324

static/app/components/core/compactSelect/composite.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ resources:
1313

1414
import {useState} from 'react';
1515

16-
import {CompositeSelect} from 'sentry/components/core/compactSelect/composite';
17-
import {SelectTrigger} from 'sentry/components/core/compactSelect/trigger';
16+
import {CompositeSelect} from '@sentry/scraps/compactSelect/composite';
17+
import {SelectTrigger} from '@sentry/scraps/compactSelect/trigger';
18+
1819
import {IconSentry} from 'sentry/icons';
1920
import * as Storybook from 'sentry/stories';
2021

21-
import documentation from '!!type-loader!@sentry/scraps/composite';
22+
import documentation from '!!type-loader!@sentry/scraps/compactSelect/composite';
2223

2324
export {documentation};
2425

static/app/components/core/input/inputGroup.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: InputGroup
33
description: A compound component for creating inputs with leading or trailing elements like icons, buttons, or badges.
4-
source: 'sentry/components/core/input/inputGroup'
4+
source: '@sentry/scraps/input'
55
resources:
66
figma: https://www.figma.com/design/eTJz6aPgudMY9E6mzyZU0B/ChonkUI--App-Components--WIP-?node-id=384-2119&t=DdXZ7WIgTdURJlRv-4
77
js: https://github.com/getsentry/sentry/blob/master/static/app/components/core/input/inputGroup.tsx
@@ -14,13 +14,15 @@ resources:
1414

1515
import styled from '@emotion/styled';
1616

17-
import {Button} from 'sentry/components/core/button';
18-
import {InputGroup} from 'sentry/components/core/input/inputGroup';
17+
import {Button} from '@sentry/scraps/button';
18+
import {InputGroup} from '@sentry/scraps/input/inputGroup';
19+
import {Grid} from '@sentry/scraps/layout';
20+
1921
import {IconAttachment, IconSearch, IconSettings} from 'sentry/icons';
2022
import * as Storybook from 'sentry/stories';
2123
import {space} from 'sentry/styles/space';
2224

23-
import documentation from '!!type-loader!@sentry/scraps/inputGroup';
25+
import documentation from '!!type-loader!@sentry/scraps/input/inputGroup';
2426

2527
export {documentation};
2628

@@ -55,7 +57,7 @@ Use `<InputGroup>` when you need to add visual context or actions directly adjac
5557

5658
export function SizesDemo() {
5759
return (
58-
<Grid>
60+
<Grid columns="repeat(3, minmax(0, 1fr))" gap="md">
5961
<div>
6062
<code>md (default)</code>
6163
<InputGroup>
@@ -117,7 +119,7 @@ export function SizesDemo() {
117119
Use `<InputGroup.LeadingItems>` to add elements to the left side (start) of the input. Common use cases include search icons, currency symbols, or prefixes.
118120

119121
<Storybook.Demo>
120-
<Grid>
122+
<Grid columns="repeat(3, minmax(0, 1fr))" gap="md">
121123
<InputGroup>
122124
<InputGroup.LeadingItems disablePointerEvents>
123125
<IconSearch />
@@ -141,7 +143,7 @@ Use `<InputGroup.LeadingItems>` to add elements to the left side (start) of the
141143
Use `<InputGroup.TrailingItems>` to add elements to the right side (end) of the input. Common use cases include clear buttons, loading indicators, or unit labels.
142144

143145
<Storybook.Demo>
144-
<Grid>
146+
<Grid columns="repeat(3, minmax(0, 1fr))" gap="md">
145147
<InputGroup>
146148
<InputGroup.Input placeholder="Search" />
147149
<InputGroup.TrailingItems disablePointerEvents>
@@ -194,7 +196,7 @@ When trailing items contain interactive elements (like buttons), don't use `disa
194196

195197
export function InteractiveDemo() {
196198
return (
197-
<Grid>
199+
<Grid columns="repeat(3, minmax(0, 1fr))" gap="md">
198200
<InputGroup>
199201
<InputGroup.Input placeholder="Search" />
200202
<InputGroup.TrailingItems>
@@ -418,7 +420,3 @@ Show a loading indicator when fetching results:
418420
- Ensure the input receives focus when the label is clicked
419421

420422
For more information, see the [WAI-ARIA Text Input practices](https://www.w3.org/WAI/ARIA/apg/patterns/textbox/).
421-
422-
const Grid = styled('div')` display: grid;
423-
grid-template-columns: repeat(3, 1fr);
424-
gap: ${space(2)};`;

static/app/components/core/input/numberDragInput.mdx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ resources:
1414
import {useState} from 'react';
1515
import styled from '@emotion/styled';
1616

17-
import {NumberDragInput} from 'sentry/components/core/input/numberDragInput';
17+
import {NumberDragInput} from '@sentry/scraps/input/numberDragInput';
18+
import {Stack} from '@sentry/scraps/layout';
19+
1820
import * as Storybook from 'sentry/stories';
1921
import {space} from 'sentry/styles/space';
2022

21-
import documentation from '!!type-loader!@sentry/scraps/numberDragInput';
23+
import documentation from '!!type-loader!@sentry/scraps/input/numberDragInput';
2224

2325
export {documentation};
2426

@@ -42,7 +44,7 @@ Click and hold the arrow indicators on the right side of the input, then move th
4244
export function HorizontalDemo() {
4345
const [value, setValue] = useState(50);
4446
return (
45-
<Label>
47+
<Stack gap="md">
4648
Value: {value}
4749
<NumberDragInput
4850
axis="x"
@@ -52,7 +54,7 @@ export function HorizontalDemo() {
5254
max={100}
5355
placeholder="None"
5456
/>
55-
</Label>
57+
</Stack>
5658
);
5759
}
5860

@@ -84,7 +86,7 @@ export function AxesDemo() {
8486
const [verticalValue, setVerticalValue] = useState(10);
8587
return (
8688
<Storybook.SideBySide>
87-
<Label>
89+
<Stack gap="md">
8890
Horizontal (axis="x")
8991
<NumberDragInput
9092
axis="x"
@@ -94,8 +96,8 @@ export function AxesDemo() {
9496
value={horizontalValue}
9597
placeholder="None"
9698
/>
97-
</Label>
98-
<Label>
99+
</Stack>
100+
<Stack gap="md">
99101
Vertical (axis="y")
100102
<NumberDragInput
101103
axis="y"
@@ -105,7 +107,7 @@ export function AxesDemo() {
105107
value={verticalValue}
106108
placeholder="None"
107109
/>
108-
</Label>
110+
</Stack>
109111
</Storybook.SideBySide>
110112
);
111113
}
@@ -129,7 +131,7 @@ The `step` prop controls how much the value changes per drag increment. The defa
129131
export function StepDemo() {
130132
const [value, setValue] = useState(0);
131133
return (
132-
<Label>
134+
<Stack gap="md">
133135
Value: {value} (step=5)
134136
<NumberDragInput
135137
value={value}
@@ -138,7 +140,7 @@ export function StepDemo() {
138140
min={0}
139141
max={100}
140142
/>
141-
</Label>
143+
</Stack>
142144
);
143145
}
144146

@@ -157,7 +159,7 @@ Hold **Shift** while dragging to increase the step size by a multiplier (default
157159
export function ShiftKeyDemo() {
158160
const [value, setValue] = useState(50);
159161
return (
160-
<Label>
162+
<Stack gap="md">
161163
Value: {value}
162164
<br />
163165
<small>Hold Shift while dragging for 10× speed</small>
@@ -168,7 +170,7 @@ export function ShiftKeyDemo() {
168170
max={100}
169171
shiftKeyMultiplier={10}
170172
/>
171-
</Label>
173+
</Stack>
172174
);
173175
}
174176

@@ -196,15 +198,15 @@ Use the `min` and `max` props to constrain the allowed numeric range. Values are
196198
export function MinMaxDemo() {
197199
const [value, setValue] = useState(5);
198200
return (
199-
<Label>
201+
<Stack gap="md">
200202
Value: {value} (constrained between 0 and 10)
201203
<NumberDragInput
202204
value={value}
203205
onChange={e => setValue(Number(e.target.value))}
204206
min={0}
205207
max={10}
206208
/>
207-
</Label>
209+
</Stack>
208210
);
209211
}
210212

@@ -233,19 +235,19 @@ Like standard inputs, `<NumberDragInput>` can be controlled or uncontrolled. Use
233235
export function UncontrolledDemo() {
234236
return (
235237
<Storybook.SideBySide>
236-
<Label>
238+
<Stack gap="md">
237239
Controlled
238240
<NumberDragInput
239241
value={25}
240242
onChange={e => console.log(e.target.value)}
241243
min={0}
242244
max={100}
243245
/>
244-
</Label>
245-
<Label>
246+
</Stack>
247+
<Stack gap="md">
246248
Uncontrolled
247249
<NumberDragInput defaultValue={25} min={0} max={100} />
248-
</Label>
250+
</Stack>
249251
</Storybook.SideBySide>
250252
);
251253
}
@@ -271,10 +273,10 @@ const [value, setValue] = useState(25);
271273
Use the `placeholder` prop to provide hint text when the input is empty.
272274

273275
<Storybook.Demo>
274-
<Label>
276+
<Stack gap="md">
275277
With placeholder
276278
<NumberDragInput placeholder="Enter a value" min={0} max={100} />
277-
</Label>
279+
</Stack>
278280
</Storybook.Demo>
279281

280282
```jsx
@@ -411,9 +413,3 @@ The component includes:
411413

412414
> [!WARNING]
413415
> The drag interaction relies on pointer lock, which may not work in all browsers or contexts. Always test keyboard functionality as the primary accessibility method.
414-
415-
const Label = styled('label')` display: flex;
416-
flex-direction: column;
417-
gap: ${space(1)};
418-
font-size: ${p => p.theme.fontSizeSmall};
419-
color: ${p => p.theme.subText};`;

0 commit comments

Comments
 (0)