@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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +42 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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
|
-
|
|
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
|
-
|
|
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: ${({ $
|
|
12515
|
+
background-color: ${({ $voiceListening }) => $voiceListening ? voiceListeningColor : "transparent"};
|
|
12516
12516
|
border: 0;
|
|
12517
12517
|
border-radius: 50% !important;
|
|
12518
|
-
color: ${({ $
|
|
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(
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
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:
|
|
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"
|