@noya-app/noya-designsystem 0.1.72 → 0.1.74

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
@@ -3801,11 +3801,14 @@ function Icon({
3801
3801
  // src/components/Spacer.tsx
3802
3802
  import * as React8 from "react";
3803
3803
  var SpacerVertical = React8.forwardRef(
3804
- ({ size, inline, ...props }, ref) => {
3804
+ ({ size, inline, className, ...props }, ref) => {
3805
3805
  return /* @__PURE__ */ React8.createElement(
3806
3806
  "span",
3807
3807
  {
3808
- className: `${inline ? "n-inline-block" : "n-block"} ${size === void 0 ? "n-flex n-flex-1" : ""}`,
3808
+ className: cx(
3809
+ `${inline ? "n-inline-block" : "n-block"} ${size === void 0 ? "n-flex n-flex-1" : ""}`,
3810
+ className
3811
+ ),
3809
3812
  style: size ? {
3810
3813
  minHeight: `${size}px`
3811
3814
  } : void 0,
@@ -3816,11 +3819,14 @@ var SpacerVertical = React8.forwardRef(
3816
3819
  }
3817
3820
  );
3818
3821
  var SpacerHorizontal = React8.forwardRef(
3819
- ({ size, inline, ...props }, ref) => {
3822
+ ({ size, inline, className, ...props }, ref) => {
3820
3823
  return /* @__PURE__ */ React8.createElement(
3821
3824
  "span",
3822
3825
  {
3823
- className: `${inline ? "n-inline-block" : "n-block"} ${size === void 0 ? "n-flex n-flex-1" : ""}`,
3826
+ className: cx(
3827
+ `${inline ? "n-inline-block" : "n-block"} ${size === void 0 ? "n-flex n-flex-1" : ""}`,
3828
+ className
3829
+ ),
3824
3830
  style: size ? {
3825
3831
  minWidth: `${size}px`
3826
3832
  } : void 0,
@@ -4854,10 +4860,14 @@ var InputElement = forwardRef9(
4854
4860
  onSubmit,
4855
4861
  as = "input",
4856
4862
  style: style2,
4863
+ attachInputRef = true,
4857
4864
  ...props
4858
4865
  }, forwardedRef) => {
4859
4866
  const { endWidth, inputRef, size, id, startWidth } = useInputFieldContext();
4860
- const ref = useMergeRefs(inputRef, forwardedRef);
4867
+ const ref = useMergeRefs(
4868
+ attachInputRef ? inputRef : null,
4869
+ forwardedRef
4870
+ );
4861
4871
  const spacingStyles = getFieldSpacing({
4862
4872
  endWidth,
4863
4873
  variant: $variant,
@@ -4929,6 +4939,7 @@ var InputFieldTypeahead = (props) => {
4929
4939
  InputElement,
4930
4940
  {
4931
4941
  as: "span",
4942
+ attachInputRef: false,
4932
4943
  style: useMemo8(
4933
4944
  () => ({
4934
4945
  position: "absolute",
@@ -5059,7 +5070,9 @@ function InputFieldRoot({
5059
5070
  const startRef = React20.useRef(null);
5060
5071
  const inputRef = React20.useRef(null);
5061
5072
  const endRef = React20.useRef(null);
5073
+ const rootRef = React20.useRef(null);
5062
5074
  const measuredInputSize = useSize(inputRef, "width");
5075
+ const measuredRootSize = useSize(rootRef, "width");
5063
5076
  const measuredStartSize = useSize(startRef, "width");
5064
5077
  const measuredEndSize = useSize(endRef, "width");
5065
5078
  const labelType = useLabelType();
@@ -5092,18 +5105,34 @@ function InputFieldRoot({
5092
5105
  () => /* @__PURE__ */ React20.createElement(Label, { htmlFor: id, className: "!n-text-text-disabled" }, labelProp ?? label),
5093
5106
  [id, labelProp, label]
5094
5107
  );
5095
- const rootElement = /* @__PURE__ */ React20.createElement(RootContainer, { $width: width, style: style2, className }, children, start && /* @__PURE__ */ React20.createElement("span", { ref: startRef, className: cx(startBaseStyles, startClassName) }, start), (end || label) && /* @__PURE__ */ React20.createElement(
5096
- "span",
5108
+ const rootElement = /* @__PURE__ */ React20.createElement(
5109
+ RootContainer,
5097
5110
  {
5098
- ref: endRef,
5099
- className: cx(endStyles, label && end && "n-gap-1.5", endClassName)
5111
+ ref: rootRef,
5112
+ $width: width,
5113
+ style: style2,
5114
+ className
5100
5115
  },
5101
- labelProp ? insetLabel : label && labelType === "inset" && insetLabel,
5102
- end
5103
- ));
5116
+ children,
5117
+ start && /* @__PURE__ */ React20.createElement("span", { ref: startRef, className: cx(startBaseStyles, startClassName) }, start),
5118
+ (end || label) && /* @__PURE__ */ React20.createElement(
5119
+ "span",
5120
+ {
5121
+ ref: endRef,
5122
+ className: cx(endStyles, label && end && "n-gap-1.5", endClassName)
5123
+ },
5124
+ labelProp ? insetLabel : label && labelType === "inset" && insetLabel,
5125
+ end
5126
+ )
5127
+ );
5128
+ const measuredWidth = useMemo8(() => {
5129
+ const inputWidth = measuredInputSize && measuredInputSize.width > 0 ? measuredInputSize.width : void 0;
5130
+ const rootWidth = measuredRootSize && measuredRootSize.width > 0 ? measuredRootSize.width : void 0;
5131
+ return inputWidth ?? rootWidth ?? width;
5132
+ }, [measuredInputSize, measuredRootSize, width]);
5104
5133
  const measuredWidthObject = useMemo8(
5105
- () => measuredInputSize ? { width: measuredInputSize.width + 4 } : void 0,
5106
- [measuredInputSize]
5134
+ () => measuredWidth && measuredWidth > 0 ? { width: measuredWidth + 4 } : void 0,
5135
+ [measuredWidth]
5107
5136
  );
5108
5137
  return /* @__PURE__ */ React20.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ React20.createElement(
5109
5138
  Popover,
@@ -15373,6 +15402,12 @@ function BaseToolbar({
15373
15402
  innerClassName,
15374
15403
  enableAbsoluteBreakpoint = true
15375
15404
  }) {
15405
+ const childrenContainerClassName = cx(
15406
+ "n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none n-inset-0 n-pl-1 n-pr-1 n-min-w-0",
15407
+ "@xl/toolbar:!n-absolute @xl/toolbar:!n-pl-0 @xl/toolbar:!n-pr-0"
15408
+ );
15409
+ const childrenElement = children && /* @__PURE__ */ React85.createElement("div", { className: childrenContainerClassName }, /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children));
15410
+ const leftElement = left && /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left);
15376
15411
  return /* @__PURE__ */ React85.createElement(
15377
15412
  BaseToolbarContainer,
15378
15413
  {
@@ -15383,14 +15418,8 @@ function BaseToolbar({
15383
15418
  },
15384
15419
  logo && /* @__PURE__ */ React85.createElement(React85.Fragment, null, logo, /* @__PURE__ */ React85.createElement(DividerVertical, null)),
15385
15420
  /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 }),
15386
- left && /* @__PURE__ */ React85.createElement(React85.Fragment, null, /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left), /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 })),
15387
- children && /* @__PURE__ */ React85.createElement(
15388
- "div",
15389
- {
15390
- className: "n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none @xl/toolbar:!n-absolute n-inset-0"
15391
- },
15392
- /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children)
15393
- ),
15421
+ childrenElement,
15422
+ leftElement && /* @__PURE__ */ React85.createElement(React85.Fragment, null, childrenElement && /* @__PURE__ */ React85.createElement(React85.Fragment, null, /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), /* @__PURE__ */ React85.createElement(DividerVertical, { className: "@xl/toolbar:!n-hidden" })), /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), leftElement, /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 })),
15394
15423
  /* @__PURE__ */ React85.createElement(Spacer.Horizontal, null),
15395
15424
  /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 }),
15396
15425
  /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, right),
@@ -15938,7 +15967,7 @@ import React89, { forwardRef as forwardRef26, memo as memo29, useMemo as useMemo
15938
15967
  var Message = memo29(
15939
15968
  forwardRef26(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
15940
15969
  const randomId = uuid2();
15941
- const resolvedUserId = user?.userId ?? user?.connectionId ?? randomId;
15970
+ const resolvedUserId = user?.authId ?? user?.connectionId ?? randomId;
15942
15971
  const userMessageBackgroundColor = colorFromString(resolvedUserId);
15943
15972
  const styles3 = useMemo36(
15944
15973
  () => role === "user" ? {