@uniformdev/design-system 19.9.2-alpha.3 → 19.11.0

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.
package/dist/esm/index.js CHANGED
@@ -36,7 +36,7 @@ var Theme = ({ disableReset = false }) => {
36
36
 
37
37
  /* secondary colours */
38
38
  --brand-secondary-1: #1f2b34; /* carbon */
39
- --brand-secondary-2: #ecf1f1; /* silver */
39
+ --brand-secondary-2: var(--gray-50);
40
40
  --brand-secondary-3: var(--purple-rain-500);
41
41
  --brand-secondary-5: #d9534f; /* brick red */
42
42
 
@@ -130,6 +130,7 @@ var Theme = ({ disableReset = false }) => {
130
130
  --prose: 65ch;
131
131
 
132
132
  /* brand shadow styles */
133
+ --shadow-sm: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
133
134
  --shadow-base: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
134
135
  rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
135
136
  --shadow-md: 0px 4px 4px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
@@ -13362,6 +13363,11 @@ var ScrollableListInner = css48`
13362
13363
  max-height: 24rem;
13363
13364
  overflow-y: auto;
13364
13365
  padding: var(--spacing-sm);
13366
+ /*
13367
+ position: relative prevents an overflow bug where components inside the
13368
+ scrollable list still take up space outside of it in some browsers
13369
+ */
13370
+ position: relative;
13365
13371
 
13366
13372
  > * {
13367
13373
  margin-block: 0 var(--spacing-sm);
@@ -14335,6 +14341,7 @@ var inputIconBtn = css61`
14335
14341
  align-items: center;
14336
14342
  border: none;
14337
14343
  border-radius: var(--rounded-base);
14344
+ color: var(--gray-500);
14338
14345
  background: none;
14339
14346
  display: flex;
14340
14347
  padding: var(--spacing-2xs);
@@ -14394,17 +14401,17 @@ var ParameterShellContext = createContext5({
14394
14401
  label: "",
14395
14402
  hiddenLabel: void 0,
14396
14403
  errorMessage: void 0,
14397
- onManuallySetErrorMessage: () => {
14404
+ handleManuallySetErrorMessage: () => {
14398
14405
  }
14399
14406
  });
14400
14407
  var useParameterShell = () => {
14401
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useContext6(ParameterShellContext);
14408
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useContext6(ParameterShellContext);
14402
14409
  return {
14403
14410
  id,
14404
14411
  label,
14405
14412
  hiddenLabel,
14406
14413
  errorMessage,
14407
- onManuallySetErrorMessage
14414
+ handleManuallySetErrorMessage
14408
14415
  };
14409
14416
  };
14410
14417
 
@@ -14489,7 +14496,7 @@ var inputIcon2 = css62`
14489
14496
  background: var(--white);
14490
14497
  border-radius: var(--rounded-md) 0 0 var(--rounded-md);
14491
14498
  border-right: 1px solid var(--gray-100);
14492
- color: var(--gray-300);
14499
+ color: var(--gray-500);
14493
14500
  display: flex;
14494
14501
  justify-content: center;
14495
14502
  transition: background var(--duration-fast) var(--timing-ease-out);
@@ -14851,7 +14858,7 @@ var extractParameterProps = (props) => {
14851
14858
  hiddenLabel,
14852
14859
  labelLeadingIcon,
14853
14860
  menuItems,
14854
- onManuallySetErrorMessage,
14861
+ handleManuallySetErrorMessage,
14855
14862
  title,
14856
14863
  hasOverriddenValue,
14857
14864
  onResetOverriddenValue,
@@ -14870,7 +14877,7 @@ var extractParameterProps = (props) => {
14870
14877
  hiddenLabel,
14871
14878
  labelLeadingIcon,
14872
14879
  menuItems,
14873
- onManuallySetErrorMessage,
14880
+ handleManuallySetErrorMessage,
14874
14881
  title,
14875
14882
  hasOverriddenValue,
14876
14883
  onResetOverriddenValue
@@ -14918,7 +14925,7 @@ var ParameterShell = ({
14918
14925
  label,
14919
14926
  hiddenLabel,
14920
14927
  errorMessage: errorMessaging,
14921
- onManuallySetErrorMessage: (message) => setErrorMessage(message)
14928
+ handleManuallySetErrorMessage: (message) => setErrorMessage(message)
14922
14929
  },
14923
14930
  children: /* @__PURE__ */ jsxs54(ParameterShellPlaceholder, { children: [
14924
14931
  children,
@@ -14948,6 +14955,7 @@ var BrokenImage = ({ ...props }) => {
14948
14955
  return /* @__PURE__ */ jsxs55(
14949
14956
  "svg",
14950
14957
  {
14958
+ role: "img",
14951
14959
  width: "214",
14952
14960
  height: "214",
14953
14961
  viewBox: "0 0 214 214",
@@ -14977,24 +14985,31 @@ var BrokenImage = ({ ...props }) => {
14977
14985
  var ParameterImageInner = forwardRef10(
14978
14986
  ({ ...props }, ref) => {
14979
14987
  const { value } = props;
14980
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useParameterShell();
14988
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useParameterShell();
14981
14989
  const [loading, setLoading] = useState8(false);
14982
14990
  const deferredValue = useDeferredValue(value);
14983
14991
  const errorText = "The text you provided is not a valid URL";
14984
14992
  const updateImageSrc = useCallback3(() => {
14993
+ const validUrl = new RegExp(
14994
+ "^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$",
14995
+ "i"
14996
+ );
14985
14997
  let message = void 0;
14986
14998
  try {
14987
14999
  if (value !== "") {
14988
- new URL(value);
15000
+ const url = String(value).startsWith("//") ? `${location.protocol}${value}` : String(value);
15001
+ if (!url.match(validUrl) || !url.startsWith("https")) {
15002
+ throw Error(errorText);
15003
+ }
14989
15004
  }
14990
15005
  message = void 0;
14991
15006
  } catch (e) {
14992
15007
  message = errorText;
14993
15008
  }
14994
- if (onManuallySetErrorMessage) {
14995
- onManuallySetErrorMessage(message);
15009
+ if (handleManuallySetErrorMessage) {
15010
+ handleManuallySetErrorMessage(message);
14996
15011
  }
14997
- }, [onManuallySetErrorMessage, value]);
15012
+ }, [handleManuallySetErrorMessage, value]);
14998
15013
  const handleLoadEvent = () => {
14999
15014
  if (deferredValue) {
15000
15015
  setLoading(true);
@@ -15005,13 +15020,13 @@ var ParameterImageInner = forwardRef10(
15005
15020
  return () => clearTimeout(timer);
15006
15021
  };
15007
15022
  const handleErrorEvent = () => {
15008
- if (onManuallySetErrorMessage) {
15009
- onManuallySetErrorMessage(errorText);
15023
+ if (handleManuallySetErrorMessage) {
15024
+ handleManuallySetErrorMessage(errorText);
15010
15025
  }
15011
15026
  };
15012
15027
  useEffect9(() => {
15013
15028
  updateImageSrc();
15014
- }, [value]);
15029
+ }, [deferredValue]);
15015
15030
  return /* @__PURE__ */ jsxs55(Fragment11, { children: [
15016
15031
  /* @__PURE__ */ jsx83(
15017
15032
  "input",
@@ -15030,6 +15045,7 @@ var ParameterImageInner = forwardRef10(
15030
15045
  "img",
15031
15046
  {
15032
15047
  src: deferredValue,
15048
+ alt: "image preview",
15033
15049
  css: img,
15034
15050
  onLoad: handleLoadEvent,
15035
15051
  onError: handleErrorEvent,
@@ -15989,13 +16005,13 @@ var StatusBulletSmall = css75`
15989
16005
  var StatusDraft = css75`
15990
16006
  &:before {
15991
16007
  background: var(--white);
15992
- box-shadow: inset 0 0 0 0.125rem var(--brand-primary-1);
16008
+ box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
15993
16009
  }
15994
16010
  `;
15995
16011
  var StatusModified = css75`
15996
16012
  &:before {
15997
- background: linear-gradient(to right, var(--white) 50%, var(--brand-primary-1) 50% 100%);
15998
- box-shadow: inset 0 0 0 0.125rem var(--brand-primary-1);
16013
+ background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
16014
+ box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
15999
16015
  }
16000
16016
  `;
16001
16017
  var StatusError = css75`
@@ -16006,7 +16022,7 @@ var StatusError = css75`
16006
16022
  `;
16007
16023
  var StatusPublished = css75`
16008
16024
  &:before {
16009
- background: var(--brand-secondary-3);
16025
+ background: var(--primary-action-default);
16010
16026
  }
16011
16027
  `;
16012
16028
  var StatusOrphan = css75`
package/dist/index.d.ts CHANGED
@@ -21279,7 +21279,7 @@ type CommonParameterProps = {
21279
21279
  /** (optional) sets and shows the the info message value */
21280
21280
  infoMessage?: string;
21281
21281
  /** (optional) allows users to manually set the error message state */
21282
- onManuallySetErrorMessage?: (message: string | undefined) => void;
21282
+ handleManuallySetErrorMessage?: (message: string | undefined) => void;
21283
21283
  /** sets whether to show the override UI */
21284
21284
  hasOverriddenValue?: boolean;
21285
21285
  /** sets the function call of the overriding parameters button */
@@ -21315,7 +21315,7 @@ declare const useParameterShell: () => {
21315
21315
  label: string;
21316
21316
  hiddenLabel: boolean | undefined;
21317
21317
  errorMessage: string | undefined;
21318
- onManuallySetErrorMessage: ((message: string | undefined) => void) | undefined;
21318
+ handleManuallySetErrorMessage: ((message: string | undefined) => void) | undefined;
21319
21319
  };
21320
21320
 
21321
21321
  type ParameterDataConnectButtonProps = {
@@ -21520,7 +21520,7 @@ declare const extractParameterProps: <T>(props: T & CommonParameterProps & {
21520
21520
  hiddenLabel: boolean | undefined;
21521
21521
  labelLeadingIcon: ReactNode;
21522
21522
  menuItems: ReactNode;
21523
- onManuallySetErrorMessage: ((message: string | undefined) => void) | undefined;
21523
+ handleManuallySetErrorMessage: ((message: string | undefined) => void) | undefined;
21524
21524
  title: string | undefined;
21525
21525
  hasOverriddenValue: boolean | undefined;
21526
21526
  onResetOverriddenValue: (() => void) | undefined;
@@ -21531,7 +21531,7 @@ declare const extractParameterProps: <T>(props: T & CommonParameterProps & {
21531
21531
  errorTestId?: string | undefined;
21532
21532
  captionTestId?: string | undefined;
21533
21533
  title?: string | undefined;
21534
- }, "caption" | "label" | "title" | "id" | "menuItems" | "errorMessage" | "warningMessage" | "errorTestId" | "captionTestId" | "hiddenLabel" | "onManuallySetErrorMessage" | "labelLeadingIcon" | "infoMessage" | "hasOverriddenValue" | "onResetOverriddenValue">;
21534
+ }, "caption" | "label" | "title" | "id" | "menuItems" | "errorMessage" | "warningMessage" | "errorTestId" | "captionTestId" | "hiddenLabel" | "handleManuallySetErrorMessage" | "labelLeadingIcon" | "infoMessage" | "hasOverriddenValue" | "onResetOverriddenValue">;
21535
21535
  };
21536
21536
  type ParameterShellOverrideProps = {
21537
21537
  /** sets overriding parameters indicator */
@@ -22014,7 +22014,7 @@ declare const LinkWithRef: React$1.ForwardRefExoticComponent<Omit<React$1.Anchor
22014
22014
  }, "ref"> & React$1.RefAttributes<HTMLAnchorElement>>;
22015
22015
 
22016
22016
  interface RouteProps {
22017
- as: string;
22017
+ as?: string;
22018
22018
  href: string;
22019
22019
  }
22020
22020
  type PageHeaderSectionProps = React$1.HTMLAttributes<HTMLElement> & {
package/dist/index.js CHANGED
@@ -254,7 +254,7 @@ var Theme = ({ disableReset = false }) => {
254
254
 
255
255
  /* secondary colours */
256
256
  --brand-secondary-1: #1f2b34; /* carbon */
257
- --brand-secondary-2: #ecf1f1; /* silver */
257
+ --brand-secondary-2: var(--gray-50);
258
258
  --brand-secondary-3: var(--purple-rain-500);
259
259
  --brand-secondary-5: #d9534f; /* brick red */
260
260
 
@@ -348,6 +348,7 @@ var Theme = ({ disableReset = false }) => {
348
348
  --prose: 65ch;
349
349
 
350
350
  /* brand shadow styles */
351
+ --shadow-sm: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
351
352
  --shadow-base: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
352
353
  rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
353
354
  --shadow-md: 0px 4px 4px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
@@ -13576,6 +13577,11 @@ var ScrollableListInner = import_react61.css`
13576
13577
  max-height: 24rem;
13577
13578
  overflow-y: auto;
13578
13579
  padding: var(--spacing-sm);
13580
+ /*
13581
+ position: relative prevents an overflow bug where components inside the
13582
+ scrollable list still take up space outside of it in some browsers
13583
+ */
13584
+ position: relative;
13579
13585
 
13580
13586
  > * {
13581
13587
  margin-block: 0 var(--spacing-sm);
@@ -14544,6 +14550,7 @@ var inputIconBtn = import_react77.css`
14544
14550
  align-items: center;
14545
14551
  border: none;
14546
14552
  border-radius: var(--rounded-base);
14553
+ color: var(--gray-500);
14547
14554
  background: none;
14548
14555
  display: flex;
14549
14556
  padding: var(--spacing-2xs);
@@ -14603,17 +14610,17 @@ var ParameterShellContext = (0, import_react78.createContext)({
14603
14610
  label: "",
14604
14611
  hiddenLabel: void 0,
14605
14612
  errorMessage: void 0,
14606
- onManuallySetErrorMessage: () => {
14613
+ handleManuallySetErrorMessage: () => {
14607
14614
  }
14608
14615
  });
14609
14616
  var useParameterShell = () => {
14610
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = (0, import_react78.useContext)(ParameterShellContext);
14617
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = (0, import_react78.useContext)(ParameterShellContext);
14611
14618
  return {
14612
14619
  id,
14613
14620
  label,
14614
14621
  hiddenLabel,
14615
14622
  errorMessage,
14616
- onManuallySetErrorMessage
14623
+ handleManuallySetErrorMessage
14617
14624
  };
14618
14625
  };
14619
14626
 
@@ -14698,7 +14705,7 @@ var inputIcon2 = import_react79.css`
14698
14705
  background: var(--white);
14699
14706
  border-radius: var(--rounded-md) 0 0 var(--rounded-md);
14700
14707
  border-right: 1px solid var(--gray-100);
14701
- color: var(--gray-300);
14708
+ color: var(--gray-500);
14702
14709
  display: flex;
14703
14710
  justify-content: center;
14704
14711
  transition: background var(--duration-fast) var(--timing-ease-out);
@@ -15060,7 +15067,7 @@ var extractParameterProps = (props) => {
15060
15067
  hiddenLabel,
15061
15068
  labelLeadingIcon,
15062
15069
  menuItems,
15063
- onManuallySetErrorMessage,
15070
+ handleManuallySetErrorMessage,
15064
15071
  title,
15065
15072
  hasOverriddenValue,
15066
15073
  onResetOverriddenValue,
@@ -15079,7 +15086,7 @@ var extractParameterProps = (props) => {
15079
15086
  hiddenLabel,
15080
15087
  labelLeadingIcon,
15081
15088
  menuItems,
15082
- onManuallySetErrorMessage,
15089
+ handleManuallySetErrorMessage,
15083
15090
  title,
15084
15091
  hasOverriddenValue,
15085
15092
  onResetOverriddenValue
@@ -15127,7 +15134,7 @@ var ParameterShell = ({
15127
15134
  label,
15128
15135
  hiddenLabel,
15129
15136
  errorMessage: errorMessaging,
15130
- onManuallySetErrorMessage: (message) => setErrorMessage(message)
15137
+ handleManuallySetErrorMessage: (message) => setErrorMessage(message)
15131
15138
  },
15132
15139
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ParameterShellPlaceholder, { children: [
15133
15140
  children,
@@ -15157,6 +15164,7 @@ var BrokenImage = ({ ...props }) => {
15157
15164
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
15158
15165
  "svg",
15159
15166
  {
15167
+ role: "img",
15160
15168
  width: "214",
15161
15169
  height: "214",
15162
15170
  viewBox: "0 0 214 214",
@@ -15186,24 +15194,31 @@ var BrokenImage = ({ ...props }) => {
15186
15194
  var ParameterImageInner = (0, import_react86.forwardRef)(
15187
15195
  ({ ...props }, ref) => {
15188
15196
  const { value } = props;
15189
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useParameterShell();
15197
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useParameterShell();
15190
15198
  const [loading, setLoading] = (0, import_react86.useState)(false);
15191
15199
  const deferredValue = (0, import_react86.useDeferredValue)(value);
15192
15200
  const errorText = "The text you provided is not a valid URL";
15193
15201
  const updateImageSrc = (0, import_react86.useCallback)(() => {
15202
+ const validUrl = new RegExp(
15203
+ "^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$",
15204
+ "i"
15205
+ );
15194
15206
  let message = void 0;
15195
15207
  try {
15196
15208
  if (value !== "") {
15197
- new URL(value);
15209
+ const url = String(value).startsWith("//") ? `${location.protocol}${value}` : String(value);
15210
+ if (!url.match(validUrl) || !url.startsWith("https")) {
15211
+ throw Error(errorText);
15212
+ }
15198
15213
  }
15199
15214
  message = void 0;
15200
15215
  } catch (e) {
15201
15216
  message = errorText;
15202
15217
  }
15203
- if (onManuallySetErrorMessage) {
15204
- onManuallySetErrorMessage(message);
15218
+ if (handleManuallySetErrorMessage) {
15219
+ handleManuallySetErrorMessage(message);
15205
15220
  }
15206
- }, [onManuallySetErrorMessage, value]);
15221
+ }, [handleManuallySetErrorMessage, value]);
15207
15222
  const handleLoadEvent = () => {
15208
15223
  if (deferredValue) {
15209
15224
  setLoading(true);
@@ -15214,13 +15229,13 @@ var ParameterImageInner = (0, import_react86.forwardRef)(
15214
15229
  return () => clearTimeout(timer);
15215
15230
  };
15216
15231
  const handleErrorEvent = () => {
15217
- if (onManuallySetErrorMessage) {
15218
- onManuallySetErrorMessage(errorText);
15232
+ if (handleManuallySetErrorMessage) {
15233
+ handleManuallySetErrorMessage(errorText);
15219
15234
  }
15220
15235
  };
15221
15236
  (0, import_react86.useEffect)(() => {
15222
15237
  updateImageSrc();
15223
- }, [value]);
15238
+ }, [deferredValue]);
15224
15239
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
15225
15240
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
15226
15241
  "input",
@@ -15239,6 +15254,7 @@ var ParameterImageInner = (0, import_react86.forwardRef)(
15239
15254
  "img",
15240
15255
  {
15241
15256
  src: deferredValue,
15257
+ alt: "image preview",
15242
15258
  css: img,
15243
15259
  onLoad: handleLoadEvent,
15244
15260
  onError: handleErrorEvent,
@@ -16189,13 +16205,13 @@ var StatusBulletSmall = import_react105.css`
16189
16205
  var StatusDraft = import_react105.css`
16190
16206
  &:before {
16191
16207
  background: var(--white);
16192
- box-shadow: inset 0 0 0 0.125rem var(--brand-primary-1);
16208
+ box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
16193
16209
  }
16194
16210
  `;
16195
16211
  var StatusModified = import_react105.css`
16196
16212
  &:before {
16197
- background: linear-gradient(to right, var(--white) 50%, var(--brand-primary-1) 50% 100%);
16198
- box-shadow: inset 0 0 0 0.125rem var(--brand-primary-1);
16213
+ background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
16214
+ box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
16199
16215
  }
16200
16216
  `;
16201
16217
  var StatusError = import_react105.css`
@@ -16206,7 +16222,7 @@ var StatusError = import_react105.css`
16206
16222
  `;
16207
16223
  var StatusPublished = import_react105.css`
16208
16224
  &:before {
16209
- background: var(--brand-secondary-3);
16225
+ background: var(--primary-action-default);
16210
16226
  }
16211
16227
  `;
16212
16228
  var StatusOrphan = import_react105.css`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "19.9.2-alpha.3+547c8b11d",
3
+ "version": "19.11.0",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "react-select": "5.7.3",
43
43
  "react-use": "17.4.0",
44
44
  "reakit": "1.3.11",
45
- "zod-to-json-schema": "3.21.0"
45
+ "zod-to-json-schema": "3.21.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=17 || 17 || 18",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "547c8b11d4655b34250c2fbe3f016c9bc12c3905"
57
+ "gitHead": "25d492fe923f313b517cbc70d3ff13fdcf97fa34"
58
58
  }