@moises.ai/design-system 3.8.0 → 3.9.0

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": "@moises.ai/design-system",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -0,0 +1,88 @@
1
+ import { Flex } from '@radix-ui/themes'
2
+ import { Button } from '../Button/Button'
3
+ import styles from './EmptyState.module.css'
4
+ import classNames from 'classnames'
5
+ import { Text } from '../Text/Text'
6
+
7
+ // Emphasis: Low High
8
+ // Size: Medium Large
9
+ export const EmptyState = ({
10
+ title = 'Title',
11
+ secondaryText = 'Secondary text',
12
+ buttonLabel = 'Button',
13
+ onButtonClick,
14
+ icon,
15
+ showIcon = true,
16
+ showSecondaryText = true,
17
+ showButton = true,
18
+ className,
19
+ titleMultiline = false,
20
+ emphasis = 'low',
21
+ size = 'medium',
22
+ children,
23
+ ...props
24
+ }) => {
25
+ const hasButtonContent = children != null || buttonLabel != null
26
+ return (
27
+ <Flex
28
+ className={classNames(className)}
29
+ direction="column"
30
+ align="center"
31
+ justify="center"
32
+ {...props}
33
+ >
34
+ <Flex direction="column" align="center" justify="center" className={styles.content} gap="5" py="6">
35
+ {showIcon && (
36
+ <div className={classNames(styles.iconWrapper, {
37
+ [styles.iconWrapperLarge]: size === 'large',
38
+ [styles.iconWrapperMedium]: size === 'medium',
39
+ [styles.iconWrapperLow]: emphasis === 'low',
40
+ [styles.iconWrapperHigh]: emphasis === 'high',
41
+ })} aria-hidden>
42
+ {icon}
43
+ </div>
44
+ )}
45
+ <Flex direction="column" align="center" justify="center" className={styles.textGroup} gap="2">
46
+ <Text
47
+ size={size === 'large' ? '7' : '4'}
48
+ weight="medium"
49
+ className={classNames({
50
+ [styles.titleMultiline]: titleMultiline,
51
+ [styles.titleLow]: emphasis === 'low',
52
+ [styles.titleHigh]: emphasis === 'high',
53
+ })}
54
+ >
55
+ {title}
56
+ </Text>
57
+ {showSecondaryText && secondaryText != null && (
58
+ <Text
59
+ size={size === 'large' ? '3' : '2'}
60
+ weight="regular"
61
+ className={classNames(styles.secondaryText, {
62
+ [styles.secondaryTextLow]: emphasis === 'low',
63
+ [styles.secondaryTextHigh]: emphasis === 'high',
64
+ })}
65
+ >{secondaryText}</Text>
66
+ )}
67
+ </Flex>
68
+ {showButton && hasButtonContent && (
69
+ <div>
70
+ {children ?? (
71
+ <Button
72
+ size={size === 'large' ? '3' : '2'}
73
+ variant={emphasis === 'low' ? 'soft' : 'solid'}
74
+ onClick={onButtonClick}
75
+ aria-label={buttonLabel}
76
+ >
77
+ {buttonLabel}
78
+ </Button>
79
+ )}
80
+ </div>
81
+ )}
82
+
83
+ </Flex>
84
+ </Flex>
85
+ )
86
+ }
87
+
88
+ EmptyState.displayName = 'EmptyState'
@@ -0,0 +1,91 @@
1
+
2
+ .content {
3
+
4
+ max-width: 480px;
5
+ min-width: 320px;
6
+ width: 100%;
7
+
8
+ }
9
+
10
+ .iconWrapper {
11
+ flex-shrink: 0;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: center;
15
+ color: var(--neutral-alpha-9);
16
+ }
17
+
18
+ .iconWrapperLarge {
19
+ width: 32px;
20
+ height: 32px;
21
+
22
+ svg {
23
+ width: 32px;
24
+ height: 32px;
25
+ }
26
+ }
27
+
28
+ .iconWrapperMedium {
29
+ width: 24px;
30
+ height: 24px;
31
+ svg {
32
+ width: 24px;
33
+ height: 24px;
34
+ }
35
+ }
36
+
37
+ .iconWrapperLow {
38
+ color: var(--neutral-alpha-10);
39
+ }
40
+
41
+ .iconWrapperHigh {
42
+ color: var(--neutral-alpha-12);
43
+ }
44
+ .textGroup {
45
+ width: 100%;
46
+ }
47
+
48
+ .title {
49
+ font-family: inherit;
50
+ font-weight: 400;
51
+ font-size: 18px;
52
+ line-height: 26px;
53
+ letter-spacing: -0.04px;
54
+ color: var(--neutral-alpha-10);
55
+ text-align: center;
56
+ overflow: hidden;
57
+ text-overflow: ellipsis;
58
+ white-space: nowrap;
59
+ width: 100%;
60
+ }
61
+
62
+ .titleMultiline {
63
+ white-space: normal;
64
+ }
65
+
66
+ .titleLow {
67
+ color: var(--neutral-alpha-10);
68
+ }
69
+
70
+ .titleHigh {
71
+ color: var(--neutral-alpha-12);
72
+ }
73
+
74
+ .secondaryText {
75
+ font-family: inherit;
76
+ font-weight: 400;
77
+ font-size: 14px;
78
+ line-height: 20px;
79
+ letter-spacing: 0;
80
+ text-align: center;
81
+ width: 100%;
82
+ }
83
+
84
+
85
+ .secondaryTextLow {
86
+ color: var(--neutral-alpha-9);
87
+ }
88
+
89
+ .secondaryTextHigh {
90
+ color: var(--neutral-alpha-11);
91
+ }
@@ -0,0 +1,192 @@
1
+ import { EmptyState } from './EmptyState'
2
+ import { InfoCircledIcon } from '@radix-ui/react-icons'
3
+
4
+ export default {
5
+ title: 'Components/EmptyState',
6
+ component: EmptyState,
7
+ parameters: {
8
+ layout: 'centered',
9
+ docs: {
10
+ description: {
11
+ component: `
12
+ ## EmptyState
13
+
14
+ Displays an empty state with icon, title, secondary text, and optional action. Aligned with the design system (Figma) with **emphasis** and **size** variants.
15
+
16
+ ### Usage
17
+
18
+ \`\`\`jsx
19
+ import { EmptyState } from '@moises.ai/design-system'
20
+ import { InfoCircledIcon } from '@radix-ui/react-icons'
21
+
22
+ // Default: low emphasis, medium size
23
+ <EmptyState
24
+ title="No items in your setlist"
25
+ secondaryText="Add tracks from your library or search for songs."
26
+ buttonLabel="Add track"
27
+ onButtonClick={() => openLibrary()}
28
+ icon={<InfoCircledIcon />}
29
+ />
30
+
31
+ // High emphasis, large size
32
+ <EmptyState
33
+ title="No projects"
34
+ secondaryText="Create your first project to get started."
35
+ buttonLabel="Create project"
36
+ emphasis="high"
37
+ size="large"
38
+ icon={<PlusIcon />}
39
+ onButtonClick={() => createProject()}
40
+ />
41
+
42
+ // No button, message only
43
+ <EmptyState
44
+ title="No results"
45
+ secondaryText="Try different search terms."
46
+ showButton={false}
47
+ icon={<MagnifyingGlassIcon />}
48
+ />
49
+ \`\`\`
50
+ `,
51
+ },
52
+ },
53
+ },
54
+ tags: ['autodocs'],
55
+ argTypes: {
56
+ title: {
57
+ control: 'text',
58
+ description: 'Main title displayed in the empty state.',
59
+ },
60
+ secondaryText: {
61
+ control: 'text',
62
+ description: 'Supporting secondary text.',
63
+ },
64
+ buttonLabel: {
65
+ control: 'text',
66
+ description: 'Action button label.',
67
+ },
68
+ onButtonClick: {
69
+ action: 'clicked',
70
+ description: 'Called when the button is clicked.',
71
+ },
72
+ icon: {
73
+ description: 'Icon displayed above the title (e.g. InfoCircledIcon).',
74
+ },
75
+ showIcon: {
76
+ control: 'boolean',
77
+ description: 'Show or hide the icon.',
78
+ },
79
+ showSecondaryText: {
80
+ control: 'boolean',
81
+ description: 'Show or hide the secondary text.',
82
+ },
83
+ showButton: {
84
+ control: 'boolean',
85
+ description: 'Show or hide the button (or action area).',
86
+ },
87
+ emphasis: {
88
+ control: 'select',
89
+ options: ['low', 'high'],
90
+ description: "Visual emphasis: 'low' (subtle, soft button) or 'high' (prominent, solid button).",
91
+ },
92
+ size: {
93
+ control: 'select',
94
+ options: ['medium', 'large'],
95
+ description: "Size: 'medium' (24px icon, smaller text) or 'large' (32px icon, larger text).",
96
+ },
97
+ titleMultiline: {
98
+ control: 'boolean',
99
+ description: 'Allow the title to wrap to multiple lines.',
100
+ },
101
+ },
102
+ }
103
+
104
+ export const Default = {
105
+ args: {
106
+ title: 'Title',
107
+ secondaryText: 'Secondary text',
108
+ buttonLabel: 'Button',
109
+ showIcon: true,
110
+ showSecondaryText: true,
111
+ showButton: true,
112
+ emphasis: 'low',
113
+ size: 'medium',
114
+ icon: <InfoCircledIcon />,
115
+ },
116
+ }
117
+
118
+ export const EmphasisHigh = {
119
+ args: {
120
+ ...Default.args,
121
+ title: 'No items found',
122
+ secondaryText: 'Try adjusting filters or searching for a different term.',
123
+ buttonLabel: 'Clear filters',
124
+ emphasis: 'high',
125
+ icon: <InfoCircledIcon />,
126
+ },
127
+ }
128
+
129
+ export const SizeLarge = {
130
+ args: {
131
+ ...Default.args,
132
+ title: 'Your setlist is empty',
133
+ secondaryText: 'Add tracks from your library or search for songs to get started.',
134
+ buttonLabel: 'Add track',
135
+ size: 'large',
136
+ icon: <InfoCircledIcon />,
137
+ },
138
+ }
139
+
140
+ export const LargeAndHighEmphasis = {
141
+ args: {
142
+ ...Default.args,
143
+ title: 'No projects yet',
144
+ secondaryText: 'Create your first project to get started.',
145
+ buttonLabel: 'Create project',
146
+ size: 'large',
147
+ emphasis: 'high',
148
+ icon: <InfoCircledIcon />,
149
+ },
150
+ }
151
+
152
+ export const WithCustomIcon = {
153
+ args: {
154
+ ...Default.args,
155
+ icon: <InfoCircledIcon />,
156
+ },
157
+ }
158
+
159
+ export const NoIcon = {
160
+ args: {
161
+ ...Default.args,
162
+ showIcon: false,
163
+ },
164
+ }
165
+
166
+ export const NoSecondaryText = {
167
+ args: {
168
+ ...Default.args,
169
+ showSecondaryText: false,
170
+ icon: <InfoCircledIcon />,
171
+ },
172
+ }
173
+
174
+ export const NoButton = {
175
+ args: {
176
+ ...Default.args,
177
+ showButton: false,
178
+ icon: <InfoCircledIcon />,
179
+ },
180
+ }
181
+
182
+ export const LongTitle = {
183
+ args: {
184
+ ...Default.args,
185
+ title: 'No items in your setlist yet',
186
+ secondaryText:
187
+ 'Add tracks from your library or search for songs to get started.',
188
+ buttonLabel: 'Add track',
189
+ titleMultiline: true,
190
+ icon: <InfoCircledIcon />,
191
+ },
192
+ }
@@ -213,6 +213,8 @@ export const SetlistItem = ({
213
213
  <DropdownMenu
214
214
  open={dropdownMenuOpen}
215
215
  onOpenChange={onDropdownMenuOpenChange}
216
+ side="bottom"
217
+ align="end"
216
218
  trigger={
217
219
  <Flex
218
220
  className={classNames(styles.dropdownTriggerWrapper, {
package/src/index.jsx CHANGED
@@ -140,3 +140,5 @@ export { TrackHeader } from './components/TrackHeader/TrackHeader'
140
140
  export { useForm } from './components/useForm/useForm'
141
141
  export { VoiceConversionForm } from './components/VoiceConversionForm/VoiceConversionForm'
142
142
  export { Waveform } from './components/VoiceConversionForm/Waveform/Waveform'
143
+
144
+ export { EmptyState } from './components/EmptyState/EmptyState'