myoperator-ui 0.0.154 → 0.0.155

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 (2) hide show
  1. package/dist/index.js +41 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6844,9 +6844,9 @@ export interface EndpointDetailsProps
6844
6844
  /** Variant determines field layout and visibility */
6845
6845
  variant?: "calling" | "whatsapp";
6846
6846
  /** Base URL for the API endpoint */
6847
- baseUrl: string;
6847
+ baseUrl?: string;
6848
6848
  /** Company ID */
6849
- companyId: string;
6849
+ companyId?: string;
6850
6850
  /** Authentication token (secret in calling variant, visible in whatsapp variant) */
6851
6851
  authToken: string;
6852
6852
  /** Secret key (secret) - only shown in calling variant */
@@ -6928,6 +6928,26 @@ export const EndpointDetails = React.forwardRef<
6928
6928
  onValueCopy?.(field, value);
6929
6929
  };
6930
6930
 
6931
+ // Collect non-secret visible fields for the top rows
6932
+ const topFields: Array<{ label: string; value: string; field: string }> =
6933
+ [];
6934
+ if (baseUrl)
6935
+ topFields.push({ label: "Base URL", value: baseUrl, field: "baseUrl" });
6936
+ if (companyId)
6937
+ topFields.push({
6938
+ label: "Company ID",
6939
+ value: companyId,
6940
+ field: "companyId",
6941
+ });
6942
+ if (isCalling && apiKey)
6943
+ topFields.push({ label: "x-api-key", value: apiKey, field: "apiKey" });
6944
+
6945
+ // Group fields into rows of 2
6946
+ const topRows: Array<typeof topFields> = [];
6947
+ for (let i = 0; i < topFields.length; i += 2) {
6948
+ topRows.push(topFields.slice(i, i + 2));
6949
+ }
6950
+
6931
6951
  return (
6932
6952
  <div
6933
6953
  ref={ref}
@@ -6946,19 +6966,25 @@ export const EndpointDetails = React.forwardRef<
6946
6966
 
6947
6967
  {/* Credentials Grid */}
6948
6968
  <div className="flex flex-col gap-[30px]">
6949
- {/* Row 1: Base URL + Company ID */}
6950
- <div className="grid grid-cols-2 gap-[25px]">
6951
- <ReadableField
6952
- label="Base URL"
6953
- value={baseUrl}
6954
- onValueCopy={handleCopy("baseUrl")}
6955
- />
6956
- <ReadableField
6957
- label="Company ID"
6958
- value={companyId}
6959
- onValueCopy={handleCopy("companyId")}
6960
- />
6961
- </div>
6969
+ {/* Non-secret fields in rows of 2 */}
6970
+ {topRows.map((row, idx) => (
6971
+ <div
6972
+ key={idx}
6973
+ className={cn(
6974
+ "grid gap-[25px]",
6975
+ row.length === 2 ? "grid-cols-2" : "grid-cols-1"
6976
+ )}
6977
+ >
6978
+ {row.map((f) => (
6979
+ <ReadableField
6980
+ key={f.field}
6981
+ label={f.label}
6982
+ value={f.value}
6983
+ onValueCopy={handleCopy(f.field)}
6984
+ />
6985
+ ))}
6986
+ </div>
6987
+ ))}
6962
6988
 
6963
6989
  {/* Authentication field - different based on variant */}
6964
6990
  {isCalling ? (
@@ -6998,15 +7024,6 @@ export const EndpointDetails = React.forwardRef<
6998
7024
  />
6999
7025
  )}
7000
7026
 
7001
- {/* x-api-key (full width) - only for calling variant */}
7002
- {isCalling && apiKey && (
7003
- <ReadableField
7004
- label="x-api-key"
7005
- value={apiKey}
7006
- onValueCopy={handleCopy("apiKey")}
7007
- />
7008
- )}
7009
-
7010
7027
  {/* Revoke Section - only for calling variant */}
7011
7028
  {isCalling && showRevokeSection && (
7012
7029
  <div className="flex items-center justify-between border-t border-semantic-border-layout pt-6">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.154",
3
+ "version": "0.0.155",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",