@moises.ai/design-system 4.19.8 → 4.19.9

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": "4.19.8",
3
+ "version": "4.19.9",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -13,6 +13,7 @@ export const Button = ({
13
13
  highContrast = false,
14
14
  onClick,
15
15
  style,
16
+ rightSlot,
16
17
  ...props
17
18
  }) => {
18
19
  const resolvedColor = color === 'neutral' ? 'gray' : color
@@ -29,6 +30,7 @@ export const Button = ({
29
30
  [styles.disabled]: disabled,
30
31
  [styles.loading]: loading,
31
32
  [styles.highContrast]: highContrast,
33
+ [styles.hasRightSlot]: rightSlot,
32
34
  })}
33
35
  disabled={disabled}
34
36
  loading={loading}
@@ -37,7 +39,14 @@ export const Button = ({
37
39
  style={style}
38
40
  {...props}
39
41
  >
40
- {children}
42
+ {rightSlot ? (
43
+ <>
44
+ <span className={styles.label}>{children}</span>
45
+ <span className={styles.rightSlot}>{rightSlot}</span>
46
+ </>
47
+ ) : (
48
+ children
49
+ )}
41
50
  </ButtonPrimitive>
42
51
  )
43
52
  }
@@ -308,3 +308,32 @@
308
308
  border-radius: 12px;
309
309
  }
310
310
 
311
+ .hasRightSlot {
312
+ position: relative;
313
+ }
314
+
315
+ .label {
316
+ min-width: 0;
317
+ }
318
+
319
+ .rightSlot {
320
+ position: absolute;
321
+ top: 50%;
322
+ right: 12px;
323
+ transform: translateY(-50%);
324
+ display: flex;
325
+ align-items: center;
326
+ gap: 8px;
327
+ flex-shrink: 0;
328
+ line-height: 1;
329
+ }
330
+
331
+ .hasRightSlot.size1 .rightSlot {
332
+ right: 8px;
333
+ }
334
+
335
+ .hasRightSlot.size3 .rightSlot,
336
+ .hasRightSlot.size4 .rightSlot {
337
+ right: 16px;
338
+ }
339
+
@@ -1,6 +1,7 @@
1
1
  import { Button } from './Button'
2
2
  import { PlusIcon } from '@radix-ui/react-icons'
3
3
  import { Flex } from '@radix-ui/themes'
4
+ import { HiFi1Icon, LockIcon } from '../../icons'
4
5
 
5
6
  export default {
6
7
  title: 'Components/Button',
@@ -110,6 +111,15 @@ const MyComponent = () => (
110
111
  defaultValue: { summary: 'undefined' },
111
112
  },
112
113
  },
114
+ rightSlot: {
115
+ control: false,
116
+ description:
117
+ 'Optional content rendered on the right side while keeping the label centered',
118
+ table: {
119
+ type: { summary: 'ReactNode' },
120
+ defaultValue: { summary: 'undefined' },
121
+ },
122
+ },
113
123
  },
114
124
  }
115
125
 
@@ -267,3 +277,20 @@ export const WithIcons = {
267
277
  </Flex>
268
278
  ),
269
279
  }
280
+
281
+ export const WithRightSlot = {
282
+ render: () => (
283
+ <Flex gap="4" direction="column" width="500px">
284
+ <Button variant="solid" color="cyan" rightSlot={<HiFi1Icon height={14} />}>
285
+ Change Stems
286
+ </Button>
287
+ <Button
288
+ variant="solid"
289
+ color="cyan"
290
+ rightSlot={<LockIcon width={16} height={16} />}
291
+ >
292
+ Export mixdown + click track
293
+ </Button>
294
+ </Flex>
295
+ ),
296
+ }