@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.
@@ -1597,7 +1597,7 @@ declare const DropZone: ({ sx, name, children, ...rest }: DropZoneProps) => JSX.
1597
1597
 
1598
1598
  SortableContainer is a wrapper for a <Sortable /> with a sortable item
1599
1599
  * */
1600
- declare function MultiSort<itemKeys extends string | number | symbol>({ items: sortableItems, onChange, children, collisionDetection, sensors, }: MultiSortProps<itemKeys>): JSX.Element;
1600
+ declare function MultiSort<itemKeys extends string | number | symbol>({ items, onChange, children, collisionDetection, sensors, }: MultiSortProps<itemKeys>): JSX.Element;
1601
1601
 
1602
1602
  /**
1603
1603
  * Util component to render sortable items under sortable context
@@ -1681,7 +1681,7 @@ interface HeadingProps extends HeadingProps$1 {
1681
1681
  * <H1>Heading 1</H1>
1682
1682
  * ?)
1683
1683
  */
1684
- declare const H1: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1684
+ declare const H1: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1685
1685
 
1686
1686
  /**
1687
1687
  * @see {@link https://northlight.dev/reference/h2}
@@ -1691,7 +1691,7 @@ declare const H1: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1691
1691
  * ?)
1692
1692
  *
1693
1693
  */
1694
- declare const H2: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1694
+ declare const H2: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1695
1695
 
1696
1696
  /**
1697
1697
  * @see {@link https://northlight.dev/reference/h3}
@@ -1700,7 +1700,7 @@ declare const H2: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1700
1700
  * <H3>Heading 3</H3>
1701
1701
  * ?)
1702
1702
  */
1703
- declare const H3: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1703
+ declare const H3: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1704
1704
 
1705
1705
  /**
1706
1706
  * @see {@link https://northlight.dev/reference/h4}
@@ -1709,7 +1709,7 @@ declare const H3: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1709
1709
  * <H4>Heading 4</H4>
1710
1710
  * ?)
1711
1711
  */
1712
- declare const H4: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1712
+ declare const H4: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1713
1713
 
1714
1714
  /**
1715
1715
  * @see {@link https://northlight.dev/reference/h5}
@@ -1718,7 +1718,7 @@ declare const H4: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1718
1718
  * <H5>Heading 5</H5>
1719
1719
  * ?)
1720
1720
  */
1721
- declare const H5: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1721
+ declare const H5: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1722
1722
 
1723
1723
  /**
1724
1724
  * @see {@link https://northlight.dev/reference/h6}
@@ -1727,7 +1727,7 @@ declare const H5: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1727
1727
  * <H6>Heading 6</H6>
1728
1728
  * ?)
1729
1729
  */
1730
- declare const H6: ({ children, sx, ...rest }: HeadingProps) => JSX.Element;
1730
+ declare const H6: (props: HeadingProps & React__default.RefAttributes<HTMLHeadingElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1731
1731
 
1732
1732
  interface PProps extends TextProps {
1733
1733
  variant?: '14' | '16';
@@ -1027,7 +1027,7 @@ var __objRest$1A = (source, exclude) => {
1027
1027
  }
1028
1028
  return target;
1029
1029
  };
1030
- const H1$1 = (_a) => {
1030
+ const H1$1 = forwardRef$1((_a, ref) => {
1031
1031
  var _b = _a, {
1032
1032
  children,
1033
1033
  sx = {}
@@ -1040,11 +1040,12 @@ const H1$1 = (_a) => {
1040
1040
  Heading,
1041
1041
  __spreadValues$23({
1042
1042
  as: "h1",
1043
- sx: styles
1043
+ sx: styles,
1044
+ ref
1044
1045
  }, rest),
1045
1046
  children
1046
1047
  );
1047
- };
1048
+ });
1048
1049
 
1049
1050
  var __defProp$22 = Object.defineProperty;
1050
1051
  var __getOwnPropSymbols$22 = Object.getOwnPropertySymbols;
@@ -1074,7 +1075,7 @@ var __objRest$1z = (source, exclude) => {
1074
1075
  }
1075
1076
  return target;
1076
1077
  };
1077
- const H2$1 = (_a) => {
1078
+ const H2$1 = forwardRef$1((_a, ref) => {
1078
1079
  var _b = _a, {
1079
1080
  children,
1080
1081
  sx = {}
@@ -1087,11 +1088,12 @@ const H2$1 = (_a) => {
1087
1088
  Heading,
1088
1089
  __spreadValues$22({
1089
1090
  as: "h2",
1090
- sx: styles
1091
+ sx: styles,
1092
+ ref
1091
1093
  }, rest),
1092
1094
  children
1093
1095
  );
1094
- };
1096
+ });
1095
1097
 
1096
1098
  var __defProp$21 = Object.defineProperty;
1097
1099
  var __getOwnPropSymbols$21 = Object.getOwnPropertySymbols;
@@ -1121,7 +1123,7 @@ var __objRest$1y = (source, exclude) => {
1121
1123
  }
1122
1124
  return target;
1123
1125
  };
1124
- const H3$1 = (_a) => {
1126
+ const H3$1 = forwardRef$1((_a, ref) => {
1125
1127
  var _b = _a, {
1126
1128
  children,
1127
1129
  sx = {}
@@ -1134,11 +1136,12 @@ const H3$1 = (_a) => {
1134
1136
  Heading,
1135
1137
  __spreadValues$21({
1136
1138
  as: "h3",
1137
- sx: styles
1139
+ sx: styles,
1140
+ ref
1138
1141
  }, rest),
1139
1142
  children
1140
1143
  );
1141
- };
1144
+ });
1142
1145
 
1143
1146
  var __defProp$20 = Object.defineProperty;
1144
1147
  var __getOwnPropSymbols$20 = Object.getOwnPropertySymbols;
@@ -1168,7 +1171,7 @@ var __objRest$1x = (source, exclude) => {
1168
1171
  }
1169
1172
  return target;
1170
1173
  };
1171
- const H4$1 = (_a) => {
1174
+ const H4$1 = forwardRef$1((_a, ref) => {
1172
1175
  var _b = _a, {
1173
1176
  children,
1174
1177
  sx = {}
@@ -1181,11 +1184,12 @@ const H4$1 = (_a) => {
1181
1184
  Heading,
1182
1185
  __spreadValues$20({
1183
1186
  as: "h4",
1184
- sx: styles
1187
+ sx: styles,
1188
+ ref
1185
1189
  }, rest),
1186
1190
  children
1187
1191
  );
1188
- };
1192
+ });
1189
1193
 
1190
1194
  var __defProp$1$ = Object.defineProperty;
1191
1195
  var __getOwnPropSymbols$1$ = Object.getOwnPropertySymbols;
@@ -1215,7 +1219,7 @@ var __objRest$1w = (source, exclude) => {
1215
1219
  }
1216
1220
  return target;
1217
1221
  };
1218
- const H5$1 = (_a) => {
1222
+ const H5$1 = forwardRef$1((_a, ref) => {
1219
1223
  var _b = _a, {
1220
1224
  children,
1221
1225
  sx = {}
@@ -1228,11 +1232,12 @@ const H5$1 = (_a) => {
1228
1232
  Heading,
1229
1233
  __spreadValues$1$({
1230
1234
  as: "h5",
1231
- sx: styles
1235
+ sx: styles,
1236
+ ref
1232
1237
  }, rest),
1233
1238
  children
1234
1239
  );
1235
- };
1240
+ });
1236
1241
 
1237
1242
  var __defProp$1_ = Object.defineProperty;
1238
1243
  var __getOwnPropSymbols$1_ = Object.getOwnPropertySymbols;
@@ -1262,7 +1267,7 @@ var __objRest$1v = (source, exclude) => {
1262
1267
  }
1263
1268
  return target;
1264
1269
  };
1265
- const H6$1 = (_a) => {
1270
+ const H6$1 = forwardRef$1((_a, ref) => {
1266
1271
  var _b = _a, {
1267
1272
  children,
1268
1273
  sx = {}
@@ -1275,11 +1280,12 @@ const H6$1 = (_a) => {
1275
1280
  Heading,
1276
1281
  __spreadValues$1_({
1277
1282
  as: "h6",
1278
- sx: styles
1283
+ sx: styles,
1284
+ ref
1279
1285
  }, rest),
1280
1286
  children
1281
1287
  );
1282
- };
1288
+ });
1283
1289
 
1284
1290
  var __defProp$1Z = Object.defineProperty;
1285
1291
  var __getOwnPropSymbols$1Z = Object.getOwnPropertySymbols;
@@ -3062,6 +3068,7 @@ const Button = {
3062
3068
  variants: {
3063
3069
  default: ({ theme: { colors: color } }) => ({
3064
3070
  bgColor: color.background.button.default,
3071
+ color: color.text.button.default,
3065
3072
  _hover: {
3066
3073
  bgColor: color.background.button["default-hover"]
3067
3074
  },
@@ -3084,6 +3091,7 @@ const Button = {
3084
3091
  }),
3085
3092
  success: ({ theme: { colors: color } }) => ({
3086
3093
  bgColor: color.background.button.success,
3094
+ color: color.text.button.success,
3087
3095
  _hover: {
3088
3096
  bg: color.background.button["success-hover"],
3089
3097
  _disabled: {
@@ -3136,6 +3144,15 @@ const Button = {
3136
3144
  bgColor: color.background.button["link-active"]
3137
3145
  }
3138
3146
  }),
3147
+ outline: ({ theme: { colors: color } }) => ({
3148
+ color: color.text.default,
3149
+ _hover: {
3150
+ bg: color.background.button["ghost-hover"]
3151
+ },
3152
+ _active: {
3153
+ bg: color.background.button["ghost-active"]
3154
+ }
3155
+ }),
3139
3156
  ghost: ({ theme: { colors: color } }) => ({
3140
3157
  color: color.text.default,
3141
3158
  bgColor: color.background.button.ghost,
@@ -8736,15 +8753,12 @@ var __objRest$K = (source, exclude) => {
8736
8753
  };
8737
8754
  function getComponents() {
8738
8755
  return {
8756
+ Menu: (props) => /* @__PURE__ */ React.createElement(Box, { "data-testid": "select-menu-wrapper-test-id" }, /* @__PURE__ */ React.createElement(chakraComponents.Menu, __spreadValues$W({}, props), props.children)),
8739
8757
  DropdownIndicator: (props) => props.selectProps.icon ? /* @__PURE__ */ React.createElement(chakraComponents.DropdownIndicator, __spreadValues$W({}, props), /* @__PURE__ */ React.createElement(Icon$1, { as: props.selectProps.icon })) : /* @__PURE__ */ React.createElement(chakraComponents.DropdownIndicator, __spreadValues$W({}, props)),
8740
8758
  Option: (props) => props.selectProps.customOption ? /* @__PURE__ */ React.createElement(chakraComponents.Option, __spreadValues$W({}, props), props.selectProps.customOption(props.data)) : /* @__PURE__ */ React.createElement(chakraComponents.Option, __spreadValues$W({}, props)),
8741
8759
  MultiValueContainer: (props) => props.selectProps.customTag ? /* @__PURE__ */ React.createElement(chakraComponents.MultiValueContainer, __spreadValues$W({}, props), props.selectProps.customTag(props.data)) : /* @__PURE__ */ React.createElement(chakraComponents.MultiValueContainer, __spreadValues$W({}, props)),
8742
8760
  Control: (_a) => {
8743
- var _b = _a, {
8744
- children
8745
- } = _b, props = __objRest$K(_b, [
8746
- "children"
8747
- ]);
8761
+ var _b = _a, { children } = _b, props = __objRest$K(_b, ["children"]);
8748
8762
  return props.selectProps.leftComponent ? /* @__PURE__ */ React.createElement(chakraComponents.Control, __spreadValues$W({}, props), /* @__PURE__ */ React.createElement(HStack, { w: "full", pl: "2" }, props.selectProps.leftComponent, /* @__PURE__ */ React.createElement(HStack, { w: "full", justify: "space-between" }, children))) : /* @__PURE__ */ React.createElement(chakraComponents.Control, __spreadValues$W({}, props), children);
8749
8763
  }
8750
8764
  };
@@ -9490,25 +9504,18 @@ var __spreadValues$J = (a, b) => {
9490
9504
  };
9491
9505
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
9492
9506
  function MultiSort({
9493
- items: sortableItems,
9507
+ items,
9494
9508
  onChange = () => {
9495
9509
  },
9496
9510
  children,
9497
9511
  collisionDetection,
9498
9512
  sensors
9499
9513
  }) {
9500
- const [items, setItems] = useState(sortableItems);
9501
9514
  const [activeItem, setActiveItem] = useState(null);
9502
9515
  const moveBetweenContainers = (activeContainerName, activeIndex, overContainerName, overIndex, item) => __spreadProps$7(__spreadValues$J({}, items), {
9503
9516
  [activeContainerName]: remove(activeIndex, 1, items[activeContainerName]),
9504
9517
  [overContainerName]: insert(overIndex, item, items[overContainerName])
9505
9518
  });
9506
- useEffect(() => {
9507
- onChange(items);
9508
- }, [items]);
9509
- useEffect(() => {
9510
- setItems(sortableItems);
9511
- }, [sortableItems]);
9512
9519
  const customSensors = useSensors(
9513
9520
  useSensor(PointerSensor),
9514
9521
  useSensor(KeyboardSensor, {
@@ -9535,46 +9542,40 @@ function MultiSort({
9535
9542
  const handleDragOver = (e) => {
9536
9543
  const { activeContainerName, overContainerName, id, overId } = getContainers(e);
9537
9544
  if (!(!activeContainerName || !overContainerName || activeContainerName === overContainerName)) {
9538
- setItems((prev) => {
9539
- const activeIndex = indexOf(id, prev[activeContainerName]);
9540
- const overIndex = indexOf(overId, prev[overContainerName]);
9541
- return moveBetweenContainers(
9542
- activeContainerName,
9543
- activeIndex,
9544
- overContainerName,
9545
- overIndex,
9546
- id
9547
- );
9548
- });
9545
+ const activeIndex = indexOf(id, items[activeContainerName]);
9546
+ const overIndex = indexOf(overId, items[overContainerName]);
9547
+ onChange(moveBetweenContainers(
9548
+ activeContainerName,
9549
+ activeIndex,
9550
+ overContainerName,
9551
+ overIndex,
9552
+ id
9553
+ ));
9549
9554
  }
9550
9555
  };
9551
9556
  const handleDragEnd = (e) => {
9552
9557
  const { activeContainerName, overContainerName, id, overId, active } = getContainers(e);
9553
- setItems((prev) => {
9554
- if (!activeContainerName || !overContainerName)
9555
- return prev;
9556
- const activeIndex = indexOf(id, prev[activeContainerName]);
9557
- const overIndex = indexOf(overId, prev[overContainerName]);
9558
- let newItems;
9559
- if (activeContainerName === overContainerName) {
9560
- newItems = __spreadProps$7(__spreadValues$J({}, prev), {
9561
- [overContainerName]: arrayMove(
9562
- prev[overContainerName],
9563
- activeIndex,
9564
- overIndex
9565
- )
9566
- });
9567
- } else {
9568
- newItems = moveBetweenContainers(
9569
- activeContainerName,
9558
+ if (!activeContainerName || !overContainerName)
9559
+ return;
9560
+ const activeIndex = indexOf(id, items[activeContainerName]);
9561
+ const overIndex = indexOf(overId, items[overContainerName]);
9562
+ if (activeContainerName === overContainerName) {
9563
+ onChange(__spreadProps$7(__spreadValues$J({}, items), {
9564
+ [overContainerName]: arrayMove(
9565
+ items[overContainerName],
9570
9566
  activeIndex,
9571
- overContainerName,
9572
- overIndex,
9573
- active == null ? void 0 : active.id
9574
- );
9575
- }
9576
- return newItems;
9577
- });
9567
+ overIndex
9568
+ )
9569
+ }));
9570
+ } else {
9571
+ onChange(moveBetweenContainers(
9572
+ activeContainerName,
9573
+ activeIndex,
9574
+ overContainerName,
9575
+ overIndex,
9576
+ active == null ? void 0 : active.id
9577
+ ));
9578
+ }
9578
9579
  };
9579
9580
  return /* @__PURE__ */ React.createElement(
9580
9581
  DragAndDrop,