@noya-app/noya-designsystem 0.1.43 → 0.1.44

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.
@@ -7,12 +7,12 @@
7
7
  CLI Target: esnext
8
8
  CJS Build start
9
9
  ESM Build start
10
- CJS dist/index.js 614.81 KB
10
+ CJS dist/index.js 615.14 KB
11
11
  CJS dist/index.js.map 1.09 MB
12
- CJS ⚡️ Build success in 234ms
13
- ESM dist/index.mjs 600.02 KB
12
+ CJS ⚡️ Build success in 200ms
13
+ ESM dist/index.mjs 600.34 KB
14
14
  ESM dist/index.mjs.map 1.09 MB
15
- ESM ⚡️ Build success in 235ms
15
+ ESM ⚡️ Build success in 200ms
16
16
  DTS Build start
17
17
  Browserslist: caniuse-lite is outdated. Please run:
18
18
  npx update-browserslist-db@latest
@@ -20,8 +20,8 @@ Browserslist: caniuse-lite is outdated. Please run:
20
20
 
21
21
  Rebuilding...
22
22
 
23
- Done in 308ms.
23
+ Done in 393ms.
24
24
 
25
- DTS ⚡️ Build success in 5435ms
26
- DTS dist/index.d.ts 63.62 KB
27
- DTS dist/index.d.mts 63.62 KB
25
+ DTS ⚡️ Build success in 6180ms
26
+ DTS dist/index.d.ts 63.65 KB
27
+ DTS dist/index.d.mts 63.65 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @noya-app/noya-designsystem
2
2
 
3
+ ## 0.1.44
4
+
5
+ ### Patch Changes
6
+
7
+ - e46e55b: Update packages
8
+
3
9
  ## 0.1.43
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -352,7 +352,7 @@ type BaseComboboxProps = {
352
352
  };
353
353
  type StringModeOnlyProps = {
354
354
  mode: "string";
355
- initialValue?: string;
355
+ value?: string;
356
356
  onChange?: (value: string) => void;
357
357
  onSelectItem?: (value: string) => void;
358
358
  onBlur?: (didSubmit: boolean, value: string) => void;
@@ -362,7 +362,7 @@ type StringModeOnlyProps = {
362
362
  type StringModeProps = BaseComboboxProps & StringModeOnlyProps;
363
363
  type OptionModeOnlyProps = {
364
364
  mode?: "option";
365
- initialValue?: ComboboxOption;
365
+ value?: ComboboxOption;
366
366
  onChange?: (value: ComboboxOption) => void;
367
367
  onSelectItem?: (value: ComboboxOption) => void;
368
368
  onBlur?: (didSubmit: boolean, value: ComboboxOption) => void;
@@ -804,6 +804,7 @@ type Props$6<T extends string> = {
804
804
  label?: React__default.ReactNode;
805
805
  onFocus?: FocusEventHandler;
806
806
  onBlur?: FocusEventHandler;
807
+ contentStyle?: React__default.CSSProperties;
807
808
  } & Pick<SelectProps, "open" | "onOpenChange">;
808
809
  declare const labelTextStyles = "font-sans text-label uppercase text-text-disabled leading-[19px] font-bold text-[60%]";
809
810
  declare const SelectMenu: <T extends string = string>(props: Props$6<T>) => React__default.ReactElement | null;
package/dist/index.d.ts CHANGED
@@ -352,7 +352,7 @@ type BaseComboboxProps = {
352
352
  };
353
353
  type StringModeOnlyProps = {
354
354
  mode: "string";
355
- initialValue?: string;
355
+ value?: string;
356
356
  onChange?: (value: string) => void;
357
357
  onSelectItem?: (value: string) => void;
358
358
  onBlur?: (didSubmit: boolean, value: string) => void;
@@ -362,7 +362,7 @@ type StringModeOnlyProps = {
362
362
  type StringModeProps = BaseComboboxProps & StringModeOnlyProps;
363
363
  type OptionModeOnlyProps = {
364
364
  mode?: "option";
365
- initialValue?: ComboboxOption;
365
+ value?: ComboboxOption;
366
366
  onChange?: (value: ComboboxOption) => void;
367
367
  onSelectItem?: (value: ComboboxOption) => void;
368
368
  onBlur?: (didSubmit: boolean, value: ComboboxOption) => void;
@@ -804,6 +804,7 @@ type Props$6<T extends string> = {
804
804
  label?: React__default.ReactNode;
805
805
  onFocus?: FocusEventHandler;
806
806
  onBlur?: FocusEventHandler;
807
+ contentStyle?: React__default.CSSProperties;
807
808
  } & Pick<SelectProps, "open" | "onOpenChange">;
808
809
  declare const labelTextStyles = "font-sans text-label uppercase text-text-disabled leading-[19px] font-bold text-[60%]";
809
810
  declare const SelectMenu: <T extends string = string>(props: Props$6<T>) => React__default.ReactElement | null;
package/dist/index.js CHANGED
@@ -12301,7 +12301,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
12301
12301
  open,
12302
12302
  onFocus,
12303
12303
  onBlur,
12304
- onOpenChange
12304
+ onOpenChange,
12305
+ contentStyle
12305
12306
  }) {
12306
12307
  const selectedItem = menuItems.find(
12307
12308
  (item) => typeof item !== "string" && item.value === value
@@ -12389,7 +12390,9 @@ var SelectMenu = memoGeneric(function SelectMenu2({
12389
12390
  collisionPadding: 8,
12390
12391
  align: "end",
12391
12392
  style: {
12392
- width: "var(--radix-select-trigger-width)"
12393
+ width: "var(--radix-select-trigger-width)",
12394
+ maxHeight: "500px",
12395
+ ...contentStyle
12393
12396
  }
12394
12397
  },
12395
12398
  /* @__PURE__ */ import_react35.default.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react35.default.createElement(
@@ -13187,7 +13190,7 @@ var Combobox = (0, import_react38.memo)(
13187
13190
  if (rest.mode === "string") {
13188
13191
  return {
13189
13192
  mode: rest.mode,
13190
- initialValue: rest.initialValue,
13193
+ value: rest.value,
13191
13194
  onChange: rest.onChange,
13192
13195
  onSelectItem: rest.onSelectItem,
13193
13196
  onHoverItem: rest.onHoverItem,
@@ -13197,7 +13200,7 @@ var Combobox = (0, import_react38.memo)(
13197
13200
  } else {
13198
13201
  return {
13199
13202
  mode: rest.mode,
13200
- initialValue: rest.initialValue,
13203
+ value: rest.value,
13201
13204
  onChange: rest.onChange,
13202
13205
  onSelectItem: rest.onSelectItem,
13203
13206
  onHoverItem: rest.onHoverItem,
@@ -13206,7 +13209,7 @@ var Combobox = (0, import_react38.memo)(
13206
13209
  }
13207
13210
  }, [
13208
13211
  rest.mode,
13209
- rest.initialValue,
13212
+ rest.value,
13210
13213
  rest.onChange,
13211
13214
  rest.onSelectItem,
13212
13215
  rest.onHoverItem,
@@ -13214,7 +13217,14 @@ var Combobox = (0, import_react38.memo)(
13214
13217
  rest.allowArbitraryValues
13215
13218
  ]);
13216
13219
  const ref = (0, import_react38.useRef)(null);
13217
- const initialValueString = typeof props.initialValue === "string" ? props.initialValue : props.initialValue?.name ?? "";
13220
+ function getInitialValueString() {
13221
+ if (props.mode === "string") {
13222
+ return props.value ?? "";
13223
+ } else {
13224
+ return props.value?.name ?? "";
13225
+ }
13226
+ }
13227
+ const initialValueString = getInitialValueString();
13218
13228
  const [comboboxState] = (0, import_react38.useState)(
13219
13229
  () => new ComboboxState(
13220
13230
  items,
@@ -13229,6 +13239,9 @@ var Combobox = (0, import_react38.memo)(
13229
13239
  (0, import_react38.useEffect)(() => {
13230
13240
  comboboxState.setItems(items);
13231
13241
  }, [items, comboboxState]);
13242
+ (0, import_react38.useEffect)(() => {
13243
+ comboboxState.setFilter(initialValueString);
13244
+ }, [comboboxState, initialValueString]);
13232
13245
  const { filter, selectedIndex, filteredItems } = state;
13233
13246
  const shouldShowMenu = isFocused && !(hideMenuWhenEmptyValue && filter === "");
13234
13247
  (0, import_react38.useEffect)(() => {
@@ -13443,9 +13456,10 @@ var Combobox = (0, import_react38.memo)(
13443
13456
  );
13444
13457
  (0, import_react38.useEffect)(() => {
13445
13458
  if (!shouldBlur) return;
13459
+ if (document.activeElement !== ref.current) return;
13460
+ setShouldBlur(false);
13446
13461
  ref.current?.focus();
13447
13462
  handleBlur();
13448
- setShouldBlur(false);
13449
13463
  }, [shouldBlur, handleBlur]);
13450
13464
  return /* @__PURE__ */ import_react38.default.createElement(
13451
13465
  InputField.Root,