@contember/create 2.1.0-alpha.30 → 2.1.0-alpha.35

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.
Files changed (158) hide show
  1. package/dist/development/run.cjs +6 -4
  2. package/dist/development/run.cjs.map +1 -1
  3. package/dist/development/run.js +6 -4
  4. package/dist/development/run.js.map +1 -1
  5. package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  6. package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
  7. package/dist/development/src/lib/FileSystem.cjs.map +1 -1
  8. package/dist/development/src/lib/FileSystem.js.map +1 -1
  9. package/dist/development/src/lib/TemplateInstaller.cjs +4 -7
  10. package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
  11. package/dist/development/src/lib/TemplateInstaller.js +4 -7
  12. package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
  13. package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
  14. package/dist/development/src/lib/packageManagerDetector.js.map +1 -1
  15. package/dist/development/src/lib/version.cjs.map +1 -1
  16. package/dist/development/src/lib/version.js.map +1 -1
  17. package/dist/development/src/paths.cjs.map +1 -1
  18. package/dist/development/src/paths.js.map +1 -1
  19. package/dist/production/run.cjs +6 -4
  20. package/dist/production/run.cjs.map +1 -1
  21. package/dist/production/run.js +6 -4
  22. package/dist/production/run.js.map +1 -1
  23. package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  24. package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
  25. package/dist/production/src/lib/FileSystem.cjs.map +1 -1
  26. package/dist/production/src/lib/FileSystem.js.map +1 -1
  27. package/dist/production/src/lib/TemplateInstaller.cjs +4 -7
  28. package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
  29. package/dist/production/src/lib/TemplateInstaller.js +4 -7
  30. package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
  31. package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
  32. package/dist/production/src/lib/packageManagerDetector.js.map +1 -1
  33. package/dist/production/src/lib/version.cjs.map +1 -1
  34. package/dist/production/src/lib/version.js.map +1 -1
  35. package/dist/production/src/paths.cjs.map +1 -1
  36. package/dist/production/src/paths.js.map +1 -1
  37. package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
  38. package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
  39. package/package.json +12 -7
  40. package/resources/templates/default/.github/workflows/deploy.yaml +1 -1
  41. package/resources/templates/default/admin/.env.production +6 -0
  42. package/resources/templates/default/admin/app/pages/tenant.tsx +2 -2
  43. package/resources/templates/default/admin/lib/binding/binding.tsx +0 -2
  44. package/resources/templates/default/admin/lib/binding/hooks.tsx +14 -8
  45. package/resources/templates/default/admin/lib/binding/identity.tsx +31 -30
  46. package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
  47. package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +10 -12
  48. package/resources/templates/default/admin/lib/board/board.tsx +59 -45
  49. package/resources/templates/default/admin/lib/buttons/back-button.tsx +1 -1
  50. package/resources/templates/default/admin/lib/datagrid/cells.tsx +49 -35
  51. package/resources/templates/default/admin/lib/datagrid/column-header.tsx +47 -38
  52. package/resources/templates/default/admin/lib/datagrid/columns.tsx +128 -105
  53. package/resources/templates/default/admin/lib/datagrid/elements.tsx +8 -4
  54. package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +1 -4
  55. package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +14 -14
  56. package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +34 -20
  57. package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +0 -1
  58. package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +24 -30
  59. package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +2 -3
  60. package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +0 -3
  61. package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +35 -29
  62. package/resources/templates/default/admin/lib/datagrid/index.ts +21 -21
  63. package/resources/templates/default/admin/lib/datagrid/labels.tsx +0 -1
  64. package/resources/templates/default/admin/lib/datagrid/loader.tsx +2 -7
  65. package/resources/templates/default/admin/lib/datagrid/pagination.tsx +32 -37
  66. package/resources/templates/default/admin/lib/datagrid/table.tsx +7 -5
  67. package/resources/templates/default/admin/lib/datagrid/tiles.tsx +10 -5
  68. package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +10 -7
  69. package/resources/templates/default/admin/lib/datagrid/ui.tsx +10 -13
  70. package/resources/templates/default/admin/lib/dev/login-panel.tsx +23 -16
  71. package/resources/templates/default/admin/lib/dict.ts +14 -4
  72. package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +20 -8
  73. package/resources/templates/default/admin/lib/editor/block-editor.tsx +22 -10
  74. package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
  75. package/resources/templates/default/admin/lib/editor/common/buttons.tsx +155 -33
  76. package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
  77. package/resources/templates/default/admin/lib/editor/common/editor-canvas.tsx +5 -3
  78. package/resources/templates/default/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
  79. package/resources/templates/default/admin/lib/editor/common/editor-inline-toolbar.tsx +4 -1
  80. package/resources/templates/default/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
  81. package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +46 -34
  82. package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
  83. package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
  84. package/resources/templates/default/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
  85. package/resources/templates/default/admin/lib/editor/editor-block.tsx +16 -9
  86. package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +11 -6
  87. package/resources/templates/default/admin/lib/editor/rich-text.tsx +6 -7
  88. package/resources/templates/default/admin/lib/editor/sortable-block.tsx +31 -25
  89. package/resources/templates/default/admin/lib/form/container.tsx +20 -14
  90. package/resources/templates/default/admin/lib/form/inputs.tsx +10 -6
  91. package/resources/templates/default/admin/lib/form/select.tsx +74 -42
  92. package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +56 -56
  93. package/resources/templates/default/admin/lib/form/upload.tsx +61 -65
  94. package/resources/templates/default/admin/lib/labels/enum-labels.ts +6 -3
  95. package/resources/templates/default/admin/lib/labels/field-labels.ts +4 -2
  96. package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +36 -26
  97. package/resources/templates/default/admin/lib/layout/slots.tsx +1 -4
  98. package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
  99. package/resources/templates/default/admin/lib/repeater/repeater.tsx +21 -12
  100. package/resources/templates/default/admin/lib/select/create-new.tsx +0 -3
  101. package/resources/templates/default/admin/lib/select/filter.tsx +0 -1
  102. package/resources/templates/default/admin/lib/select/list.tsx +33 -28
  103. package/resources/templates/default/admin/lib/select/multi-select.tsx +66 -70
  104. package/resources/templates/default/admin/lib/select/select.tsx +77 -72
  105. package/resources/templates/default/admin/lib/select/sortable-select.tsx +84 -82
  106. package/resources/templates/default/admin/lib/select/ui.tsx +7 -5
  107. package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +21 -8
  108. package/resources/templates/default/admin/lib/tenant/forms/common.tsx +21 -12
  109. package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +9 -5
  110. package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +12 -7
  111. package/resources/templates/default/admin/lib/tenant/forms/login.tsx +26 -7
  112. package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +31 -19
  113. package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
  114. package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +21 -8
  115. package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
  116. package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
  117. package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +3 -4
  118. package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
  119. package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +5 -3
  120. package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
  121. package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +17 -11
  122. package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +6 -4
  123. package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +86 -59
  124. package/resources/templates/default/admin/lib/toast/toast.tsx +24 -22
  125. package/resources/templates/default/admin/lib/toast/toaster.tsx +0 -1
  126. package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +4 -3
  127. package/resources/templates/default/admin/lib/ui/button.tsx +2 -1
  128. package/resources/templates/default/admin/lib/ui/dialog.tsx +12 -8
  129. package/resources/templates/default/admin/lib/ui/dropdown.tsx +17 -14
  130. package/resources/templates/default/admin/lib/ui/loader.tsx +1 -1
  131. package/resources/templates/default/admin/lib/ui/menu.tsx +3 -11
  132. package/resources/templates/default/admin/lib/ui/overlay.tsx +11 -9
  133. package/resources/templates/default/admin/lib/ui/popover.tsx +1 -1
  134. package/resources/templates/default/admin/lib/ui/property-list.tsx +2 -2
  135. package/resources/templates/default/admin/lib/ui/scroll-area.tsx +11 -11
  136. package/resources/templates/default/admin/lib/ui/select.tsx +1 -2
  137. package/resources/templates/default/admin/lib/ui/sheet.tsx +6 -5
  138. package/resources/templates/default/admin/lib/ui/sidebar.tsx +41 -30
  139. package/resources/templates/default/admin/lib/ui/switch.tsx +5 -3
  140. package/resources/templates/default/admin/lib/ui/textarea.tsx +7 -4
  141. package/resources/templates/default/admin/lib/ui/toggle-group.tsx +9 -5
  142. package/resources/templates/default/admin/lib/ui/toggle.tsx +3 -4
  143. package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -1
  144. package/resources/templates/default/admin/lib/upload/dropzone.tsx +14 -10
  145. package/resources/templates/default/admin/lib/upload/repeater.tsx +0 -1
  146. package/resources/templates/default/admin/lib/upload/ui.tsx +0 -4
  147. package/resources/templates/default/admin/lib/upload/upload-progress.tsx +27 -11
  148. package/resources/templates/default/admin/lib/upload/view.tsx +129 -67
  149. package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
  150. package/resources/templates/default/admin/lib/utils/uic.tsx +24 -14
  151. package/resources/templates/default/admin/lib/utils/use-mobile.ts +1 -3
  152. package/resources/templates/default/admin/package.json +2 -3
  153. package/resources/templates/default/admin/vite.config.ts +1 -1
  154. package/src/commands/WorkspaceCreateCommand.ts +0 -1
  155. package/src/lib/TemplateInstaller.ts +3 -6
  156. package/src/run.ts +8 -7
  157. package/dist/types/tsconfig.tsbuildinfo +0 -1
  158. package/resources/templates/default/admin/postcss.config.js +0 -5
@@ -3,7 +3,17 @@ import qrcode from 'qrcode-generator'
3
3
  import { DisableOtpTrigger, OtpConfirmForm, OtpPrepareForm, useIdentity, useOtpConfirmForm, useOtpPrepareForm } from '@contember/interface'
4
4
  import { Loader } from '../../ui/loader'
5
5
  import { Button } from '../../ui/button'
6
- import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '../../ui/alert-dialog'
6
+ import {
7
+ AlertDialog,
8
+ AlertDialogAction,
9
+ AlertDialogCancel,
10
+ AlertDialogContent,
11
+ AlertDialogDescription,
12
+ AlertDialogFooter,
13
+ AlertDialogHeader,
14
+ AlertDialogTitle,
15
+ AlertDialogTrigger,
16
+ } from '../../ui/alert-dialog'
7
17
  import { TenantFormError, TenantFormField } from '../forms/common'
8
18
  import { ToastContent, useShowToast } from '../../toast'
9
19
  import { dict } from '../../dict'
@@ -29,73 +39,85 @@ export const OtpSetup = () => {
29
39
  }}
30
40
  >
31
41
  <form>
32
- {person.otpEnabled && <>
33
- <div className="border border-destructive p-4 mb-4 rounded-sm">
34
- {dict.tenant.otpSetup.alreadyHaveOtp}
35
- </div>
36
- </>}
42
+ {person.otpEnabled && (
43
+ <>
44
+ <div className="border border-destructive p-4 mb-4 rounded-sm">
45
+ {dict.tenant.otpSetup.alreadyHaveOtp}
46
+ </div>
47
+ </>
48
+ )}
37
49
  <OtpPrepareFormFields />
38
50
  </form>
39
51
  </OtpPrepareForm>
40
52
  )
41
53
  }
42
54
  if (otpUri) {
43
- return <>
44
- <p>
45
- {dict.tenant.otpSetup.nowScanQrCode}
46
- </p>
47
- <QrCode data={otpUri} />
48
- <p>
49
- {dict.tenant.otpSetup.writeDownCode}
50
- </p>
51
- <OtpConfirmForm onSuccess={() => {
52
- showToast(<ToastContent>{dict.tenant.otpSetup.enabledSuccess}</ToastContent>, { type: 'success' })
53
- }}>
54
- <form>
55
- <OtpConfirmFormFields />
56
- </form>
57
- </OtpConfirmForm>
58
- </>
55
+ return (
56
+ <>
57
+ <p>
58
+ {dict.tenant.otpSetup.nowScanQrCode}
59
+ </p>
60
+ <QrCode data={otpUri} />
61
+ <p>
62
+ {dict.tenant.otpSetup.writeDownCode}
63
+ </p>
64
+ <OtpConfirmForm
65
+ onSuccess={() => {
66
+ showToast(<ToastContent>{dict.tenant.otpSetup.enabledSuccess}</ToastContent>, { type: 'success' })
67
+ }}
68
+ >
69
+ <form>
70
+ <OtpConfirmFormFields />
71
+ </form>
72
+ </OtpConfirmForm>
73
+ </>
74
+ )
59
75
  }
60
76
 
61
77
  if (person.otpEnabled) {
62
- return <>
78
+ return (
79
+ <>
80
+ <p>
81
+ {dict.tenant.otpSetup.twoFactorEnabled}
82
+ </p>
83
+ <AlertDialog>
84
+ <AlertDialogTrigger asChild>
85
+ <Button variant="destructive">{dict.tenant.otpSetup.disableTwoFactor}</Button>
86
+ </AlertDialogTrigger>
87
+ <AlertDialogContent>
88
+ <AlertDialogHeader>
89
+ <AlertDialogTitle>{dict.tenant.otpSetup.disableTwoFactor}</AlertDialogTitle>
90
+ <AlertDialogDescription>{dict.tenant.otpSetup.disableTwoFactorConfirm}</AlertDialogDescription>
91
+ </AlertDialogHeader>
92
+ <AlertDialogFooter>
93
+ <AlertDialogCancel>
94
+ {dict.tenant.otpSetup.cancel}
95
+ </AlertDialogCancel>
96
+ <DisableOtpTrigger
97
+ onSuccess={() => {
98
+ showToast(<ToastContent>{dict.tenant.otpSetup.disabledSuccess}</ToastContent>, { type: 'success' })
99
+ }}
100
+ >
101
+ <AlertDialogAction variant="destructive">
102
+ {dict.tenant.otpSetup.disable}
103
+ </AlertDialogAction>
104
+ </DisableOtpTrigger>
105
+ </AlertDialogFooter>
106
+ </AlertDialogContent>
107
+ </AlertDialog>
108
+ <p>{dict.tenant.otpSetup.alreadyHaveOtp}</p>
109
+ <Button onClick={() => setInitializingOtp(true)}>{dict.tenant.otpSetup.setupAgain}</Button>
110
+ </>
111
+ )
112
+ }
113
+ return (
114
+ <>
63
115
  <p>
64
- {dict.tenant.otpSetup.twoFactorEnabled}
116
+ {dict.tenant.otpSetup.description}
65
117
  </p>
66
- <AlertDialog>
67
- <AlertDialogTrigger asChild>
68
- <Button variant="destructive">{dict.tenant.otpSetup.disableTwoFactor}</Button>
69
- </AlertDialogTrigger>
70
- <AlertDialogContent>
71
- <AlertDialogHeader>
72
- <AlertDialogTitle>{dict.tenant.otpSetup.disableTwoFactor}</AlertDialogTitle>
73
- <AlertDialogDescription>{dict.tenant.otpSetup.disableTwoFactorConfirm}</AlertDialogDescription>
74
- </AlertDialogHeader>
75
- <AlertDialogFooter>
76
- <AlertDialogCancel>
77
- {dict.tenant.otpSetup.cancel}
78
- </AlertDialogCancel>
79
- <DisableOtpTrigger onSuccess={() => {
80
- showToast(<ToastContent>{dict.tenant.otpSetup.disabledSuccess}</ToastContent>, { type: 'success' })
81
- }}>
82
- <AlertDialogAction variant="destructive">
83
- {dict.tenant.otpSetup.disable}
84
- </AlertDialogAction>
85
- </DisableOtpTrigger>
86
- </AlertDialogFooter>
87
- </AlertDialogContent>
88
- </AlertDialog>
89
- <p>{dict.tenant.otpSetup.alreadyHaveOtp}</p>
90
- <Button onClick={() => setInitializingOtp(true)}>{dict.tenant.otpSetup.setupAgain}</Button>
118
+ <Button onClick={() => setInitializingOtp(true)}>{dict.tenant.otpSetup.setupTwoFactor}</Button>
91
119
  </>
92
- }
93
- return <>
94
- <p>
95
- {dict.tenant.otpSetup.description}
96
- </p>
97
- <Button onClick={() => setInitializingOtp(true)}>{dict.tenant.otpSetup.setupTwoFactor}</Button>
98
- </>
120
+ )
99
121
  }
100
122
 
101
123
  const QrCode = ({ data }: { data: string }) => {
@@ -115,8 +137,11 @@ export const OtpConfirmFormFields = () => {
115
137
  {form.state === 'success' || form.state === 'submitting' ? <Loader position="absolute" /> : null}
116
138
  <TenantFormError form={form} messages={dict.tenant.otpSetup.otpConfirmFormErrorMessages} />
117
139
  <TenantFormField
118
- form={form} messages={dict.tenant.otpSetup.otpConfirmFormErrorMessages} field="otpToken"
119
- type="text" required
140
+ form={form}
141
+ messages={dict.tenant.otpSetup.otpConfirmFormErrorMessages}
142
+ field="otpToken"
143
+ type="text"
144
+ required
120
145
  >
121
146
  {dict.tenant.otpSetup.otpToken}
122
147
  </TenantFormField>
@@ -133,7 +158,9 @@ export const OtpPrepareFormFields = () => {
133
158
  {form.state === 'success' || form.state === 'submitting' ? <Loader position="absolute" /> : null}
134
159
  <TenantFormError form={form} messages={dict.tenant.otpSetup.otpPrepareFormErrorMessages} />
135
160
  <TenantFormField
136
- form={form} messages={dict.tenant.otpSetup.otpPrepareFormErrorMessages} field="label"
161
+ form={form}
162
+ messages={dict.tenant.otpSetup.otpPrepareFormErrorMessages}
163
+ field="label"
137
164
  type="text"
138
165
  >
139
166
  {dict.tenant.otpSetup.label}
@@ -14,29 +14,31 @@ export const ToastContent = ({ title, children, action, details }: {
14
14
  }) => {
15
15
  const [open, setOpen] = React.useState(false)
16
16
 
17
- return <>
18
- <div className="flex flex-col gap-1 flex-1 p-6 pr-8">
19
- {title && <ToastTitle>{title}</ToastTitle>}
20
- {children && <ToastDescription>{children}</ToastDescription>}
21
- {details ? (
22
- open ? (
23
- <code className="p-1 bg-gray-50 border border-gray-200 rounded-sm font-mono text-xs">{details}</code>
24
- ) : (
25
- <div>
26
- <button onClick={() => setOpen(true)} className="text-sm text-gray-400 underline">{dict.toast.showDetails}</button>
27
- </div>
28
- )
29
- ) : null}
30
- </div>
31
- {action}
32
- </>
17
+ return (
18
+ <>
19
+ <div className="flex flex-col gap-1 flex-1 p-6 pr-8">
20
+ {title && <ToastTitle>{title}</ToastTitle>}
21
+ {children && <ToastDescription>{children}</ToastDescription>}
22
+ {details
23
+ ? (
24
+ open ? <code className="p-1 bg-gray-50 border border-gray-200 rounded-sm font-mono text-xs">{details}</code> : (
25
+ <div>
26
+ <button onClick={() => setOpen(true)} className="text-sm text-gray-400 underline">{dict.toast.showDetails}</button>
27
+ </div>
28
+ )
29
+ )
30
+ : null}
31
+ </div>
32
+ {action}
33
+ </>
34
+ )
33
35
  }
34
36
  export const ToastAction = uic(ToastPrimitives.Action, {
35
- baseClass: 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-gray-200 bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
37
+ baseClass:
38
+ 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-gray-200 bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
36
39
  displayName: 'ToastAction',
37
40
  })
38
41
 
39
-
40
42
  export const ToastTitle = uic(ToastPrimitives.Title, {
41
43
  baseClass: 'text-sm font-semibold',
42
44
  displayName: 'ToastTitle',
@@ -48,7 +50,8 @@ export const ToastDescription = uic(ToastPrimitives.Description, {
48
50
  })
49
51
 
50
52
  export const Toast = uic(ToastPrimitives.Root, {
51
- baseClass: 'group mt-2 pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-r-md border border-l-4 border-gray-200 bg-background text-foreground shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
53
+ baseClass:
54
+ 'group mt-2 pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-r-md border border-l-4 border-gray-200 bg-background text-foreground shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
52
55
  variants: {
53
56
  variant: {
54
57
  info: 'border-l-blue-500',
@@ -69,18 +72,17 @@ export const Toast = uic(ToastPrimitives.Root, {
69
72
  })
70
73
 
71
74
  const ToastClose = uic(ToastPrimitives.Close, {
72
- baseClass: 'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
75
+ baseClass:
76
+ 'absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
73
77
  displayName: 'ToastClose',
74
78
  beforeChildren: <X className="h-4 w-4" />,
75
79
  })
76
80
 
77
-
78
81
  const ToastViewport = uic(ToastPrimitives.Viewport, {
79
82
  baseClass: 'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
80
83
  displayName: 'ToastViewport',
81
84
  })
82
85
 
83
-
84
86
  export function Toaster({ children }: {
85
87
  children: ReactNode
86
88
  }) {
@@ -78,7 +78,6 @@ export const ToasterProvider = ({ children }: {
78
78
  setTimeout(dismiss, dismissMs)
79
79
  }
80
80
 
81
-
82
81
  return {
83
82
  dismiss,
84
83
  updateContent: content => {
@@ -14,12 +14,14 @@ export const AlertDialogTrigger = AlertDialogPrimitive.Trigger
14
14
  export const AlertDialogPortal = AlertDialogPrimitive.Portal
15
15
 
16
16
  export const AlertDialogOverlay = uic(AlertDialogPrimitive.Overlay, {
17
- baseClass: 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
17
+ baseClass:
18
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
18
19
  displayName: 'AlertDialogOverlay',
19
20
  })
20
21
 
21
22
  export const AlertDialogContent = uic(AlertDialogPrimitive.Content, {
22
- baseClass: 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
23
+ baseClass:
24
+ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
23
25
  wrapOuter: props => {
24
26
  return (
25
27
  <AlertDialogPortal>
@@ -46,7 +48,6 @@ export const AlertDialogTitle = uic(AlertDialogPrimitive.Title, {
46
48
  displayName: 'AlertDialogTitle',
47
49
  })
48
50
 
49
-
50
51
  export const AlertDialogDescription = uic(AlertDialogPrimitive.Description, {
51
52
  baseClass: 'text-sm text-muted-foreground',
52
53
  displayName: 'AlertDialogDescription',
@@ -1,7 +1,8 @@
1
1
  import { uic, uiconfig } from '../utils'
2
2
 
3
3
  export const buttonConfig = uiconfig({
4
- baseClass: 'inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 transition-all',
4
+ baseClass:
5
+ 'inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 transition-all',
5
6
  variants: {
6
7
  variant: {
7
8
  default: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',
@@ -13,24 +13,28 @@ export const DialogPortal = DialogPrimitive.Portal
13
13
  export const DialogClose = DialogPrimitive.Close
14
14
 
15
15
  export const DialogOverlay = uic(DialogPrimitive.DialogOverlay, {
16
- baseClass: 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
16
+ baseClass:
17
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
17
18
  displayName: 'DialogOverlay',
18
19
  })
19
20
 
20
21
  export const DialogContent = uic(DialogPrimitive.Content, {
21
- baseClass: 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
22
+ baseClass:
23
+ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
22
24
  wrapOuter: props => (
23
25
  <DialogPortal>
24
26
  <DialogOverlay />
25
27
  {props.children}
26
28
  </DialogPortal>
27
29
  ),
28
- afterChildren: <>
29
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
30
- <XIcon className="h-4 w-4" />
31
- <span className="sr-only">Close</span>
32
- </DialogPrimitive.Close>
33
- </>,
30
+ afterChildren: (
31
+ <>
32
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
33
+ <XIcon className="h-4 w-4" />
34
+ <span className="sr-only">Close</span>
35
+ </DialogPrimitive.Close>
36
+ </>
37
+ ),
34
38
  })
35
39
 
36
40
  export const DialogHeader = uic('div', {
@@ -21,33 +21,34 @@ export const DropdownMenuSub = DropdownMenuPrimitive.Sub
21
21
 
22
22
  export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
23
23
 
24
-
25
24
  export const DropdownMenuSubTrigger = uic(DropdownMenuPrimitive.SubTrigger, {
26
25
  baseClass: 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent',
27
- beforeChildren: (
28
- <ChevronRight className="ml-auto h-4 w-4" />
29
- ),
26
+ beforeChildren: <ChevronRight className="ml-auto h-4 w-4" />,
30
27
  displayName: 'DropdownMenuSubTrigger',
31
28
  })
32
29
 
33
30
  export const DropdownMenuSubContent = uic(DropdownMenuPrimitive.SubContent, {
34
- baseClass: 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
31
+ baseClass:
32
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
35
33
  displayName: 'DropdownMenuSubContent',
36
34
  })
37
35
 
38
36
  export const DropdownMenuContent = uic(DropdownMenuPrimitive.DropdownMenuContent, {
39
37
  wrapOuter: ({ children }) => <DropdownMenuPrimitive.Portal>{children}</DropdownMenuPrimitive.Portal>,
40
- baseClass: 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
38
+ baseClass:
39
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
41
40
  displayName: 'DropdownMenuContent',
42
41
  })
43
42
 
44
43
  export const DropdownMenuItem = uic(DropdownMenuPrimitive.Item, {
45
- baseClass: 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
44
+ baseClass:
45
+ 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
46
46
  displayName: 'DropdownMenuItem',
47
47
  })
48
48
 
49
49
  export const DropdownMenuCheckboxItem = uic(DropdownMenuPrimitive.CheckboxItem, {
50
- baseClass: 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
50
+ baseClass:
51
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
51
52
  beforeChildren: (
52
53
  <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
53
54
  <DropdownMenuPrimitive.ItemIndicator>
@@ -59,7 +60,8 @@ export const DropdownMenuCheckboxItem = uic(DropdownMenuPrimitive.CheckboxItem,
59
60
  })
60
61
 
61
62
  export const DropdownMenuRadioItem = uic(DropdownMenuPrimitive.RadioItem, {
62
- baseClass: 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
63
+ baseClass:
64
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
63
65
  beforeChildren: (
64
66
  <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
65
67
  <DropdownMenuPrimitive.ItemIndicator>
@@ -70,7 +72,6 @@ export const DropdownMenuRadioItem = uic(DropdownMenuPrimitive.RadioItem, {
70
72
  displayName: 'DropdownMenuRadioItem',
71
73
  })
72
74
 
73
-
74
75
  export const DropdownMenuLabel = uic(DropdownMenuPrimitive.Label, {
75
76
  baseClass: 'px-2 py-1.5 text-sm font-semibold',
76
77
  displayName: 'DropdownMenuLabel',
@@ -93,10 +94,12 @@ export const DropDownTriggerButton = uic('button', {
93
94
  variant: 'ghost',
94
95
  },
95
96
  displayName: 'DropDownTriggerButton',
96
- beforeChildren: <>
97
- <MoreHorizontalIcon className="h-4 w-4" />
98
- <span className="sr-only">Open menu</span>
99
- </>,
97
+ beforeChildren: (
98
+ <>
99
+ <MoreHorizontalIcon className="h-4 w-4" />
100
+ <span className="sr-only">Open menu</span>
101
+ </>
102
+ ),
100
103
  })
101
104
 
102
105
  export const DefaultDropdown = ({ children }: { children: ReactNode }) => (
@@ -21,7 +21,7 @@ export const LoaderIcon = uic(Loader2Icon, {
21
21
  },
22
22
  })
23
23
 
24
- export const Loader = ({ size, ...props }: LoaderProps) => {
24
+ export const Loader = ({ size, ...props }: LoaderProps) => {
25
25
  return (
26
26
  <Overlay {...props}>
27
27
  <LoaderIcon size={size} />
@@ -1,10 +1,4 @@
1
- import {
2
- Link,
3
- type RoleCondition,
4
- type RoutingLinkTarget,
5
- useCurrentRequest,
6
- useProjectUserRoles,
7
- } from '@contember/interface'
1
+ import { Link, type RoleCondition, type RoutingLinkTarget, useCurrentRequest, useProjectUserRoles } from '@contember/interface'
8
2
  import { createContext } from '@contember/react-utils'
9
3
  import { VariantProps } from 'class-variance-authority'
10
4
  import { ChevronRight } from 'lucide-react'
@@ -55,7 +49,7 @@ const useHasActiveChild = (children: ReactNode) => {
55
49
  const checkChild = (child: ReactNode): boolean => {
56
50
  if (!isValidElement(child)) return false
57
51
 
58
- const { to, children: grandChildren } = child.props
52
+ const { to, children: grandChildren } = child.props as Record<string, any>
59
53
 
60
54
  if (to && isMatchingPage(to)) return true
61
55
 
@@ -110,9 +104,7 @@ export const MenuItem = ({ icon, label, to, children, role, expandedByDefault, .
110
104
  <SidebarMenuButton isActive={isActive} tooltip={label} {...menuButtonProps}>
111
105
  {icon}
112
106
  <span>{label}</span>
113
- {hasChildren && (
114
- <ChevronRight className="ml-auto transition-transform duration-200" />
115
- )}
107
+ {hasChildren && <ChevronRight className="ml-auto transition-transform duration-200" />}
116
108
  </SidebarMenuButton>
117
109
  </CollapsibleTrigger>
118
110
  {hasChildren && (
@@ -8,7 +8,7 @@ export interface OverlayProps {
8
8
  showImmediately?: boolean
9
9
  }
10
10
 
11
- export const Overlay = ({ position = 'fixed', className, children, showImmediately }: OverlayProps) => {
11
+ export const Overlay = ({ position = 'fixed', className, children, showImmediately }: OverlayProps) => {
12
12
  const [show, setShow] = React.useState(showImmediately ?? false)
13
13
  React.useEffect(() => {
14
14
  requestAnimationFrame(() => {
@@ -17,14 +17,16 @@ export const Overlay = ({ position = 'fixed', className, children, showImmediat
17
17
  }, [])
18
18
 
19
19
  return (
20
- <div className={cn(
21
- 'z-50 bg-background/50 backdrop-blur-xs transition-all duration-300 delay-200',
22
- show ? 'opacity-100' : 'opacity-0',
23
- position === 'fixed' && 'w-full h-full fixed top-0 left-0',
24
- position === 'absolute' && 'w-full h-full absolute top-0 left-0',
25
- position === 'static' && '',
26
- className,
27
- )}>
20
+ <div
21
+ className={cn(
22
+ 'z-50 bg-background/50 backdrop-blur-xs transition-all duration-300 delay-200',
23
+ show ? 'opacity-100' : 'opacity-0',
24
+ position === 'fixed' && 'w-full h-full fixed top-0 left-0',
25
+ position === 'absolute' && 'w-full h-full absolute top-0 left-0',
26
+ position === 'static' && '',
27
+ className,
28
+ )}
29
+ >
28
30
  <div className="flex justify-center items-center h-full w-full">
29
31
  {children}
30
32
  </div>
@@ -29,4 +29,4 @@ const PopoverContent = React.forwardRef<
29
29
  ))
30
30
  PopoverContent.displayName = PopoverPrimitive.Content.displayName
31
31
 
32
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
32
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger }
@@ -23,11 +23,11 @@ export const PropertyValue = uic('div', {
23
23
  /**
24
24
  * Shortcut for creating a property list item with a label and a value.
25
25
  */
26
- export const PropertyItem = (({ label, children }: { label: string; children: ReactNode }) => {
26
+ export const PropertyItem = ({ label, children }: { label: string; children: ReactNode }) => {
27
27
  return (
28
28
  <PropertyRow>
29
29
  <PropertyLabel>{label}</PropertyLabel>
30
30
  <PropertyValue>{children}</PropertyValue>
31
31
  </PropertyRow>
32
32
  )
33
- })
33
+ }
@@ -3,8 +3,8 @@ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'
3
3
  import { cn } from '../utils'
4
4
 
5
5
  const ScrollArea = React.forwardRef<
6
- React.ElementRef<typeof ScrollAreaPrimitive.Root>,
7
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
6
+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,
7
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
8
8
  >(({ className, children, ...props }, ref) => (
9
9
  <ScrollAreaPrimitive.Root
10
10
  ref={ref}
@@ -14,30 +14,30 @@ const ScrollArea = React.forwardRef<
14
14
  <ScrollAreaPrimitive.Viewport className={cn('h-full w-full rounded-[inherit]', className)}>
15
15
  {children}
16
16
  </ScrollAreaPrimitive.Viewport>
17
- <ScrollBar/>
18
- <ScrollAreaPrimitive.Corner/>
17
+ <ScrollBar />
18
+ <ScrollAreaPrimitive.Corner />
19
19
  </ScrollAreaPrimitive.Root>
20
20
  ))
21
21
  ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
22
22
 
23
23
  const ScrollBar = React.forwardRef<
24
- React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
25
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
24
+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
25
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
26
26
  >(({ className, orientation = 'vertical', ...props }, ref) => (
27
27
  <ScrollAreaPrimitive.ScrollAreaScrollbar
28
28
  ref={ref}
29
29
  orientation={orientation}
30
30
  className={cn(
31
31
  'flex touch-none select-none transition-colors',
32
- orientation === 'vertical' &&
33
- 'h-full w-2.5 border-l border-l-transparent p-[1px]',
34
- orientation === 'horizontal' &&
35
- 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
32
+ orientation === 'vertical'
33
+ && 'h-full w-2.5 border-l border-l-transparent p-[1px]',
34
+ orientation === 'horizontal'
35
+ && 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
36
36
  className,
37
37
  )}
38
38
  {...props}
39
39
  >
40
- <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border"/>
40
+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
41
41
  </ScrollAreaPrimitive.ScrollAreaScrollbar>
42
42
  ))
43
43
  ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
@@ -38,8 +38,7 @@ export const SelectContent = uic(SelectPrimitive.Content, {
38
38
  displayName: SelectPrimitive.Content.displayName,
39
39
  variants: {
40
40
  position: {
41
- popper:
42
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
41
+ popper: 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
43
42
  },
44
43
  },
45
44
  defaultVariants: {
@@ -13,17 +13,20 @@ export const SheetClose = SheetPrimitive.Close
13
13
  export const SheetPortal = SheetPrimitive.Portal
14
14
 
15
15
  export const SheetOverlay = uic(SheetPrimitive.Overlay, {
16
- baseClass: 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
16
+ baseClass:
17
+ 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
17
18
  displayName: 'SheetOverlay',
18
19
  })
19
20
 
20
21
  export const SheetContent = uic(SheetPrimitive.Content, {
21
- baseClass: 'fixed z-50 gap-4 bg-background p-6 shadow-lg overflow-auto transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
22
+ baseClass:
23
+ 'fixed z-50 gap-4 bg-background p-6 shadow-lg overflow-auto transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
22
24
  variants: {
23
25
  side: {
24
26
  top: 'inset-x-0 top-0 border-b border-gray-200 data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
25
27
  bottom: 'inset-x-0 bottom-0 border-t border-gray-200 data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
26
- left: 'inset-y-0 left-0 h-full w-3/4 border-r border-gray-200 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
28
+ left:
29
+ 'inset-y-0 left-0 h-full w-3/4 border-r border-gray-200 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
27
30
  right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
28
31
  },
29
32
  },
@@ -43,13 +46,11 @@ export const SheetContent = uic(SheetPrimitive.Content, {
43
46
  ),
44
47
  })
45
48
 
46
-
47
49
  export const SheetHeader = uic('div', {
48
50
  baseClass: 'flex flex-col space-y-2 text-center sm:text-left',
49
51
  displayName: 'SheetHeader',
50
52
  })
51
53
 
52
-
53
54
  export const SheetFooter = uic('div', {
54
55
  baseClass: 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
55
56
  displayName: 'SheetFooter',