@orsetra/shared-ui 1.18.2 → 1.18.4
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.
|
@@ -19,9 +19,9 @@ export function BusinessUnitSwitcher() {
|
|
|
19
19
|
type="button"
|
|
20
20
|
onClick={() => openBusinessUnitSwitcher()}
|
|
21
21
|
disabled={loading}
|
|
22
|
-
title="Change business unit"
|
|
22
|
+
title={label ? `${label}: change business unit` : "Change business unit"}
|
|
23
23
|
aria-haspopup="dialog"
|
|
24
|
-
className="h-8
|
|
24
|
+
className="h-8 w-36 flex-shrink-0 flex items-center justify-between gap-1.5 px-2 bg-transparent text-text-primary hover:bg-ui-background transition-colors disabled:cursor-default"
|
|
25
25
|
>
|
|
26
26
|
{loading ? (
|
|
27
27
|
<span className="h-2.5 w-20 bg-gray-300 animate-pulse" aria-label="Loading business unit" />
|
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
} from "./select"
|
|
21
21
|
import { Loader2, FolderKanban } from "lucide-react"
|
|
22
22
|
|
|
23
|
+
/** The name of a business unit has at most 12 characters; the auth-server API of the platform enforces it. */
|
|
24
|
+
const BUSINESS_UNIT_NAME_MAX_LENGTH = 12
|
|
25
|
+
|
|
23
26
|
export interface Project {
|
|
24
27
|
id: string
|
|
25
28
|
name: string
|
|
@@ -183,9 +186,13 @@ export function ProjectSelectorModal({
|
|
|
183
186
|
placeholder="Enter business unit name"
|
|
184
187
|
value={newProjectName}
|
|
185
188
|
onChange={(e) => setNewProjectName(e.target.value)}
|
|
189
|
+
maxLength={BUSINESS_UNIT_NAME_MAX_LENGTH}
|
|
186
190
|
className="rounded-none"
|
|
187
191
|
autoFocus
|
|
188
192
|
/>
|
|
193
|
+
<p className="text-xs text-ibm-gray-50 text-right">
|
|
194
|
+
{newProjectName.length}/{BUSINESS_UNIT_NAME_MAX_LENGTH}
|
|
195
|
+
</p>
|
|
189
196
|
<p className="text-xs text-ibm-gray-60">
|
|
190
197
|
No business units found. Create your first one to continue.
|
|
191
198
|
</p>
|