@noya-app/noya-designsystem 0.1.60 → 0.1.61

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
@@ -726,7 +726,7 @@ var Tooltip = React10.memo(function Tooltip2({
726
726
 
727
727
  // src/components/Button.tsx
728
728
  var variantStyles = {
729
- normal: "bg-input-background text-text hover:bg-input-background-light active:bg-active-background min-w-[31px]",
729
+ normal: "bg-button-background text-button-text hover:bg-button-background-hover active:bg-button-background-active min-w-[31px]",
730
730
  primary: "bg-primary text-white hover:bg-primary-light active:bg-primary min-w-[31px]",
731
731
  secondary: "bg-secondary text-white hover:bg-secondary-light active:bg-secondary min-w-[31px]",
732
732
  secondaryBright: "bg-[#0ab557] text-white hover:opacity-80 active:opacity-90",
@@ -764,7 +764,7 @@ var Button = forwardRef4(function Button2({
764
764
  "no-underline leading-[1] relative border-0 outline-none select-none text-left rounded flex items-center justify-center [&>*]:pointer-events-none [-webkit-app-region:no-drag] focus:ring-2 focus:ring-primary focus:shadow-[0_0_0_1px_var(--n-popover-background)_inset] transition-all",
765
765
  disabled ? "opacity-25" : "",
766
766
  !className?.includes("flex") ? "flex-none" : "",
767
- active ? "bg-primary-pastel text-primary hover:bg-primary-pastel-light min-w-[31px]" : variantStyles[variant],
767
+ active ? "bg-button-background-active text-button-text-active hover:bg-button-background-active-hover min-w-[31px]" : variantStyles[variant],
768
768
  sizeStyles[variant === "thin" ? "thin" : variant === "floating" && size2 !== "small" ? "floating" : variant === "none" ? "none" : size2]
769
769
  );
770
770
  const buttonClassName = useMemo4(() => {
@@ -3383,7 +3383,7 @@ var colorSchemeStyles = {
3383
3383
  secondary: "text-secondary"
3384
3384
  };
3385
3385
  var Checkbox = React37.memo(
3386
- React37.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
3386
+ React37.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "primary", ...props }, ref) {
3387
3387
  const { fieldId: id } = useLabel({ fieldId: props.id });
3388
3388
  return /* @__PURE__ */ React37.createElement(
3389
3389
  "div",
@@ -3408,10 +3408,10 @@ var Checkbox = React37.memo(
3408
3408
  m-0
3409
3409
  rounded
3410
3410
  bg-input-background
3411
-
3412
3411
  border
3413
3412
  border-divider
3414
3413
  disabled:opacity-50
3414
+ cursor-pointer
3415
3415
  disabled:cursor-not-allowed
3416
3416
  focus:ring-2
3417
3417
  focus:ring-primary
@@ -4203,6 +4203,10 @@ var getGridSize = (size2) => {
4203
4203
  minColumnWidth: "220px",
4204
4204
  gap: 30
4205
4205
  },
4206
+ mediumLarge: {
4207
+ minColumnWidth: "250px",
4208
+ gap: 35
4209
+ },
4206
4210
  large: {
4207
4211
  minColumnWidth: "280px",
4208
4212
  gap: 40
@@ -6117,6 +6121,7 @@ var pyMap = {
6117
6121
  xs: "py-0.5",
6118
6122
  small: "py-0.5",
6119
6123
  medium: "py-1",
6124
+ mediumLarge: "py-1.5",
6120
6125
  large: "py-2",
6121
6126
  xl: "py-3"
6122
6127
  };
@@ -6125,6 +6130,7 @@ var thumbnailSizeMap = {
6125
6130
  xs: "w-5 h-5",
6126
6131
  small: "w-5 h-5",
6127
6132
  medium: "w-8 h-8",
6133
+ mediumLarge: "w-12 h-12",
6128
6134
  large: "w-16 h-16",
6129
6135
  xl: "w-24 h-24"
6130
6136
  };
@@ -6133,6 +6139,7 @@ var rowGapMap = {
6133
6139
  xs: "gap-2",
6134
6140
  small: "gap-2",
6135
6141
  medium: "gap-3",
6142
+ mediumLarge: "gap-3",
6136
6143
  large: "gap-3",
6137
6144
  xl: "gap-4"
6138
6145
  };
@@ -6141,6 +6148,7 @@ var fontStyleMap = {
6141
6148
  xs: "font-medium text-list-small",
6142
6149
  small: "font-medium text-list-small",
6143
6150
  medium: "font-medium",
6151
+ mediumLarge: "font-medium",
6144
6152
  large: "font-medium",
6145
6153
  xl: "font-medium text-heading4 text-text"
6146
6154
  };
@@ -7100,11 +7108,8 @@ var Divider = memo20(function Divider2({
7100
7108
  "div",
7101
7109
  {
7102
7110
  className: cx(
7103
- `
7104
- h-px min-h-px
7105
- ${variant === "strong" ? "bg-divider-strong" : variant === "subtle" ? "bg-divider-subtle" : "bg-divider"}
7106
- self-stretch
7107
- `,
7111
+ `h-px min-h-px self-stretch`,
7112
+ variant === "strong" ? "bg-divider-strong" : variant === "subtle" ? "bg-divider-subtle" : "bg-divider",
7108
7113
  className
7109
7114
  ),
7110
7115
  style: {
@@ -7126,12 +7131,11 @@ var DividerVertical = memo20(function DividerVertical2({
7126
7131
  return /* @__PURE__ */ React57.createElement(
7127
7132
  "div",
7128
7133
  {
7129
- className: cx(`
7130
- w-px min-w-px
7131
- ${variant === "strong" ? "bg-divider-strong" : variant === "subtle" ? "bg-divider-subtle" : "bg-divider"}
7132
- self-stretch
7133
- ${className}
7134
- `),
7134
+ className: cx(
7135
+ `w-px min-w-px self-stretch`,
7136
+ variant === "strong" ? "bg-divider-strong" : variant === "subtle" ? "bg-divider-subtle" : "bg-divider",
7137
+ className
7138
+ ),
7135
7139
  style: {
7136
7140
  marginTop: `-${overflow}px`,
7137
7141
  marginBottom: `-${overflow}px`,
@@ -11198,6 +11202,7 @@ var iconSizeMap = {
11198
11202
  xs: 12,
11199
11203
  small: 12,
11200
11204
  medium: "max(15px, 20%)",
11205
+ mediumLarge: "max(15px, 20%)",
11201
11206
  large: "max(15px, 20%)",
11202
11207
  xl: "max(15px, 20%)"
11203
11208
  };
@@ -11452,7 +11457,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
11452
11457
  "font-sans text-button relative flex-1 appearance-none text-segmented-control-item focus:outline-none transition-colors",
11453
11458
  variant === "tabs" ? "font-semibold" : "font-normal",
11454
11459
  variant === "tabs" ? "" : colorScheme === "secondary" ? "focus:ring-2 focus:ring-secondary focus:ring-offset-1" : "focus:ring-2 focus:ring-primary focus:ring-offset-1",
11455
- variant === "tabs" ? "aria-checked:text-primary" : colorScheme === "secondary" ? "aria-checked:bg-secondary aria-checked:text-white" : colorScheme === "primary" ? "aria-checked:bg-primary aria-checked:text-white" : "aria-checked:bg-background aria-checked:text-text",
11460
+ variant === "tabs" ? "aria-checked:text-primary" : colorScheme === "secondary" ? "aria-checked:bg-secondary aria-checked:text-white" : colorScheme === "primary" ? "aria-checked:bg-primary aria-checked:text-white" : "aria-checked:bg-segmented-control-item-active-background aria-checked:text-segmented-control-item-active-text",
11456
11461
  "focus:z-interactable",
11457
11462
  variant === "default" ? "px-1 rounded aria-checked:shadow-segment" : "px-1.5 border-y-2 border-y-transparent aria-checked:border-b-primary",
11458
11463
  variant === "default" && "border-r border-divider last:border-r-0 aria-checked:border-r-transparent [&:has(+[aria-checked=true])]:border-r-transparent",
@@ -11562,7 +11567,8 @@ var SelectionToolbarContainer = memo33(
11562
11567
  zIndex: 1e3,
11563
11568
  opacity: size2 ? 1 : 0,
11564
11569
  transition: "opacity 0.2s ease-in-out",
11565
- ["--n-input-background"]: "transparent"
11570
+ [cssVarNames.colors.inputBackground]: "transparent",
11571
+ [cssVarNames.colors.buttonBackground]: "transparent"
11566
11572
  }
11567
11573
  },
11568
11574
  /* @__PURE__ */ React80.createElement(
@@ -11763,7 +11769,6 @@ var THUMB_WIDTH = 8;
11763
11769
  var thumbStyle = {
11764
11770
  width: THUMB_WIDTH
11765
11771
  };
11766
- var insetEndStyles2 = getInsetEndStyles();
11767
11772
  var Slider = memo34(function Slider2({
11768
11773
  style: style2,
11769
11774
  className,
@@ -11782,37 +11787,16 @@ var Slider = memo34(function Slider2({
11782
11787
  () => [Math.min(Math.max(value, min), max)],
11783
11788
  [value, min, max]
11784
11789
  );
11785
- const { label, fieldId: id } = useLabel({
11786
- label: props.label,
11790
+ const { fieldId: id } = useLabel({
11787
11791
  fieldId: props.id
11788
11792
  });
11789
- const labelPosition = useLabelPosition();
11790
11793
  const handleValueChange = useCallback31(
11791
11794
  (arrayValue2) => {
11792
11795
  onValueChange(arrayValue2[0]);
11793
11796
  },
11794
11797
  [onValueChange]
11795
11798
  );
11796
- const percentage = useMemo38(() => {
11797
- const rawPercent = (arrayValue[0] - min) / (max - min);
11798
- const adjustedPercent = rawPercent * (100 - THUMB_WIDTH * 100 / 300) + THUMB_WIDTH * 50 / 300;
11799
- return {
11800
- raw: rawPercent * 100,
11801
- adjusted: adjustedPercent
11802
- };
11803
- }, [arrayValue, min, max]);
11804
- const trackFillStyle = useMemo38(
11805
- () => ({
11806
- clipPath: `inset(0 ${100 - percentage.adjusted}% 0 0)`
11807
- }),
11808
- [percentage.adjusted]
11809
- );
11810
- const labelStyle = useMemo38(
11811
- () => ({
11812
- clipPath: `inset(0 ${100 - percentage.raw}% 0 0)`
11813
- }),
11814
- [percentage.raw]
11815
- );
11799
+ const ratio = (arrayValue[0] - min) / (max - min);
11816
11800
  return /* @__PURE__ */ React82.createElement(
11817
11801
  RadixSlider.Root,
11818
11802
  {
@@ -11823,7 +11807,7 @@ var Slider = memo34(function Slider2({
11823
11807
  value: arrayValue,
11824
11808
  onValueChange: handleValueChange,
11825
11809
  className: cx(
11826
- "flex relative items-center select-none touch-none h-input-height rounded overflow-hidden flex-grow max-h-input-height",
11810
+ "flex relative items-center select-none touch-none h-input-height rounded flex-grow max-h-input-height cursor-pointer",
11827
11811
  className
11828
11812
  ),
11829
11813
  style: style2,
@@ -11831,24 +11815,33 @@ var Slider = memo34(function Slider2({
11831
11815
  onBlur,
11832
11816
  disabled: readOnly
11833
11817
  },
11834
- /* @__PURE__ */ React82.createElement(RadixSlider.Track, { className: "flex-grow h-full rounded overflow-hidden bg-input-background" }, label && labelPosition === "inset" && /* @__PURE__ */ React82.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React82.createElement(Label, { htmlFor: id, className: "text-text-disabled" }, label)), /* @__PURE__ */ React82.createElement(
11818
+ /* @__PURE__ */ React82.createElement("div", { className: "relative flex-grow h-[3px] overflow-hidden" }, /* @__PURE__ */ React82.createElement(
11835
11819
  "div",
11836
11820
  {
11837
- style: trackFillStyle,
11838
- className: cx(
11839
- "absolute inset-0 w-full h-full rounded overflow-hidden bg-primary-pastel",
11840
- colorScheme === "primary" && "bg-primary",
11841
- colorScheme === "secondary" && "bg-secondary"
11842
- )
11821
+ className: "absolute h-full rounded-l bg-primary",
11822
+ style: {
11823
+ left: 0,
11824
+ width: `calc(${ratio * 100}% - ${ratio * 8}px - 2px)`
11825
+ }
11826
+ }
11827
+ ), /* @__PURE__ */ React82.createElement(
11828
+ "div",
11829
+ {
11830
+ className: "absolute h-full rounded-r bg-input-background",
11831
+ style: {
11832
+ right: 0,
11833
+ width: `calc(100% - ${ratio * 100}% + ${ratio * 8}px - 10px)`
11834
+ }
11843
11835
  }
11844
11836
  )),
11845
- label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */ React82.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React82.createElement(Label, { className: "text-white overflow-hidden", style: labelStyle }, label)),
11846
11837
  /* @__PURE__ */ React82.createElement(
11847
11838
  RadixSlider.Thumb,
11848
11839
  {
11849
11840
  style: thumbStyle,
11850
11841
  className: cx(
11851
- "block h-input-height rounded border border-solid bg-slider-thumb-background transition-colors focus:border-primary focus:border-2 outline-none",
11842
+ "block h-[21px] rounded-sm bg-slider-thumb-background shadow-sliderThumb transition-colors focus:outline-primary focus:outline-2",
11843
+ "cursor-ew-resize",
11844
+ // "outline-none outline outline-2 outline-offset-[0px] outline-background",
11852
11845
  colorScheme === void 0 && "border-slider-border",
11853
11846
  colorScheme === "primary" && "border-primary",
11854
11847
  colorScheme === "secondary" && "border-secondary"
@@ -12852,6 +12845,7 @@ var LabeledRow = memo40(function LabeledRow2({
12852
12845
  // src/components/BaseToolbar.tsx
12853
12846
  import React92 from "react";
12854
12847
  var toolbarStyle = {
12848
+ [cssVarNames.colors.buttonBackground]: "transparent",
12855
12849
  [cssVarNames.colors.inputBackground]: "transparent"
12856
12850
  };
12857
12851
  function BaseToolbar({