@nuskin/react-search-components 1.0.0-widget-integration.1 → 1.0.0-widget-integration.2

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.d.mts CHANGED
@@ -19,7 +19,6 @@ interface SearchMessageInputBaseProps extends Omit<ComponentPropsWithoutRef<'for
19
19
  onChange?: (value: string) => void;
20
20
  onSubmit: (message: string) => void;
21
21
  placeholder: string;
22
- submitLabel: string;
23
22
  /** When false, input value is preserved after submit (search mode). Defaults to true (chat mode). */
24
23
  clearOnSubmit?: boolean;
25
24
  value?: string;
@@ -38,7 +37,10 @@ type SearchMessageInputVoiceProps = {
38
37
  voiceListeningLabel?: never;
39
38
  };
40
39
  type SearchMessageInputProps = SearchMessageInputBaseProps & SearchMessageInputVoiceProps;
41
- declare function SearchMessageInput({ clearOnSubmit, inputLabel, onChange, onSubmit, onVoiceInput, placeholder, showVoiceInput, submitLabel, value, voiceInputLabel, voiceListening, voiceListeningLabel, ...props }: SearchMessageInputProps): React.JSX.Element;
40
+ /**
41
+ * The search box. There is no submit button: pressing Enter submits, as in master's search.
42
+ */
43
+ declare function SearchMessageInput({ clearOnSubmit, inputLabel, onChange, onSubmit, onVoiceInput, placeholder, showVoiceInput, value, voiceInputLabel, voiceListening, voiceListeningLabel, ...props }: SearchMessageInputProps): React.JSX.Element;
42
44
 
43
45
  interface SearchPanelProps extends Omit<ComponentPropsWithoutRef<'section'>, 'aria-label' | 'children'> {
44
46
  'aria-label': string;
package/dist/index.d.ts CHANGED
@@ -19,7 +19,6 @@ interface SearchMessageInputBaseProps extends Omit<ComponentPropsWithoutRef<'for
19
19
  onChange?: (value: string) => void;
20
20
  onSubmit: (message: string) => void;
21
21
  placeholder: string;
22
- submitLabel: string;
23
22
  /** When false, input value is preserved after submit (search mode). Defaults to true (chat mode). */
24
23
  clearOnSubmit?: boolean;
25
24
  value?: string;
@@ -38,7 +37,10 @@ type SearchMessageInputVoiceProps = {
38
37
  voiceListeningLabel?: never;
39
38
  };
40
39
  type SearchMessageInputProps = SearchMessageInputBaseProps & SearchMessageInputVoiceProps;
41
- declare function SearchMessageInput({ clearOnSubmit, inputLabel, onChange, onSubmit, onVoiceInput, placeholder, showVoiceInput, submitLabel, value, voiceInputLabel, voiceListening, voiceListeningLabel, ...props }: SearchMessageInputProps): React.JSX.Element;
40
+ /**
41
+ * The search box. There is no submit button: pressing Enter submits, as in master's search.
42
+ */
43
+ declare function SearchMessageInput({ clearOnSubmit, inputLabel, onChange, onSubmit, onVoiceInput, placeholder, showVoiceInput, value, voiceInputLabel, voiceListening, voiceListeningLabel, ...props }: SearchMessageInputProps): React.JSX.Element;
42
44
 
43
45
  interface SearchPanelProps extends Omit<ComponentPropsWithoutRef<'section'>, 'aria-label' | 'children'> {
44
46
  'aria-label': string;
package/dist/index.js CHANGED
@@ -12469,7 +12469,7 @@ var SearchMessageInputRoot = styled4__default.default.form`
12469
12469
  border-radius: 1.5rem;
12470
12470
  display: grid;
12471
12471
  gap: 0.5rem;
12472
- grid-template-columns: minmax(0, 1fr) auto;
12472
+ grid-template-columns: ${({ $hasActions = true }) => $hasActions ? "minmax(0, 1fr) auto" : "minmax(0, 1fr)"};
12473
12473
  inline-size: 100%;
12474
12474
  padding: 0.5rem;
12475
12475
 
@@ -12512,10 +12512,10 @@ var SearchMessageInputActionButton = styled4__default.default.button`
12512
12512
  &&&& {
12513
12513
  align-items: center;
12514
12514
  appearance: none;
12515
- background-color: ${({ $active, $voiceListening }) => $voiceListening ? voiceListeningColor : $active ? colors2.neutral[30] : "transparent"};
12515
+ background-color: ${({ $voiceListening }) => $voiceListening ? voiceListeningColor : "transparent"};
12516
12516
  border: 0;
12517
12517
  border-radius: 50% !important;
12518
- color: ${({ $active, $voiceListening }) => $voiceListening ? colors2.primary.white : $active ? colors2.neutral[20] : "inherit"};
12518
+ color: ${({ $voiceListening }) => $voiceListening ? colors2.primary.white : "inherit"};
12519
12519
  cursor: pointer;
12520
12520
  display: inline-flex;
12521
12521
  flex: 0 0 auto;
@@ -12572,7 +12572,6 @@ function SearchMessageInput({
12572
12572
  onVoiceInput,
12573
12573
  placeholder,
12574
12574
  showVoiceInput = false,
12575
- submitLabel,
12576
12575
  value,
12577
12576
  voiceInputLabel,
12578
12577
  voiceListening = false,
@@ -12605,61 +12604,44 @@ function SearchMessageInput({
12605
12604
  submitMessage();
12606
12605
  }
12607
12606
  }
12608
- return /* @__PURE__ */ jsxRuntime.jsxs(SearchMessageInputRoot, { ...props, $voiceListening: voiceListening, onSubmit: handleSubmit, children: [
12609
- /* @__PURE__ */ jsxRuntime.jsx(
12610
- SearchMessageInputField,
12611
- {
12612
- "aria-label": inputLabel,
12613
- onChange: (event) => {
12614
- setDraft(event.target.value);
12615
- onChange == null ? void 0 : onChange(event.target.value);
12616
- },
12617
- onKeyDown: handleKeyDown,
12618
- placeholder: voiceListening && !draft ? voiceListeningLabel : placeholder,
12619
- rows: 1,
12620
- value: draft
12621
- }
12622
- ),
12623
- /* @__PURE__ */ jsxRuntime.jsxs(SearchMessageInputActions, { children: [
12624
- showVoiceInput ? /* @__PURE__ */ jsxRuntime.jsx(
12625
- SearchMessageInputActionButton,
12626
- {
12627
- "aria-label": voiceInputLabel,
12628
- "aria-pressed": voiceListening,
12629
- $voiceListening: voiceListening,
12630
- onClick: onVoiceInput,
12631
- type: "button",
12632
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { cursor: ICON_CURSORS.POINTER, type: ICON_TYPES.VOICE })
12633
- }
12634
- ) : null,
12635
- /* @__PURE__ */ jsxRuntime.jsx(
12636
- SearchMessageInputActionButton,
12637
- {
12638
- $active: message.length > 0,
12639
- "aria-label": submitLabel,
12640
- disabled: message.length === 0,
12641
- type: "submit",
12642
- children: /* @__PURE__ */ jsxRuntime.jsx(
12643
- Icon,
12644
- {
12645
- cursor: ICON_CURSORS.POINTER,
12646
- type: message.length > 0 ? ICON_TYPES.ARROW_UP : ICON_TYPES.ASK_NUI
12647
- }
12648
- )
12649
- }
12650
- )
12651
- ] })
12652
- ] });
12607
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12608
+ SearchMessageInputRoot,
12609
+ {
12610
+ ...props,
12611
+ $hasActions: showVoiceInput,
12612
+ $voiceListening: voiceListening,
12613
+ onSubmit: handleSubmit,
12614
+ children: [
12615
+ /* @__PURE__ */ jsxRuntime.jsx(
12616
+ SearchMessageInputField,
12617
+ {
12618
+ "aria-label": inputLabel,
12619
+ onChange: (event) => {
12620
+ setDraft(event.target.value);
12621
+ onChange == null ? void 0 : onChange(event.target.value);
12622
+ },
12623
+ onKeyDown: handleKeyDown,
12624
+ placeholder: voiceListening && !draft ? voiceListeningLabel : placeholder,
12625
+ rows: 1,
12626
+ value: draft
12627
+ }
12628
+ ),
12629
+ showVoiceInput ? /* @__PURE__ */ jsxRuntime.jsx(SearchMessageInputActions, { children: /* @__PURE__ */ jsxRuntime.jsx(
12630
+ SearchMessageInputActionButton,
12631
+ {
12632
+ "aria-label": voiceInputLabel,
12633
+ "aria-pressed": voiceListening,
12634
+ $voiceListening: voiceListening,
12635
+ onClick: onVoiceInput,
12636
+ type: "button",
12637
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { cursor: ICON_CURSORS.POINTER, type: ICON_TYPES.VOICE })
12638
+ }
12639
+ ) }) : null
12640
+ ]
12641
+ }
12642
+ );
12653
12643
  }
12654
12644
  var { colors: colors3 } = foundationTheme.nuskinTheme;
12655
- styled4__default.default.div`
12656
- position: fixed;
12657
- inset: 0;
12658
- z-index: 10000;
12659
- background: rgba(0, 0, 0, 0.3);
12660
- display: flex;
12661
- flex-direction: column;
12662
- `;
12663
12645
  var SearchPanelRoot = styled4__default.default.section`
12664
12646
  background-color: ${colors3.primary.white};
12665
12647
  border-block-end: 1px solid ${colors3.neutral[30]};
@@ -12809,13 +12791,15 @@ var colors4 = {
12809
12791
  };
12810
12792
  var SearchModalBackdropRoot = styled4__default.default.div`
12811
12793
  -webkit-tap-highlight-color: transparent;
12812
- background-color: rgba(0, 0, 0, 0.3);
12794
+ background-color: transparent;
12813
12795
  inset: 0;
12814
12796
  position: fixed;
12815
12797
  `;
12816
12798
  var SearchModalSurface = styled4__default.default.div`
12817
12799
  inline-size: 100%;
12818
12800
  outline: none;
12801
+ position: relative;
12802
+ z-index: 1;
12819
12803
  `;
12820
12804
  var SearchSuggestionsPanel = styled4__default.default.div`
12821
12805
  position: relative;
@@ -13568,7 +13552,6 @@ function SearchModal({
13568
13552
  onChange: input.onChange,
13569
13553
  onSubmit: input.onSubmit,
13570
13554
  placeholder,
13571
- submitLabel: placeholder,
13572
13555
  value: input.value,
13573
13556
  clearOnSubmit: false,
13574
13557
  "data-testid": "search-modal-input"