@northlight/ui 2.20.0 → 2.20.1

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;
@@ -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,
@@ -8699,15 +8716,12 @@
8699
8716
  };
8700
8717
  function getComponents() {
8701
8718
  return {
8719
+ 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
8720
  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
8721
  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
8722
  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
8723
  Control: (_a) => {
8706
- var _b = _a, {
8707
- children
8708
- } = _b, props = __objRest$K(_b, [
8709
- "children"
8710
- ]);
8724
+ var _b = _a, { children } = _b, props = __objRest$K(_b, ["children"]);
8711
8725
  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
8726
  }
8713
8727
  };
@@ -9453,25 +9467,18 @@
9453
9467
  };
9454
9468
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
9455
9469
  function MultiSort({
9456
- items: sortableItems,
9470
+ items,
9457
9471
  onChange = () => {
9458
9472
  },
9459
9473
  children,
9460
9474
  collisionDetection,
9461
9475
  sensors
9462
9476
  }) {
9463
- const [items, setItems] = React.useState(sortableItems);
9464
9477
  const [activeItem, setActiveItem] = React.useState(null);
9465
9478
  const moveBetweenContainers = (activeContainerName, activeIndex, overContainerName, overIndex, item) => __spreadProps$7(__spreadValues$J({}, items), {
9466
9479
  [activeContainerName]: ramda.remove(activeIndex, 1, items[activeContainerName]),
9467
9480
  [overContainerName]: ramda.insert(overIndex, item, items[overContainerName])
9468
9481
  });
9469
- React.useEffect(() => {
9470
- onChange(items);
9471
- }, [items]);
9472
- React.useEffect(() => {
9473
- setItems(sortableItems);
9474
- }, [sortableItems]);
9475
9482
  const customSensors = core.useSensors(
9476
9483
  core.useSensor(core.PointerSensor),
9477
9484
  core.useSensor(core.KeyboardSensor, {
@@ -9498,46 +9505,40 @@
9498
9505
  const handleDragOver = (e) => {
9499
9506
  const { activeContainerName, overContainerName, id, overId } = getContainers(e);
9500
9507
  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
- });
9508
+ const activeIndex = ramda.indexOf(id, items[activeContainerName]);
9509
+ const overIndex = ramda.indexOf(overId, items[overContainerName]);
9510
+ onChange(moveBetweenContainers(
9511
+ activeContainerName,
9512
+ activeIndex,
9513
+ overContainerName,
9514
+ overIndex,
9515
+ id
9516
+ ));
9512
9517
  }
9513
9518
  };
9514
9519
  const handleDragEnd = (e) => {
9515
9520
  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,
9521
+ if (!activeContainerName || !overContainerName)
9522
+ return;
9523
+ const activeIndex = ramda.indexOf(id, items[activeContainerName]);
9524
+ const overIndex = ramda.indexOf(overId, items[overContainerName]);
9525
+ if (activeContainerName === overContainerName) {
9526
+ onChange(__spreadProps$7(__spreadValues$J({}, items), {
9527
+ [overContainerName]: sortable.arrayMove(
9528
+ items[overContainerName],
9533
9529
  activeIndex,
9534
- overContainerName,
9535
- overIndex,
9536
- active == null ? void 0 : active.id
9537
- );
9538
- }
9539
- return newItems;
9540
- });
9530
+ overIndex
9531
+ )
9532
+ }));
9533
+ } else {
9534
+ onChange(moveBetweenContainers(
9535
+ activeContainerName,
9536
+ activeIndex,
9537
+ overContainerName,
9538
+ overIndex,
9539
+ active == null ? void 0 : active.id
9540
+ ));
9541
+ }
9541
9542
  };
9542
9543
  return /* @__PURE__ */ React.createElement(
9543
9544
  DragAndDrop,