@moises.ai/design-system 3.6.9 → 3.6.11

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.
@@ -1,7 +1,7 @@
1
1
  import * as a from "react";
2
2
  import Y from "react";
3
- import { R as tr, u as ye, C as Yr, P as O, a as ae, b as Xr, T as Zr, c as le, d as or, e as _e, f as ce, g as G, h as Ie, i as P, A as Jr, j as Qr, k as en, G as tn, I as on, l as rn, L as nn, m as an, n as bt, o as sn, p as cn, q as ln, S as un, r as dn, s as fn, t as pn, v as Ve, w as vn, x as be, y as mn, z as Me, B as Xe, D as gn, E as Q, F as bn, H as hn, J as Cn, K as rr, M as nr, N as wn, O as Tn, Q as En, V as ar, U as yn, W as Rn, X as _n, Y as sr } from "./index-ZNp169Lu.js";
4
- import { Z as Ni, _ as Fi, $ as Oi, a0 as Di, a1 as Li, a2 as ki, a3 as Vi, a4 as Ki, a5 as $i, a6 as Gi, a7 as Bi, a8 as Hi, a9 as zi, aa as Ui, ab as ji, ac as Wi, ad as qi, ae as Yi, af as Xi, ag as Zi, ah as Ji, ai as Qi } from "./index-ZNp169Lu.js";
3
+ import { R as tr, u as ye, C as Yr, P as O, a as ae, b as Xr, T as Zr, c as le, d as or, e as _e, f as ce, g as G, h as Ie, i as P, A as Jr, j as Qr, k as en, G as tn, I as on, l as rn, L as nn, m as an, n as bt, o as sn, p as cn, q as ln, S as un, r as dn, s as fn, t as pn, v as Ve, w as vn, x as be, y as mn, z as Me, B as Xe, D as gn, E as Q, F as bn, H as hn, J as Cn, K as rr, M as nr, N as wn, O as Tn, Q as En, V as ar, U as yn, W as Rn, X as _n, Y as sr } from "./index-D51dkmoF.js";
4
+ import { Z as Ni, _ as Fi, $ as Oi, a0 as Di, a1 as Li, a2 as ki, a3 as Vi, a4 as Ki, a5 as $i, a6 as Gi, a7 as Bi, a8 as Hi, a9 as zi, aa as Ui, ab as ji, ac as Wi, ad as qi, ae as Yi, af as Xi, ag as Zi, ah as Ji, ai as Qi } from "./index-D51dkmoF.js";
5
5
  import { jsxs as ve, Fragment as me, jsx as i } from "react/jsx-runtime";
6
6
  import * as In from "react-dom";
7
7
  import Mn, { flushSync as pe } from "react-dom";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "3.6.9",
3
+ "version": "3.6.11",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -18,8 +18,16 @@ export const DropdownMenu = memo(
18
18
  maxHeight,
19
19
  closeOnSelect = true,
20
20
  sideOffset = 5,
21
+ matchTriggerWidth = false,
21
22
  ...props
22
23
  }) => {
24
+ const contentStyle = {
25
+ ...(matchTriggerWidth && {
26
+ width: 'var(--radix-dropdown-menu-trigger-width)',
27
+ boxSizing: 'border-box',
28
+ }),
29
+ ...(maxHeight && { height: maxHeight }),
30
+ }
23
31
  return (
24
32
  <>
25
33
  {options?.length > 0 && (
@@ -44,7 +52,7 @@ export const DropdownMenu = memo(
44
52
  size={size}
45
53
  side={props.side}
46
54
  align={props.align}
47
- style={{ height: maxHeight }}
55
+ style={contentStyle}
48
56
  sideOffset={sideOffset}
49
57
  alignOffset={0}
50
58
  onCloseAutoFocus={(event) => {
@@ -74,6 +82,7 @@ export const DropdownMenu = memo(
74
82
  size={size}
75
83
  side={props.side}
76
84
  align={props.align}
85
+ style={contentStyle}
77
86
  sideOffset={sideOffset}
78
87
  alignOffset={0}
79
88
  onCloseAutoFocus={(event) => {
@@ -1,11 +1,13 @@
1
1
  import React, { useState } from 'react'
2
2
  import { DropdownMenu } from './DropdownMenu'
3
3
  import { IconButton } from '../IconButton/IconButton'
4
+ import { Button } from '../Button/Button'
4
5
  import { Flex } from '@radix-ui/themes'
5
6
  import {
6
7
  DotsVerticalIcon,
7
8
  GearIcon,
8
9
  MixerHorizontalIcon,
10
+ ChevronDownIcon,
9
11
  } from '@radix-ui/react-icons'
10
12
 
11
13
  export default {
@@ -220,6 +222,15 @@ The \`options\` prop accepts an array of objects with the following types:
220
222
  defaultValue: { summary: 'false' },
221
223
  },
222
224
  },
225
+ matchTriggerWidth: {
226
+ control: { type: 'boolean' },
227
+ description:
228
+ 'When true, the dropdown content width matches the trigger element width',
229
+ table: {
230
+ type: { summary: 'boolean' },
231
+ defaultValue: { summary: 'false' },
232
+ },
233
+ },
223
234
  },
224
235
  }
225
236
 
@@ -342,6 +353,69 @@ export const StayOpenAfterSelect = {
342
353
  },
343
354
  }
344
355
 
356
+ export const MatchTriggerWidth = {
357
+ args: {
358
+ matchTriggerWidth: true,
359
+ side: 'bottom',
360
+ align: 'start',
361
+ trigger: (
362
+ <Button variant="soft" style={{ width: '100%', justifyContent: 'space-between' }}>
363
+ Private
364
+ <ChevronDownIcon />
365
+ </Button>
366
+ ),
367
+ options: [
368
+ { type: 'label', key: 'actions', label: 'Actions' },
369
+ {
370
+ type: 'item',
371
+ key: 'copy',
372
+ label: 'Copy',
373
+ secondaryText: 'Copies the selection to clipboard',
374
+ keybinding: '⌘C',
375
+ onClick: () => console.log('Copy clicked'),
376
+ },
377
+ {
378
+ type: 'item',
379
+ key: 'paste',
380
+ label: 'Paste',
381
+ keybinding: 'Ctrl+V ⌘V',
382
+ onClick: () => console.log('Paste clicked'),
383
+ },
384
+ {
385
+ type: 'item',
386
+ key: 'settings',
387
+ label: 'Settings',
388
+ secondaryText: 'Open app preferences',
389
+ keybinding: '⌘,',
390
+ onClick: () => console.log('Settings clicked'),
391
+ },
392
+ {
393
+ type: 'item',
394
+ key: 'delete',
395
+ label: 'Delete',
396
+ secondaryText: 'Cannot be undone',
397
+ keybinding: '⌘⌫',
398
+ color: 'red',
399
+ onClick: () => console.log('Delete clicked'),
400
+ },
401
+ {
402
+ type: 'checkbox',
403
+ key: 'dark',
404
+ label: 'Dark mode',
405
+ secondaryText: 'Switch to dark theme',
406
+ keybinding: '⌘D',
407
+ checked: true,
408
+ onChange: (checked) => console.log('Dark mode:', checked),
409
+ },
410
+ ],
411
+ },
412
+ render: (args) => (
413
+ <Flex direction="column" width="280px" gap="4">
414
+ <DropdownMenu {...args} />
415
+ </Flex>
416
+ ),
417
+ }
418
+
345
419
  const ItemPlaygroundComponent = ({
346
420
  size,
347
421
  // Item 1
@@ -1,6 +1,14 @@
1
- import { Children, createContext, useCallback, useContext, useMemo, useRef, useState } from 'react'
2
- import { Flex, Heading, IconButton } from '../../index'
1
+ import {
2
+ Children,
3
+ createContext,
4
+ useCallback,
5
+ useContext,
6
+ useMemo,
7
+ useRef,
8
+ useState,
9
+ } from 'react'
3
10
  import { ArrowLeftIcon, Cross1Icon } from '../../icons'
11
+ import { Flex, Heading, IconButton } from '../../index'
4
12
 
5
13
  const ExtensionContext = createContext(null)
6
14
  const NavigationContext = createContext(null)
@@ -103,15 +111,32 @@ function Header({ title, onBack, headerLeft, headerRight, allowClose = true, onC
103
111
  }
104
112
 
105
113
  /**
106
- * Scrollable content area that fills all remaining vertical space.
114
+ * Content area that fills all remaining vertical space.
107
115
  *
108
116
  * @param {object} props
109
- * @param {React.ReactNode} props.children - Content to render inside the scrollable area.
117
+ * @param {React.ReactNode} props.children - Content to render inside the area.
118
+ * @param {boolean} [props.scrollable=true] - When false the outer div does not scroll,
119
+ * allowing individual children to manage their own overflow.
110
120
  */
111
- function Content({ children }) {
121
+ function Content({ scrollable = true, style, children }) {
112
122
  return (
113
- <div style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>
114
- <Flex direction="column" p="4" gap="3">
123
+ <div
124
+ style={{
125
+ flex: 1,
126
+ minHeight: 0,
127
+ overflowY: scrollable ? 'auto' : 'hidden',
128
+ display: 'flex',
129
+ flexDirection: 'column',
130
+ ...style,
131
+ }}
132
+ >
133
+ <Flex
134
+ direction="column"
135
+ px="4"
136
+ py={scrollable ? '4' : undefined}
137
+ gap="3"
138
+ style={scrollable ? undefined : { flex: 1, minHeight: 0 }}
139
+ >
115
140
  {children}
116
141
  </Flex>
117
142
  </div>
@@ -133,7 +158,7 @@ function Footer({ children }) {
133
158
  align="center"
134
159
  justify="center"
135
160
  mx="4"
136
- py="3"
161
+ // py="3"
137
162
  >
138
163
  {children}
139
164
  </Flex>
@@ -1,4 +1,4 @@
1
- import { Flex, Text, Spinner } from '@radix-ui/themes'
1
+ import { Flex, Spinner, Text } from '@radix-ui/themes'
2
2
  import { Button } from '../Button/Button'
3
3
 
4
4
  export const FooterPanel = ({
@@ -13,6 +13,7 @@ export const FooterPanel = ({
13
13
  onClick,
14
14
  loading,
15
15
  besideFooter,
16
+ style,
16
17
  ...props
17
18
  }) => {
18
19
  return (
@@ -24,6 +25,7 @@ export const FooterPanel = ({
24
25
  style={{
25
26
  padding: '16px 0',
26
27
  borderTop: '1px solid var(--neutral-3)',
28
+ ...style,
27
29
  }}
28
30
  className={className}
29
31
  {...props}
@@ -1,25 +1,19 @@
1
1
  export const LockIcon = ({ width = 16, height = 16, className, ...props }) => (
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
2
+ <svg xmlns="http://www.w3.org/2000/svg"
4
3
  width={width}
5
4
  height={height}
6
- viewBox="0 0 14 14"
5
+ viewBox="0 0 16 16"
7
6
  fill="none"
8
- {...props}
9
7
  className={className}
8
+ {...props}
10
9
  >
11
- <g clipPath="url(#clip0_29457_74941)">
12
- <path
13
- d="M4.08333 6.41663V4.08329C4.08333 3.30974 4.39062 2.56788 4.93761 2.0209C5.48459 1.47392 6.22645 1.16663 7 1.16663C7.77355 1.16663 8.51541 1.47392 9.06239 2.0209C9.60938 2.56788 9.91667 3.30974 9.91667 4.08329V6.41663M2.91667 6.41663H11.0833C11.7277 6.41663 12.25 6.93896 12.25 7.58329V11.6666C12.25 12.311 11.7277 12.8333 11.0833 12.8333H2.91667C2.27233 12.8333 1.75 12.311 1.75 11.6666V7.58329C1.75 6.93896 2.27233 6.41663 2.91667 6.41663Z"
14
- stroke="currentColor"
15
- strokeWidth="1.5"
16
- strokeLinecap="round"
17
- strokeLinejoin="round"
18
- />
10
+ <g clipPath="url(#clip0_35277_68311)">
11
+ <path d="M4.66667 7.33398V4.66732C4.66667 3.78326 5.01786 2.93542 5.64298 2.3103C6.2681 1.68517 7.11595 1.33398 8 1.33398C8.88406 1.33398 9.7319 1.68517 10.357 2.3103C10.9821 2.93542 11.3333 3.78326 11.3333 4.66732V7.33398M3.33333 7.33398H12.6667C13.403 7.33398 14 7.93094 14 8.66732V13.334C14 14.0704 13.403 14.6673 12.6667 14.6673H3.33333C2.59695 14.6673 2 14.0704 2 13.334V8.66732C2 7.93094 2.59695 7.33398 3.33333 7.33398Z"
12
+ stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
19
13
  </g>
20
14
  <defs>
21
- <clipPath id="clip0_29457_74941">
22
- <rect width="14" height="14" fill="currentColor" />
15
+ <clipPath id="clip0_35277_68311">
16
+ <rect width="16" height="16" fill="white" />
23
17
  </clipPath>
24
18
  </defs>
25
19
  </svg>
@@ -0,0 +1,22 @@
1
+ export const UnlockIcon = ({ width = 16, height = 16, className, ...props }) => (
2
+ <svg xmlns="http://www.w3.org/2000/svg"
3
+ width={width}
4
+ height={height}
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ className={className}
8
+ {...props}
9
+ >
10
+ <g clipPath="url(#clip0_35277_49197)">
11
+ <path d="M4.66667 7.33398V4.66732C4.66667 3.78326 5.01786 2.93542 5.64298 2.3103C6.2681 1.68517 7.11595 1.33398 8 1.33398C8.88406 1.33398 9.7319 1.68517 10.357 2.3103C10.8226 2.77588 11.1362 3.36502 11.266 4.00065M3.33333 7.33398H12.6667C13.403 7.33398 14 7.93094 14 8.66732V13.334C14 14.0704 13.403 14.6673 12.6667 14.6673H3.33333C2.59695 14.6673 2 14.0704 2 13.334V8.66732C2 7.93094 2.59695 7.33398 3.33333 7.33398Z"
12
+ stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
13
+ </g>
14
+ <defs>
15
+ <clipPath id="clip0_35277_49197">
16
+ <rect width="16" height="16" fill="white" />
17
+ </clipPath>
18
+ </defs>
19
+ </svg>
20
+ )
21
+
22
+ UnlockIcon.displayName = 'UnlockIcon'
package/src/icons.jsx CHANGED
@@ -341,3 +341,4 @@ export { WidgetIcon } from './icons/WidgetIcon'
341
341
  export { GlobeIcon } from './icons/GlobeIcon'
342
342
  export { DotsVertical2Icon } from './icons/DotsVertical2Icon'
343
343
  export { EditIcon } from './icons/EditIcon'
344
+ export { UnlockIcon } from './icons/UnlockIcon'
package/src/index.jsx CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  Card,
10
10
  Code,
11
11
  Container,
12
+ DataList,
12
13
  Dialog,
13
14
  Em,
14
15
  Flex,
@@ -33,7 +34,6 @@ import {
33
34
  Table,
34
35
  Tabs,
35
36
  VisuallyHidden,
36
- DataList,
37
37
  } from '@radix-ui/themes'
38
38
 
39
39
  export {
@@ -46,6 +46,7 @@ export {
46
46
  Card,
47
47
  Code,
48
48
  Container,
49
+ DataList,
49
50
  Dialog,
50
51
  Em,
51
52
  Flex,
@@ -70,87 +71,71 @@ export {
70
71
  Table,
71
72
  Tabs,
72
73
  VisuallyHidden,
73
- DataList,
74
74
  }
75
75
 
76
76
  // Export our custom components
77
- export { HorizontalVolume } from './components/HorizontalVolume/HorizontalVolume'
78
- export { IconButton } from './components/IconButton/IconButton'
79
- export { Theme } from './components/theme/Theme'
80
-
81
- export { DropdownMenu } from './components/DropdownMenu/DropdownMenu'
82
- export { HeaderPanel } from './components/HeaderPanel/HeaderPanel'
83
-
84
- export { ListCards } from './components/ListCards/ListCards'
85
- export { MultiSelectCards } from './components/MultiSelectCards/MultiSelectCards'
86
- export { SegmentedControl } from './components/SegmentedControl/SegmentedControl'
87
-
88
- export { FooterPanel } from './components/FooterPanel/FooterPanel'
89
- export { MessageWithAction } from './components/MessageWithAction/MessageWithAction'
90
- export { MultiSelect } from './components/MultiSelect/MultiSelect'
91
- export { PanControl } from './components/PanControl/PanControl'
92
- export { Select } from './components/Select/Select'
93
- export { GenerationStatus } from './components/StemSeparationForm/GenerationStatus/GenerationStatus'
94
-
95
- export { Slider } from './components/Slider/Slider'
96
-
97
- export { useForm } from './components/useForm/useForm'
98
- export { Extension, useExtension, useNavigation, useScreen } from './components/Extension/Extension'
99
-
100
- export { TextArea } from './components/TextArea/TextArea'
101
-
77
+ export { AdditionalItems } from './components/AdditionalItems/AdditionalItems'
78
+ export { BannerAnnouncement } from './components/BannerAnnouncement/BannerAnnouncement'
102
79
  export { Button } from './components/Button/Button'
103
- export { SectionExpander } from './components/SectionExpander/SectionExpander'
104
-
105
- export { ContextMenu } from './components/ContextMenu/ContextMenu'
106
-
107
- export { TextField } from './components/TextField/TextField'
108
-
109
80
  export { Callout } from './components/Callout/Callout'
81
+ export { Card as CardWidget } from './components/Card/Card'
82
+ export { Checkbox } from './components/Checkbox/Checkbox'
83
+ export { CigarBar } from './components/CigarBar/CigarBar'
84
+ export { ContextMenu } from './components/ContextMenu/ContextMenu'
85
+ export { Countdown } from './components/Countdown/Countdown'
86
+ export { DataTable } from './components/DataTable/DataTable'
110
87
  export { DropdownButton } from './components/DropdownButton/DropdownButton'
88
+ export { DropdownMenu } from './components/DropdownMenu/DropdownMenu'
89
+ export {
90
+ Extension,
91
+ useExtension,
92
+ useNavigation,
93
+ useScreen,
94
+ } from './components/Extension/Extension'
95
+ export { FloatingBanner } from './components/FloatingBanner/FloatingBanner'
96
+ export { FooterPanel } from './components/FooterPanel/FooterPanel'
97
+ export { GenerationSourceCallout } from './components/GenerationSourceCallout/GenerationSourceCallout'
111
98
  export { GroupButtons } from './components/GroupButtons/GroupButtons'
99
+ export { HeaderPanel } from './components/HeaderPanel/HeaderPanel'
100
+ export { HorizontalVolume } from './components/HorizontalVolume/HorizontalVolume'
101
+ export { IconButton } from './components/IconButton/IconButton'
102
+ export { InstrumentSelector } from './components/InstrumentSelector/InstrumentSelector'
112
103
  export { Knob } from './components/Knob/Knob'
113
- export { Text } from './components/Text/Text'
114
-
115
- export { Rating } from './components/Rating/Rating'
116
- export { ThumbnailPicker } from './components/ThumbnailPicker/ThumbnailPicker'
117
-
118
- export { StemGenerationForm } from './components/StemGenerationForm/StemGenerationForm'
119
- export { StemSeparationForm } from './components/StemSeparationForm/StemSeparationForm'
120
- export { TooltipWithInfoIcon } from './components/TooltipWithInfoIcon/TooltipWithInfoIcon'
121
-
122
- export { VoiceConversionForm } from './components/VoiceConversionForm/VoiceConversionForm'
123
-
104
+ export { ListCards } from './components/ListCards/ListCards'
105
+ export { MessageWithAction } from './components/MessageWithAction/MessageWithAction'
124
106
  export { MetronomeForm } from './components/MetronomeForm/MetronomeForm'
125
- export { TempoControlsForm } from './components/TempoControlsForm/TempoControlsForm'
126
-
127
- export { AdditionalItems } from './components/AdditionalItems/AdditionalItems'
128
- export { BannerAnnouncement } from './components/BannerAnnouncement/BannerAnnouncement'
129
- export { Countdown } from './components/Countdown/Countdown'
107
+ export { MoreButton } from './components/MoreButton/MoreButton'
108
+ export { MultiSelect } from './components/MultiSelect/MultiSelect'
109
+ export { MultiSelectCards } from './components/MultiSelectCards/MultiSelectCards'
110
+ export { PanControl } from './components/PanControl/PanControl'
111
+ export { ProductsBrandPattern } from './components/ProductsBrandPattern/ProductsBrandPattern'
130
112
  export { ProductsList } from './components/ProductsList/ProductsList'
131
113
  export { ProfileMenu } from './components/ProfileMenu/ProfileMenu'
114
+ export { ProjectsList } from './components/ProjectsList/ProjectsList'
115
+ export { RadioCardsGroup } from './components/RadioCardsGroup/RadioCardsGroup'
116
+ export { Rating } from './components/Rating/Rating'
132
117
  export { RecordingForm } from './components/RecordingForm/RecordingForm'
118
+ export { SectionExpander } from './components/SectionExpander/SectionExpander'
119
+ export { SegmentedControl } from './components/SegmentedControl/SegmentedControl'
120
+ export { Select } from './components/Select/Select'
133
121
  export { SetlistList } from './components/SetlistList/SetlistList'
134
122
  export { Shell } from './components/Shell/Shell'
135
123
  export { Sidebar } from './components/Sidebar/Sidebar'
136
124
  export { SidebarSection } from './components/Sidebar/SidebarSection/SidebarSection'
125
+ export { Slider } from './components/Slider/Slider'
126
+ export { StemGenerationForm } from './components/StemGenerationForm/StemGenerationForm'
127
+ export { GenerationStatus } from './components/StemSeparationForm/GenerationStatus/GenerationStatus'
128
+ export { StemSeparationForm } from './components/StemSeparationForm/StemSeparationForm'
129
+ export { TempoControlsForm } from './components/TempoControlsForm/TempoControlsForm'
130
+ export { Text } from './components/Text/Text'
131
+ export { TextArea } from './components/TextArea/TextArea'
132
+ export { TextField } from './components/TextField/TextField'
133
+ export { Theme } from './components/theme/Theme'
134
+ export { ThumbnailPicker } from './components/ThumbnailPicker/ThumbnailPicker'
135
+ export { Tooltip } from './components/Tooltip/Tooltip'
136
+ export { TooltipWithInfoIcon } from './components/TooltipWithInfoIcon/TooltipWithInfoIcon'
137
137
  export { TrackControlButton } from './components/TrackControlButton'
138
138
  export { TrackHeader } from './components/TrackHeader/TrackHeader'
139
-
140
- export { Checkbox } from './components/Checkbox/Checkbox'
141
- export { CigarBar } from './components/CigarBar/CigarBar'
142
- export { DataTable } from './components/DataTable/DataTable'
143
- export { FloatingBanner } from './components/FloatingBanner/FloatingBanner'
144
- export { ProductsBrandPattern } from './components/ProductsBrandPattern/ProductsBrandPattern'
145
- export { RadioCardsGroup } from './components/RadioCardsGroup/RadioCardsGroup'
146
-
147
- export { GenerationSourceCallout } from './components/GenerationSourceCallout/GenerationSourceCallout'
139
+ export { useForm } from './components/useForm/useForm'
140
+ export { VoiceConversionForm } from './components/VoiceConversionForm/VoiceConversionForm'
148
141
  export { Waveform } from './components/VoiceConversionForm/Waveform/Waveform'
149
-
150
-
151
- export { InstrumentSelector } from './components/InstrumentSelector/InstrumentSelector'
152
- export { Card as CardWidget } from './components/Card/Card'
153
- export { ProjectsList } from './components/ProjectsList/ProjectsList'
154
-
155
- export { MoreButton } from './components/MoreButton/MoreButton'
156
- export { Tooltip } from './components/Tooltip/Tooltip'