@dloizides/ui-feedback 1.19.1 → 1.20.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/index.mjs CHANGED
@@ -152,8 +152,8 @@ var MONO_FONT = Platform.select({
152
152
  default: "monospace"
153
153
  });
154
154
  var styles = StyleSheet.create({
155
- row: { flexDirection: "row", alignItems: "center", maxWidth: "100%" },
156
- reference: { flexDirection: "row", flexWrap: "wrap", flexShrink: 1, alignItems: "center", columnGap: ROW_GAP },
155
+ row: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: ROW_GAP },
156
+ idLine: { flexDirection: "row", alignItems: "center", columnGap: ROW_GAP },
157
157
  label: { fontSize: REFERENCE_FONT_SIZE },
158
158
  id: { fontSize: REFERENCE_FONT_SIZE, fontFamily: MONO_FONT },
159
159
  copy: {
@@ -176,22 +176,22 @@ var Reference = ({ traceId, color, actionColor, testID, style }) => {
176
176
  const { status, copy } = useCopyToClipboard(traceId);
177
177
  const copyLabel = t(STATUS_KEY[status]);
178
178
  return /* @__PURE__ */ jsxs(View, { style: [styles.row, style], testID, children: [
179
- /* @__PURE__ */ jsxs(View, { style: styles.reference, children: [
180
- /* @__PURE__ */ jsx(Text, { style: [styles.label, { color }], children: t("common.errorReference") }),
181
- /* @__PURE__ */ jsx(Text, { selectable: true, style: [styles.id, { color }], testID: `${testID}-id`, children: traceId })
182
- ] }),
183
- /* @__PURE__ */ jsx(
184
- TouchableOpacity,
185
- {
186
- accessibilityHint: t("common.copyHint"),
187
- accessibilityLabel: copyLabel,
188
- accessibilityRole: "button",
189
- style: styles.copy,
190
- testID: `${testID}-copy`,
191
- onPress: copy,
192
- children: /* @__PURE__ */ jsx(Text, { style: [styles.copyText, { color: actionColor }], children: copyLabel })
193
- }
194
- )
179
+ /* @__PURE__ */ jsx(Text, { style: [styles.label, { color }], children: t("common.errorReference") }),
180
+ /* @__PURE__ */ jsxs(View, { style: styles.idLine, children: [
181
+ /* @__PURE__ */ jsx(Text, { selectable: true, style: [styles.id, { color }], testID: `${testID}-id`, children: traceId }),
182
+ /* @__PURE__ */ jsx(
183
+ TouchableOpacity,
184
+ {
185
+ accessibilityHint: t("common.copyHint"),
186
+ accessibilityLabel: copyLabel,
187
+ accessibilityRole: "button",
188
+ style: styles.copy,
189
+ testID: `${testID}-copy`,
190
+ onPress: copy,
191
+ children: /* @__PURE__ */ jsx(Text, { style: [styles.copyText, { color: actionColor }], children: copyLabel })
192
+ }
193
+ )
194
+ ] })
195
195
  ] });
196
196
  };
197
197
  var ErrorReferenceRow = (props) => props.traceId === void 0 ? null : /* @__PURE__ */ jsx(Reference, { ...props, traceId: props.traceId });
@@ -761,11 +761,13 @@ var TOAST_TOP_WEB = APP_HEADER_HEIGHT + HEADER_GAP;
761
761
  var GLYPHS = {
762
762
  success: "\u2713",
763
763
  error: "!",
764
- info: "i"
764
+ info: "i",
765
+ warning: "\u25B2"
765
766
  };
766
767
  function scaleFor(theme, type) {
767
768
  if (type === "error") return theme.semantic.error;
768
769
  if (type === "success") return theme.semantic.success ?? theme.palette.primary;
770
+ if (type === "warning") return theme.semantic.warning ?? theme.palette.primary;
769
771
  return theme.palette.primary;
770
772
  }
771
773
  function readableInk(fill) {
@@ -917,7 +919,8 @@ var ToastHost = ({
917
919
  () => ({
918
920
  success: resolveToastTone(theme, "success"),
919
921
  error: resolveToastTone(theme, "error"),
920
- info: resolveToastTone(theme, "info")
922
+ info: resolveToastTone(theme, "info"),
923
+ warning: resolveToastTone(theme, "warning")
921
924
  }),
922
925
  [theme]
923
926
  );
@@ -1106,6 +1109,9 @@ function createToastBus() {
1106
1109
  },
1107
1110
  info(text) {
1108
1111
  emit2(text, "info");
1112
+ },
1113
+ warning(text) {
1114
+ emit2(text, "warning");
1109
1115
  }
1110
1116
  };
1111
1117
  }