Skip to content

Commit 26a31b2

Browse files
committed
refactor: update the way components and hooks are exported
1 parent 984088c commit 26a31b2

6 files changed

Lines changed: 140 additions & 26 deletions

File tree

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nafr/echo-ui",
3-
"version": "0.0.0",
3+
"version": "0.0.2",
44
"description": "A UI library born for WAA",
55
"keywords": [
66
"echo-ui",
@@ -44,6 +44,7 @@
4444
"@types/react-dom": "^18.2.15",
4545
"@typescript-eslint/eslint-plugin": "^6.10.0",
4646
"@typescript-eslint/parser": "^6.10.0",
47+
"@vercel/analytics": "^1.1.2",
4748
"@vitejs/plugin-react": "^4.2.0",
4849
"autoprefixer": "^10.4.16",
4950
"clsx": "^2.0.0",
@@ -73,8 +74,5 @@
7374
"peerDependencies": {
7475
"react": "^18.2.0",
7576
"react-dom": "^18.2.0"
76-
},
77-
"dependencies": {
78-
"@vercel/analytics": "^1.1.2"
7977
}
8078
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export * from './Card'
1+
export { Card } from './Card'
2+
export type { CardProps, CardRef, CardHeaderProps, CardHeaderRef, CardBodyRef } from './Card'
Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
export * from './Button'
2-
export * from './Checkbox'
3-
export * from './Envelope'
4-
export * from './Input'
5-
export * from './Knob'
6-
export * from './Radio'
7-
export * from './Slider'
8-
export * from './Switch'
1+
export { Button } from './Button'
2+
export type { ButtonProps, ButtonRef, ButtonGroupProps, ButtonGroupRef } from './Button'
3+
4+
export { Checkbox } from './Checkbox'
5+
export type { CheckboxProps, CheckboxChangeEvent, CheckboxRef, CheckboxGroupRef } from './Checkbox'
6+
7+
export { Envelope } from './Envelope'
8+
export type { EnvelopeProps, EnvelopeRef, EnvelopeData, EnvelopeLimits } from './Envelope'
9+
10+
export { Input } from './Input'
11+
export type { InputProps, InputChangeEvent } from './Input'
12+
13+
export { Knob } from './Knob'
14+
export type { KnobProps, KnobRef, KnobGroupProps, KnobGroupRef } from './Knob'
15+
16+
export { Radio } from './Radio'
17+
export type { RadioProps, RadioChangeEvent, RadioRef, RadioGroupRef } from './Radio'
18+
19+
export { Slider } from './Slider'
20+
export type { SliderProps, SliderRef } from './Slider'
21+
22+
export { Switch } from './Switch'
23+
export type { SwitchProps, SwitchRef } from './Switch'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './Icons'
1+
export { SineIcon, SquareIcon, SawtoothIcon, TriangleIcon } from './Icons'
Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
export * from './VuMeter'
2-
export * from './Axis'
3-
export * from './Light'
4-
export * from './LFO'
5-
export * from './Spectrogram'
6-
export * from './Oscilloscope'
7-
export * from './Waveform'
1+
export { VuMeter } from './VuMeter'
2+
export type { VuMeterProps, VuMeterRef } from './VuMeter'
3+
4+
export { Axis } from './Axis'
5+
export type { AxisProps } from './Axis'
6+
7+
export { Light } from './Light'
8+
export type { LightProps, LightRef } from './Light'
9+
10+
export { LFO } from './LFO'
11+
export type { LFOProps, LFORef } from './LFO'
12+
13+
export { Spectrogram } from './Spectrogram'
14+
export type { SpectrogramProps, SpectrogramRef, SpectrogramDataPoint } from './Spectrogram'
15+
16+
export { Oscilloscope } from './Oscilloscope'
17+
export type { OscilloscopeProps, OscilloscopeRef, OscilloscopeDataPoint } from './Oscilloscope'
18+
19+
export { Waveform } from './Waveform'
20+
export type { WaveformMouseEvent, WaveformProps, WaveformRef } from './Waveform'

packages/main.ts

Lines changed: 92 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,95 @@
1-
export * from './components/controller'
2-
export * from './components/visualization'
3-
export * from './components/utility'
4-
export * from './components/container'
5-
export * from './hooks'
1+
export {
2+
Button,
3+
Checkbox,
4+
Envelope,
5+
Input,
6+
Knob,
7+
Radio,
8+
Slider,
9+
Switch,
10+
} from './components/controller'
11+
export type {
12+
ButtonProps,
13+
ButtonRef,
14+
ButtonGroupProps,
15+
ButtonGroupRef,
16+
CheckboxProps,
17+
CheckboxChangeEvent,
18+
CheckboxRef,
19+
CheckboxGroupRef,
20+
EnvelopeProps,
21+
EnvelopeRef,
22+
EnvelopeData,
23+
EnvelopeLimits,
24+
InputProps,
25+
InputChangeEvent,
26+
KnobProps,
27+
KnobRef,
28+
KnobGroupProps,
29+
KnobGroupRef,
30+
RadioProps,
31+
RadioChangeEvent,
32+
RadioRef,
33+
RadioGroupRef,
34+
SliderProps,
35+
SliderRef,
36+
SwitchProps,
37+
SwitchRef,
38+
} from './components/controller'
39+
40+
export {
41+
VuMeter,
42+
Light,
43+
LFO,
44+
Spectrogram,
45+
Oscilloscope,
46+
Waveform,
47+
} from './components/visualization'
48+
export type {
49+
VuMeterProps,
50+
VuMeterRef,
51+
LightProps,
52+
LightRef,
53+
LFOProps,
54+
LFORef,
55+
SpectrogramProps,
56+
SpectrogramRef,
57+
SpectrogramDataPoint,
58+
OscilloscopeProps,
59+
OscilloscopeRef,
60+
OscilloscopeDataPoint,
61+
WaveformMouseEvent,
62+
WaveformProps,
63+
WaveformRef,
64+
} from './components/visualization'
65+
66+
export { SineIcon, SquareIcon, SawtoothIcon, TriangleIcon } from './components/utility'
67+
68+
export { Card } from './components/container'
69+
export type {
70+
CardProps,
71+
CardRef,
72+
CardHeaderProps,
73+
CardHeaderRef,
74+
CardBodyRef,
75+
} from './components/container'
76+
77+
export {
78+
useFetchAudio,
79+
useOscilloscope,
80+
usePlayer,
81+
useSpectrogram,
82+
useVuMeter,
83+
useWaveform,
84+
} from './hooks'
85+
export type {
86+
UseFetchAudioProps,
87+
UseOscilloscopeProps,
88+
UsePlayerProps,
89+
UseSpectrogramProps,
90+
UseVuMeterProps,
91+
UseWaveformProps,
92+
} from './hooks'
693

794
import './index.css'
895

0 commit comments

Comments
 (0)