@lets-events/react 12.11.6 → 12.11.7

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- > @lets-events/react@12.11.6 build
3
+ > @lets-events/react@12.11.7 build
4
4
  > tsup src/index.tsx --format esm,cjs --dts --external react
5
5
 
6
6
  CLI Building entry: src/index.tsx
@@ -10,12 +10,12 @@
10
10
  CLI Target: es6
11
11
  ESM Build start
12
12
  CJS Build start
13
- CJS dist/index.js 439.74 KB
14
- CJS ⚡️ Build success in 354ms
15
- ESM dist/index.mjs 423.59 KB
16
- ESM ⚡️ Build success in 355ms
13
+ ESM dist/index.mjs 423.79 KB
14
+ ESM ⚡️ Build success in 288ms
15
+ CJS dist/index.js 439.94 KB
16
+ CJS ⚡️ Build success in 289ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 7026ms
18
+ DTS ⚡️ Build success in 6480ms
19
19
  DTS dist/index.d.mts 411.35 KB
20
20
  DTS dist/index.d.ts 411.35 KB
21
21
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.11.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Placeholder SelectFormField
8
+
3
9
  ## 12.11.6
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -11540,10 +11540,11 @@ var SelectFormField = ({
11540
11540
  defaultValue: defaultValue || "",
11541
11541
  render: ({ field: { value, onChange } }) => {
11542
11542
  const selectedOption = options.find((opt) => opt.value === value);
11543
+ const hasSelectedLabel = !!(selectedOption == null ? void 0 : selectedOption.selectedLabel);
11543
11544
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
11544
11545
  DropdownMenu2,
11545
11546
  {
11546
- placeholder: (selectedOption == null ? void 0 : selectedOption.selectedLabel) || placeholder,
11547
+ placeholder: selectedOption ? hasSelectedLabel ? selectedOption == null ? void 0 : selectedOption.selectedLabel : selectedOption == null ? void 0 : selectedOption.label : placeholder,
11547
11548
  typography: placeholderTypography,
11548
11549
  fontWeight: "regular",
11549
11550
  color: haveError ? "error" : "default",
@@ -11554,7 +11555,7 @@ var SelectFormField = ({
11554
11555
  value: option.value,
11555
11556
  onSelect: () => onChange(option.value),
11556
11557
  fontWeight: "regular",
11557
- typography: "labelLarge",
11558
+ typography: placeholderTypography,
11558
11559
  children: option.label
11559
11560
  },
11560
11561
  `${option.value}${index}`
package/dist/index.mjs CHANGED
@@ -11432,10 +11432,11 @@ var SelectFormField = ({
11432
11432
  defaultValue: defaultValue || "",
11433
11433
  render: ({ field: { value, onChange } }) => {
11434
11434
  const selectedOption = options.find((opt) => opt.value === value);
11435
+ const hasSelectedLabel = !!(selectedOption == null ? void 0 : selectedOption.selectedLabel);
11435
11436
  return /* @__PURE__ */ jsxs24(
11436
11437
  DropdownMenu2,
11437
11438
  {
11438
- placeholder: (selectedOption == null ? void 0 : selectedOption.selectedLabel) || placeholder,
11439
+ placeholder: selectedOption ? hasSelectedLabel ? selectedOption == null ? void 0 : selectedOption.selectedLabel : selectedOption == null ? void 0 : selectedOption.label : placeholder,
11439
11440
  typography: placeholderTypography,
11440
11441
  fontWeight: "regular",
11441
11442
  color: haveError ? "error" : "default",
@@ -11446,7 +11447,7 @@ var SelectFormField = ({
11446
11447
  value: option.value,
11447
11448
  onSelect: () => onChange(option.value),
11448
11449
  fontWeight: "regular",
11449
- typography: "labelLarge",
11450
+ typography: placeholderTypography,
11450
11451
  children: option.label
11451
11452
  },
11452
11453
  `${option.value}${index}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.11.6",
3
+ "version": "12.11.7",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -73,9 +73,10 @@ export const SelectFormField = ({
73
73
  defaultValue={defaultValue || ""}
74
74
  render={({ field: { value, onChange } }) => {
75
75
  const selectedOption = options.find((opt) => opt.value === value);
76
+ const hasSelectedLabel = !!selectedOption?.selectedLabel;
76
77
  return (
77
78
  <DropdownMenu
78
- placeholder={selectedOption?.selectedLabel || placeholder}
79
+ placeholder={selectedOption ? (hasSelectedLabel ? selectedOption?.selectedLabel : selectedOption?.label as string) : placeholder}
79
80
  typography={placeholderTypography}
80
81
  fontWeight="regular"
81
82
  color={haveError ? "error" : "default"}
@@ -86,7 +87,7 @@ export const SelectFormField = ({
86
87
  value={option.value}
87
88
  onSelect={() => onChange(option.value)}
88
89
  fontWeight="regular"
89
- typography="labelLarge"
90
+ typography={placeholderTypography}
90
91
  >
91
92
  {option.label}
92
93
  </DropdownMenuItem>