@orsetra/shared-ui 1.10.29 → 1.10.31

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.
@@ -21,10 +21,15 @@ interface SecretInputProps {
21
21
  exclude?: string[]
22
22
  }
23
23
 
24
- function Notice({ children }: { children: React.ReactNode }) {
24
+ const NOTICE_TONES = {
25
+ neutral: { box: "border-ibm-gray-30 bg-ibm-gray-10 text-ibm-gray-70", icon: "text-ibm-gray-60" },
26
+ warning: { box: "border-ibm-orange-60 bg-ibm-orange-10 text-ibm-orange-70", icon: "text-ibm-orange-60" },
27
+ }
28
+
29
+ function Notice({ children, tone = "neutral" }: { children: React.ReactNode; tone?: keyof typeof NOTICE_TONES }) {
25
30
  return (
26
- <div className="flex items-start gap-2 border border-ibm-gray-30 bg-ibm-gray-10 px-3 py-2 text-xs text-ibm-gray-70">
27
- <AlertTriangle className="h-3.5 w-3.5 mt-0.5 flex-shrink-0 text-ibm-gray-60" />
31
+ <div className={`flex items-start gap-2 border px-3 py-2 text-xs ${NOTICE_TONES[tone].box}`}>
32
+ <AlertTriangle className={`h-3.5 w-3.5 mt-0.5 flex-shrink-0 ${NOTICE_TONES[tone].icon}`} />
28
33
  <div className="min-w-0 space-y-1.5">{children}</div>
29
34
  </div>
30
35
  )
@@ -107,12 +112,12 @@ export function SecretInput({
107
112
  </div>
108
113
 
109
114
  {selectedElsewhere && !selectedUndistributed && (
110
- <Notice><p>The configuration selected no longer exists, or is of another kind. Select another one.</p></Notice>
115
+ <Notice tone="warning"><p>The configuration selected no longer exists, or is of another kind. Select another one.</p></Notice>
111
116
  )}
112
117
 
113
118
  {!loading && undistributed.length > 0 && (
114
- <Notice>
115
- <p>
119
+ <Notice tone="warning">
120
+ <p className="font-medium">
116
121
  {undistributed.length === 1 ? "One configuration is" : `${undistributed.length} configurations are`} not available in {environmentLabel} yet.
117
122
  </p>
118
123
  <ul className="space-y-1">
@@ -41,6 +41,13 @@ interface SidePanelProps {
41
41
  onClose?: () => void
42
42
  }
43
43
 
44
+ /**
45
+ * A panel is as wide as the screen up to the width asked for, and never as wide as what it
46
+ * happens to hold. Asked only for a largest width — "max-w-2xl" — it used to take the width
47
+ * of its content, and so changed size from one step of a form to the next.
48
+ */
49
+ const PANEL_WIDTH = "w-full max-w-full"
50
+
44
51
  const SidePanel = ({
45
52
  open,
46
53
  onOpenChange,
@@ -64,12 +71,13 @@ const SidePanel = ({
64
71
  "inset-y-0 right-0 h-full border-l border-ui-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
65
72
  side === "left" &&
66
73
  "inset-y-0 left-0 h-full border-r border-ui-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
74
+ PANEL_WIDTH,
67
75
  width
68
76
  )}
69
77
  >
70
78
  {/* Header fixe */}
71
- <div className="flex items-center justify-between px-4 md:px-6 py-3 md:py-4 flex-shrink-0 border-b border-ui-border">
72
- <div className="flex-1">
79
+ <div className="flex flex-wrap items-center justify-between gap-y-2 px-4 md:px-6 py-3 md:py-4 flex-shrink-0 border-b border-ui-border">
80
+ <div className="flex-1 min-w-0">
73
81
  <DialogPrimitive.Title className="text-base md:text-lg font-semibold text-ibm-gray-100">
74
82
  {title}
75
83
  </DialogPrimitive.Title>
@@ -94,12 +102,12 @@ const SidePanel = ({
94
102
  </div>
95
103
 
96
104
  {/* Body scrollable */}
97
- <div className="flex-1 overflow-y-auto px-4 md:px-6 py-4 md:py-6">
105
+ <div className="flex-1 min-h-0 min-w-0 overflow-y-auto overflow-x-auto px-4 md:px-6 py-4 md:py-6">
98
106
  {children}
99
107
  </div>
100
108
 
101
109
  {/* Footer fixe */}
102
- <div className="flex items-center justify-end gap-3 px-4 md:px-6 py-3 md:py-4 flex-shrink-0 border-t border-ui-border">
110
+ <div className="flex flex-wrap items-center justify-end gap-3 px-4 md:px-6 py-3 md:py-4 flex-shrink-0 border-t border-ui-border">
103
111
  {actions}
104
112
  </div>
105
113
  </DialogPrimitive.Content>
@@ -129,6 +137,7 @@ const SidePanelContent = React.forwardRef<
129
137
  "inset-y-0 right-0 h-full border-l border-ui-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
130
138
  side === "left" &&
131
139
  "inset-y-0 left-0 h-full border-r border-ui-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
140
+ PANEL_WIDTH,
132
141
  width,
133
142
  className
134
143
  )}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orsetra/shared-ui",
3
- "version": "1.10.29",
3
+ "version": "1.10.31",
4
4
  "description": "Shared UI components for Orsetra platform",
5
5
  "main": "./index.ts",
6
6
  "types": "./index.ts",