@uniformdev/design-system 19.10.0 → 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
@@ -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);
@@ -14340,6 +14341,7 @@ var inputIconBtn = css61`
14340
14341
  align-items: center;
14341
14342
  border: none;
14342
14343
  border-radius: var(--rounded-base);
14344
+ color: var(--gray-500);
14343
14345
  background: none;
14344
14346
  display: flex;
14345
14347
  padding: var(--spacing-2xs);
@@ -14399,17 +14401,17 @@ var ParameterShellContext = createContext5({
14399
14401
  label: "",
14400
14402
  hiddenLabel: void 0,
14401
14403
  errorMessage: void 0,
14402
- onManuallySetErrorMessage: () => {
14404
+ handleManuallySetErrorMessage: () => {
14403
14405
  }
14404
14406
  });
14405
14407
  var useParameterShell = () => {
14406
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useContext6(ParameterShellContext);
14408
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useContext6(ParameterShellContext);
14407
14409
  return {
14408
14410
  id,
14409
14411
  label,
14410
14412
  hiddenLabel,
14411
14413
  errorMessage,
14412
- onManuallySetErrorMessage
14414
+ handleManuallySetErrorMessage
14413
14415
  };
14414
14416
  };
14415
14417
 
@@ -14494,7 +14496,7 @@ var inputIcon2 = css62`
14494
14496
  background: var(--white);
14495
14497
  border-radius: var(--rounded-md) 0 0 var(--rounded-md);
14496
14498
  border-right: 1px solid var(--gray-100);
14497
- color: var(--gray-300);
14499
+ color: var(--gray-500);
14498
14500
  display: flex;
14499
14501
  justify-content: center;
14500
14502
  transition: background var(--duration-fast) var(--timing-ease-out);
@@ -14856,7 +14858,7 @@ var extractParameterProps = (props) => {
14856
14858
  hiddenLabel,
14857
14859
  labelLeadingIcon,
14858
14860
  menuItems,
14859
- onManuallySetErrorMessage,
14861
+ handleManuallySetErrorMessage,
14860
14862
  title,
14861
14863
  hasOverriddenValue,
14862
14864
  onResetOverriddenValue,
@@ -14875,7 +14877,7 @@ var extractParameterProps = (props) => {
14875
14877
  hiddenLabel,
14876
14878
  labelLeadingIcon,
14877
14879
  menuItems,
14878
- onManuallySetErrorMessage,
14880
+ handleManuallySetErrorMessage,
14879
14881
  title,
14880
14882
  hasOverriddenValue,
14881
14883
  onResetOverriddenValue
@@ -14923,7 +14925,7 @@ var ParameterShell = ({
14923
14925
  label,
14924
14926
  hiddenLabel,
14925
14927
  errorMessage: errorMessaging,
14926
- onManuallySetErrorMessage: (message) => setErrorMessage(message)
14928
+ handleManuallySetErrorMessage: (message) => setErrorMessage(message)
14927
14929
  },
14928
14930
  children: /* @__PURE__ */ jsxs54(ParameterShellPlaceholder, { children: [
14929
14931
  children,
@@ -14953,6 +14955,7 @@ var BrokenImage = ({ ...props }) => {
14953
14955
  return /* @__PURE__ */ jsxs55(
14954
14956
  "svg",
14955
14957
  {
14958
+ role: "img",
14956
14959
  width: "214",
14957
14960
  height: "214",
14958
14961
  viewBox: "0 0 214 214",
@@ -14982,24 +14985,31 @@ var BrokenImage = ({ ...props }) => {
14982
14985
  var ParameterImageInner = forwardRef10(
14983
14986
  ({ ...props }, ref) => {
14984
14987
  const { value } = props;
14985
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useParameterShell();
14988
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useParameterShell();
14986
14989
  const [loading, setLoading] = useState8(false);
14987
14990
  const deferredValue = useDeferredValue(value);
14988
14991
  const errorText = "The text you provided is not a valid URL";
14989
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
+ );
14990
14997
  let message = void 0;
14991
14998
  try {
14992
14999
  if (value !== "") {
14993
- 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
+ }
14994
15004
  }
14995
15005
  message = void 0;
14996
15006
  } catch (e) {
14997
15007
  message = errorText;
14998
15008
  }
14999
- if (onManuallySetErrorMessage) {
15000
- onManuallySetErrorMessage(message);
15009
+ if (handleManuallySetErrorMessage) {
15010
+ handleManuallySetErrorMessage(message);
15001
15011
  }
15002
- }, [onManuallySetErrorMessage, value]);
15012
+ }, [handleManuallySetErrorMessage, value]);
15003
15013
  const handleLoadEvent = () => {
15004
15014
  if (deferredValue) {
15005
15015
  setLoading(true);
@@ -15010,13 +15020,13 @@ var ParameterImageInner = forwardRef10(
15010
15020
  return () => clearTimeout(timer);
15011
15021
  };
15012
15022
  const handleErrorEvent = () => {
15013
- if (onManuallySetErrorMessage) {
15014
- onManuallySetErrorMessage(errorText);
15023
+ if (handleManuallySetErrorMessage) {
15024
+ handleManuallySetErrorMessage(errorText);
15015
15025
  }
15016
15026
  };
15017
15027
  useEffect9(() => {
15018
15028
  updateImageSrc();
15019
- }, [value]);
15029
+ }, [deferredValue]);
15020
15030
  return /* @__PURE__ */ jsxs55(Fragment11, { children: [
15021
15031
  /* @__PURE__ */ jsx83(
15022
15032
  "input",
@@ -15035,6 +15045,7 @@ var ParameterImageInner = forwardRef10(
15035
15045
  "img",
15036
15046
  {
15037
15047
  src: deferredValue,
15048
+ alt: "image preview",
15038
15049
  css: img,
15039
15050
  onLoad: handleLoadEvent,
15040
15051
  onError: handleErrorEvent,
@@ -15994,13 +16005,13 @@ var StatusBulletSmall = css75`
15994
16005
  var StatusDraft = css75`
15995
16006
  &:before {
15996
16007
  background: var(--white);
15997
- 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);
15998
16009
  }
15999
16010
  `;
16000
16011
  var StatusModified = css75`
16001
16012
  &:before {
16002
- background: linear-gradient(to right, var(--white) 50%, var(--brand-primary-1) 50% 100%);
16003
- 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);
16004
16015
  }
16005
16016
  `;
16006
16017
  var StatusError = css75`
@@ -16011,7 +16022,7 @@ var StatusError = css75`
16011
16022
  `;
16012
16023
  var StatusPublished = css75`
16013
16024
  &:before {
16014
- background: var(--brand-secondary-3);
16025
+ background: var(--primary-action-default);
16015
16026
  }
16016
16027
  `;
16017
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
@@ -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);
@@ -14549,6 +14550,7 @@ var inputIconBtn = import_react77.css`
14549
14550
  align-items: center;
14550
14551
  border: none;
14551
14552
  border-radius: var(--rounded-base);
14553
+ color: var(--gray-500);
14552
14554
  background: none;
14553
14555
  display: flex;
14554
14556
  padding: var(--spacing-2xs);
@@ -14608,17 +14610,17 @@ var ParameterShellContext = (0, import_react78.createContext)({
14608
14610
  label: "",
14609
14611
  hiddenLabel: void 0,
14610
14612
  errorMessage: void 0,
14611
- onManuallySetErrorMessage: () => {
14613
+ handleManuallySetErrorMessage: () => {
14612
14614
  }
14613
14615
  });
14614
14616
  var useParameterShell = () => {
14615
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = (0, import_react78.useContext)(ParameterShellContext);
14617
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = (0, import_react78.useContext)(ParameterShellContext);
14616
14618
  return {
14617
14619
  id,
14618
14620
  label,
14619
14621
  hiddenLabel,
14620
14622
  errorMessage,
14621
- onManuallySetErrorMessage
14623
+ handleManuallySetErrorMessage
14622
14624
  };
14623
14625
  };
14624
14626
 
@@ -14703,7 +14705,7 @@ var inputIcon2 = import_react79.css`
14703
14705
  background: var(--white);
14704
14706
  border-radius: var(--rounded-md) 0 0 var(--rounded-md);
14705
14707
  border-right: 1px solid var(--gray-100);
14706
- color: var(--gray-300);
14708
+ color: var(--gray-500);
14707
14709
  display: flex;
14708
14710
  justify-content: center;
14709
14711
  transition: background var(--duration-fast) var(--timing-ease-out);
@@ -15065,7 +15067,7 @@ var extractParameterProps = (props) => {
15065
15067
  hiddenLabel,
15066
15068
  labelLeadingIcon,
15067
15069
  menuItems,
15068
- onManuallySetErrorMessage,
15070
+ handleManuallySetErrorMessage,
15069
15071
  title,
15070
15072
  hasOverriddenValue,
15071
15073
  onResetOverriddenValue,
@@ -15084,7 +15086,7 @@ var extractParameterProps = (props) => {
15084
15086
  hiddenLabel,
15085
15087
  labelLeadingIcon,
15086
15088
  menuItems,
15087
- onManuallySetErrorMessage,
15089
+ handleManuallySetErrorMessage,
15088
15090
  title,
15089
15091
  hasOverriddenValue,
15090
15092
  onResetOverriddenValue
@@ -15132,7 +15134,7 @@ var ParameterShell = ({
15132
15134
  label,
15133
15135
  hiddenLabel,
15134
15136
  errorMessage: errorMessaging,
15135
- onManuallySetErrorMessage: (message) => setErrorMessage(message)
15137
+ handleManuallySetErrorMessage: (message) => setErrorMessage(message)
15136
15138
  },
15137
15139
  children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(ParameterShellPlaceholder, { children: [
15138
15140
  children,
@@ -15162,6 +15164,7 @@ var BrokenImage = ({ ...props }) => {
15162
15164
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
15163
15165
  "svg",
15164
15166
  {
15167
+ role: "img",
15165
15168
  width: "214",
15166
15169
  height: "214",
15167
15170
  viewBox: "0 0 214 214",
@@ -15191,24 +15194,31 @@ var BrokenImage = ({ ...props }) => {
15191
15194
  var ParameterImageInner = (0, import_react86.forwardRef)(
15192
15195
  ({ ...props }, ref) => {
15193
15196
  const { value } = props;
15194
- const { id, label, hiddenLabel, errorMessage, onManuallySetErrorMessage } = useParameterShell();
15197
+ const { id, label, hiddenLabel, errorMessage, handleManuallySetErrorMessage } = useParameterShell();
15195
15198
  const [loading, setLoading] = (0, import_react86.useState)(false);
15196
15199
  const deferredValue = (0, import_react86.useDeferredValue)(value);
15197
15200
  const errorText = "The text you provided is not a valid URL";
15198
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
+ );
15199
15206
  let message = void 0;
15200
15207
  try {
15201
15208
  if (value !== "") {
15202
- 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
+ }
15203
15213
  }
15204
15214
  message = void 0;
15205
15215
  } catch (e) {
15206
15216
  message = errorText;
15207
15217
  }
15208
- if (onManuallySetErrorMessage) {
15209
- onManuallySetErrorMessage(message);
15218
+ if (handleManuallySetErrorMessage) {
15219
+ handleManuallySetErrorMessage(message);
15210
15220
  }
15211
- }, [onManuallySetErrorMessage, value]);
15221
+ }, [handleManuallySetErrorMessage, value]);
15212
15222
  const handleLoadEvent = () => {
15213
15223
  if (deferredValue) {
15214
15224
  setLoading(true);
@@ -15219,13 +15229,13 @@ var ParameterImageInner = (0, import_react86.forwardRef)(
15219
15229
  return () => clearTimeout(timer);
15220
15230
  };
15221
15231
  const handleErrorEvent = () => {
15222
- if (onManuallySetErrorMessage) {
15223
- onManuallySetErrorMessage(errorText);
15232
+ if (handleManuallySetErrorMessage) {
15233
+ handleManuallySetErrorMessage(errorText);
15224
15234
  }
15225
15235
  };
15226
15236
  (0, import_react86.useEffect)(() => {
15227
15237
  updateImageSrc();
15228
- }, [value]);
15238
+ }, [deferredValue]);
15229
15239
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
15230
15240
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
15231
15241
  "input",
@@ -15244,6 +15254,7 @@ var ParameterImageInner = (0, import_react86.forwardRef)(
15244
15254
  "img",
15245
15255
  {
15246
15256
  src: deferredValue,
15257
+ alt: "image preview",
15247
15258
  css: img,
15248
15259
  onLoad: handleLoadEvent,
15249
15260
  onError: handleErrorEvent,
@@ -16194,13 +16205,13 @@ var StatusBulletSmall = import_react105.css`
16194
16205
  var StatusDraft = import_react105.css`
16195
16206
  &:before {
16196
16207
  background: var(--white);
16197
- 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);
16198
16209
  }
16199
16210
  `;
16200
16211
  var StatusModified = import_react105.css`
16201
16212
  &:before {
16202
- background: linear-gradient(to right, var(--white) 50%, var(--brand-primary-1) 50% 100%);
16203
- 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);
16204
16215
  }
16205
16216
  `;
16206
16217
  var StatusError = import_react105.css`
@@ -16211,7 +16222,7 @@ var StatusError = import_react105.css`
16211
16222
  `;
16212
16223
  var StatusPublished = import_react105.css`
16213
16224
  &:before {
16214
- background: var(--brand-secondary-3);
16225
+ background: var(--primary-action-default);
16215
16226
  }
16216
16227
  `;
16217
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.10.0",
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",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "149f942da715ed802545850283f9b99291829a04"
57
+ "gitHead": "25d492fe923f313b517cbc70d3ff13fdcf97fa34"
58
58
  }