@northlight/ui 2.20.0 → 2.21.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.
@@ -990,7 +990,7 @@
990
990
  }
991
991
  return target;
992
992
  };
993
- const H1$1 = (_a) => {
993
+ const H1$1 = React.forwardRef((_a, ref) => {
994
994
  var _b = _a, {
995
995
  children,
996
996
  sx = {}
@@ -1003,11 +1003,12 @@
1003
1003
  react.Heading,
1004
1004
  __spreadValues$23({
1005
1005
  as: "h1",
1006
- sx: styles
1006
+ sx: styles,
1007
+ ref
1007
1008
  }, rest),
1008
1009
  children
1009
1010
  );
1010
- };
1011
+ });
1011
1012
 
1012
1013
  var __defProp$22 = Object.defineProperty;
1013
1014
  var __getOwnPropSymbols$22 = Object.getOwnPropertySymbols;
@@ -1037,7 +1038,7 @@
1037
1038
  }
1038
1039
  return target;
1039
1040
  };
1040
- const H2$1 = (_a) => {
1041
+ const H2$1 = React.forwardRef((_a, ref) => {
1041
1042
  var _b = _a, {
1042
1043
  children,
1043
1044
  sx = {}
@@ -1050,11 +1051,12 @@
1050
1051
  react.Heading,
1051
1052
  __spreadValues$22({
1052
1053
  as: "h2",
1053
- sx: styles
1054
+ sx: styles,
1055
+ ref
1054
1056
  }, rest),
1055
1057
  children
1056
1058
  );
1057
- };
1059
+ });
1058
1060
 
1059
1061
  var __defProp$21 = Object.defineProperty;
1060
1062
  var __getOwnPropSymbols$21 = Object.getOwnPropertySymbols;
@@ -1084,7 +1086,7 @@
1084
1086
  }
1085
1087
  return target;
1086
1088
  };
1087
- const H3$1 = (_a) => {
1089
+ const H3$1 = React.forwardRef((_a, ref) => {
1088
1090
  var _b = _a, {
1089
1091
  children,
1090
1092
  sx = {}
@@ -1097,11 +1099,12 @@
1097
1099
  react.Heading,
1098
1100
  __spreadValues$21({
1099
1101
  as: "h3",
1100
- sx: styles
1102
+ sx: styles,
1103
+ ref
1101
1104
  }, rest),
1102
1105
  children
1103
1106
  );
1104
- };
1107
+ });
1105
1108
 
1106
1109
  var __defProp$20 = Object.defineProperty;
1107
1110
  var __getOwnPropSymbols$20 = Object.getOwnPropertySymbols;
@@ -1131,7 +1134,7 @@
1131
1134
  }
1132
1135
  return target;
1133
1136
  };
1134
- const H4$1 = (_a) => {
1137
+ const H4$1 = React.forwardRef((_a, ref) => {
1135
1138
  var _b = _a, {
1136
1139
  children,
1137
1140
  sx = {}
@@ -1144,11 +1147,12 @@
1144
1147
  react.Heading,
1145
1148
  __spreadValues$20({
1146
1149
  as: "h4",
1147
- sx: styles
1150
+ sx: styles,
1151
+ ref
1148
1152
  }, rest),
1149
1153
  children
1150
1154
  );
1151
- };
1155
+ });
1152
1156
 
1153
1157
  var __defProp$1$ = Object.defineProperty;
1154
1158
  var __getOwnPropSymbols$1$ = Object.getOwnPropertySymbols;
@@ -1178,7 +1182,7 @@
1178
1182
  }
1179
1183
  return target;
1180
1184
  };
1181
- const H5$1 = (_a) => {
1185
+ const H5$1 = React.forwardRef((_a, ref) => {
1182
1186
  var _b = _a, {
1183
1187
  children,
1184
1188
  sx = {}
@@ -1191,11 +1195,12 @@
1191
1195
  react.Heading,
1192
1196
  __spreadValues$1$({
1193
1197
  as: "h5",
1194
- sx: styles
1198
+ sx: styles,
1199
+ ref
1195
1200
  }, rest),
1196
1201
  children
1197
1202
  );
1198
- };
1203
+ });
1199
1204
 
1200
1205
  var __defProp$1_ = Object.defineProperty;
1201
1206
  var __getOwnPropSymbols$1_ = Object.getOwnPropertySymbols;
@@ -1225,7 +1230,7 @@
1225
1230
  }
1226
1231
  return target;
1227
1232
  };
1228
- const H6$1 = (_a) => {
1233
+ const H6$1 = React.forwardRef((_a, ref) => {
1229
1234
  var _b = _a, {
1230
1235
  children,
1231
1236
  sx = {}
@@ -1238,11 +1243,12 @@
1238
1243
  react.Heading,
1239
1244
  __spreadValues$1_({
1240
1245
  as: "h6",
1241
- sx: styles
1246
+ sx: styles,
1247
+ ref
1242
1248
  }, rest),
1243
1249
  children
1244
1250
  );
1245
- };
1251
+ });
1246
1252
 
1247
1253
  var __defProp$1Z = Object.defineProperty;
1248
1254
  var __getOwnPropSymbols$1Z = Object.getOwnPropertySymbols;
@@ -1747,7 +1753,7 @@
1747
1753
  }
1748
1754
  return a;
1749
1755
  };
1750
- const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(react.Badge, __spreadValues$1Q({ ref }, props)));
1756
+ const Badge$1 = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(react.Badge, __spreadValues$1Q({ ref }, props)));
1751
1757
 
1752
1758
  var __defProp$1P = Object.defineProperty;
1753
1759
  var __getOwnPropSymbols$1P = Object.getOwnPropertySymbols;
@@ -3025,6 +3031,7 @@
3025
3031
  variants: {
3026
3032
  default: ({ theme: { colors: color } }) => ({
3027
3033
  bgColor: color.background.button.default,
3034
+ color: color.text.button.default,
3028
3035
  _hover: {
3029
3036
  bgColor: color.background.button["default-hover"]
3030
3037
  },
@@ -3047,6 +3054,7 @@
3047
3054
  }),
3048
3055
  success: ({ theme: { colors: color } }) => ({
3049
3056
  bgColor: color.background.button.success,
3057
+ color: color.text.button.success,
3050
3058
  _hover: {
3051
3059
  bg: color.background.button["success-hover"],
3052
3060
  _disabled: {
@@ -3099,6 +3107,15 @@
3099
3107
  bgColor: color.background.button["link-active"]
3100
3108
  }
3101
3109
  }),
3110
+ outline: ({ theme: { colors: color } }) => ({
3111
+ color: color.text.default,
3112
+ _hover: {
3113
+ bg: color.background.button["ghost-hover"]
3114
+ },
3115
+ _active: {
3116
+ bg: color.background.button["ghost-active"]
3117
+ }
3118
+ }),
3102
3119
  ghost: ({ theme: { colors: color } }) => ({
3103
3120
  color: color.text.default,
3104
3121
  bgColor: color.background.button.ghost,
@@ -3855,16 +3872,16 @@
3855
3872
  }
3856
3873
  },
3857
3874
  variants: {
3858
- solid: ({ bgColor, colorScheme }) => ({
3875
+ solid: ({ theme: { colors }, colorScheme }) => ({
3859
3876
  container: {
3860
- bgColor: bgColor != null ? bgColor : colorScheme,
3861
- color: getContrastColor(bgColor != null ? bgColor : react.useToken("colors", colorScheme))
3877
+ bgColor: colors[colorScheme] && colors[colorScheme][500] ? colors[colorScheme][500] : colorScheme,
3878
+ color: colorScheme === "yellow" ? "mono.black" : "mono.white"
3862
3879
  }
3863
3880
  }),
3864
- subtle: () => ({
3881
+ subtle: ({ theme: { colors }, colorScheme }) => ({
3865
3882
  container: {
3866
- bgColor: react.useToken("colors", "background.tag.subtle"),
3867
- color: "text.default"
3883
+ bgColor: colors[colorScheme] && colors[colorScheme][100] ? colors[colorScheme][100] : colorScheme,
3884
+ color: "mono.black"
3868
3885
  }
3869
3886
  }),
3870
3887
  ai: {
@@ -5610,10 +5627,39 @@
5610
5627
  }
5611
5628
  };
5612
5629
 
5630
+ const Badge = {
5631
+ baseStyle: ({ colorScheme, theme: { colors } }) => {
5632
+ const bgColor = colorScheme === "mediatoolBlue" ? colors[colorScheme][100] : colors[colorScheme] && colors[colorScheme][100];
5633
+ const textColor = colorScheme === "mediatoolBlue" ? colors[colorScheme][800] : colors[colorScheme] && colors[colorScheme][800];
5634
+ return {
5635
+ bgColor,
5636
+ color: textColor
5637
+ };
5638
+ },
5639
+ variants: {
5640
+ solid: ({ colorScheme, theme: { colors } }) => {
5641
+ const bgColor = colorScheme === "mediatoolBlue" ? colors[colorScheme][500] : colors[colorScheme] && colors[colorScheme][500];
5642
+ const textColor = colorScheme === "yellow" ? "mono.black" : "mono.white";
5643
+ return {
5644
+ bgColor,
5645
+ color: textColor
5646
+ };
5647
+ },
5648
+ outline: ({ colorScheme, theme: { colors } }) => {
5649
+ const textColor = colorScheme === "mediatoolBlue" ? colors[colorScheme][500] : colors[colorScheme] && colors[colorScheme][700];
5650
+ return {
5651
+ bgColor: "mono.transparent",
5652
+ color: textColor
5653
+ };
5654
+ }
5655
+ }
5656
+ };
5657
+
5613
5658
  var components = /*#__PURE__*/Object.freeze({
5614
5659
  __proto__: null,
5615
5660
  Alert: Alert,
5616
5661
  Avatar: Avatar,
5662
+ Badge: Badge,
5617
5663
  Blinker: Blinker,
5618
5664
  Blockquote: Blockquote,
5619
5665
  Breadcrumb: Breadcrumb,
@@ -8699,15 +8745,12 @@
8699
8745
  };
8700
8746
  function getComponents() {
8701
8747
  return {
8748
+ Menu: (props) => /* @__PURE__ */ React.createElement(react.Box, { "data-testid": "select-menu-wrapper-test-id" }, /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.Menu, __spreadValues$W({}, props), props.children)),
8702
8749
  DropdownIndicator: (props) => props.selectProps.icon ? /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.DropdownIndicator, __spreadValues$W({}, props), /* @__PURE__ */ React.createElement(Icon$1, { as: props.selectProps.icon })) : /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.DropdownIndicator, __spreadValues$W({}, props)),
8703
8750
  Option: (props) => props.selectProps.customOption ? /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.Option, __spreadValues$W({}, props), props.selectProps.customOption(props.data)) : /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.Option, __spreadValues$W({}, props)),
8704
8751
  MultiValueContainer: (props) => props.selectProps.customTag ? /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.MultiValueContainer, __spreadValues$W({}, props), props.selectProps.customTag(props.data)) : /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.MultiValueContainer, __spreadValues$W({}, props)),
8705
8752
  Control: (_a) => {
8706
- var _b = _a, {
8707
- children
8708
- } = _b, props = __objRest$K(_b, [
8709
- "children"
8710
- ]);
8753
+ var _b = _a, { children } = _b, props = __objRest$K(_b, ["children"]);
8711
8754
  return props.selectProps.leftComponent ? /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.Control, __spreadValues$W({}, props), /* @__PURE__ */ React.createElement(react.HStack, { w: "full", pl: "2" }, props.selectProps.leftComponent, /* @__PURE__ */ React.createElement(react.HStack, { w: "full", justify: "space-between" }, children))) : /* @__PURE__ */ React.createElement(chakraReactSelect.chakraComponents.Control, __spreadValues$W({}, props), children);
8712
8755
  }
8713
8756
  };
@@ -9453,25 +9496,18 @@
9453
9496
  };
9454
9497
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
9455
9498
  function MultiSort({
9456
- items: sortableItems,
9499
+ items,
9457
9500
  onChange = () => {
9458
9501
  },
9459
9502
  children,
9460
9503
  collisionDetection,
9461
9504
  sensors
9462
9505
  }) {
9463
- const [items, setItems] = React.useState(sortableItems);
9464
9506
  const [activeItem, setActiveItem] = React.useState(null);
9465
9507
  const moveBetweenContainers = (activeContainerName, activeIndex, overContainerName, overIndex, item) => __spreadProps$7(__spreadValues$J({}, items), {
9466
9508
  [activeContainerName]: ramda.remove(activeIndex, 1, items[activeContainerName]),
9467
9509
  [overContainerName]: ramda.insert(overIndex, item, items[overContainerName])
9468
9510
  });
9469
- React.useEffect(() => {
9470
- onChange(items);
9471
- }, [items]);
9472
- React.useEffect(() => {
9473
- setItems(sortableItems);
9474
- }, [sortableItems]);
9475
9511
  const customSensors = core.useSensors(
9476
9512
  core.useSensor(core.PointerSensor),
9477
9513
  core.useSensor(core.KeyboardSensor, {
@@ -9498,46 +9534,40 @@
9498
9534
  const handleDragOver = (e) => {
9499
9535
  const { activeContainerName, overContainerName, id, overId } = getContainers(e);
9500
9536
  if (!(!activeContainerName || !overContainerName || activeContainerName === overContainerName)) {
9501
- setItems((prev) => {
9502
- const activeIndex = ramda.indexOf(id, prev[activeContainerName]);
9503
- const overIndex = ramda.indexOf(overId, prev[overContainerName]);
9504
- return moveBetweenContainers(
9505
- activeContainerName,
9506
- activeIndex,
9507
- overContainerName,
9508
- overIndex,
9509
- id
9510
- );
9511
- });
9537
+ const activeIndex = ramda.indexOf(id, items[activeContainerName]);
9538
+ const overIndex = ramda.indexOf(overId, items[overContainerName]);
9539
+ onChange(moveBetweenContainers(
9540
+ activeContainerName,
9541
+ activeIndex,
9542
+ overContainerName,
9543
+ overIndex,
9544
+ id
9545
+ ));
9512
9546
  }
9513
9547
  };
9514
9548
  const handleDragEnd = (e) => {
9515
9549
  const { activeContainerName, overContainerName, id, overId, active } = getContainers(e);
9516
- setItems((prev) => {
9517
- if (!activeContainerName || !overContainerName)
9518
- return prev;
9519
- const activeIndex = ramda.indexOf(id, prev[activeContainerName]);
9520
- const overIndex = ramda.indexOf(overId, prev[overContainerName]);
9521
- let newItems;
9522
- if (activeContainerName === overContainerName) {
9523
- newItems = __spreadProps$7(__spreadValues$J({}, prev), {
9524
- [overContainerName]: sortable.arrayMove(
9525
- prev[overContainerName],
9526
- activeIndex,
9527
- overIndex
9528
- )
9529
- });
9530
- } else {
9531
- newItems = moveBetweenContainers(
9532
- activeContainerName,
9550
+ if (!activeContainerName || !overContainerName)
9551
+ return;
9552
+ const activeIndex = ramda.indexOf(id, items[activeContainerName]);
9553
+ const overIndex = ramda.indexOf(overId, items[overContainerName]);
9554
+ if (activeContainerName === overContainerName) {
9555
+ onChange(__spreadProps$7(__spreadValues$J({}, items), {
9556
+ [overContainerName]: sortable.arrayMove(
9557
+ items[overContainerName],
9533
9558
  activeIndex,
9534
- overContainerName,
9535
- overIndex,
9536
- active == null ? void 0 : active.id
9537
- );
9538
- }
9539
- return newItems;
9540
- });
9559
+ overIndex
9560
+ )
9561
+ }));
9562
+ } else {
9563
+ onChange(moveBetweenContainers(
9564
+ activeContainerName,
9565
+ activeIndex,
9566
+ overContainerName,
9567
+ overIndex,
9568
+ active == null ? void 0 : active.id
9569
+ ));
9570
+ }
9541
9571
  };
9542
9572
  return /* @__PURE__ */ React.createElement(
9543
9573
  DragAndDrop,
@@ -14076,7 +14106,7 @@
14076
14106
  exports.AsyncError = AsyncError;
14077
14107
  exports.Avatar = Avatar$1;
14078
14108
  exports.AvatarGroup = AvatarGroup;
14079
- exports.Badge = Badge;
14109
+ exports.Badge = Badge$1;
14080
14110
  exports.Blinker = Blinker$1;
14081
14111
  exports.Blockquote = Blockquote$1;
14082
14112
  exports.Button = Button$1;