@nuskin/react-search-components 1.0.0 → 1.1.0-cx130-2624.1

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
@@ -23,6 +23,10 @@ interface CatalogSuggestionItem {
23
23
  productStatus: string | undefined;
24
24
  status: string | undefined;
25
25
  cartActionDisabled: boolean;
26
+ requiresProductPage?: boolean;
27
+ inventoryStatus?: string;
28
+ dangerousGoods?: boolean;
29
+ skuCount?: number;
26
30
  customProductType: string;
27
31
  slug: string | null;
28
32
  productSlug: string | null;
@@ -79,10 +83,28 @@ interface SearchPanelCopy {
79
83
  addToCart: (productName: string) => string;
80
84
  /** The accessible name of a bundle's action button, given the bundle's name. */
81
85
  openBundle: (productName: string) => string;
86
+ /** The accessible name of the product title/image control. */
87
+ openProductPage: (productName: string) => string;
82
88
  /** Announced while suggestions load. */
83
89
  suggestionsLoading: string;
84
90
  /** Announced when suggestions appear, given how many, for example "3 suggestions available". */
85
91
  suggestionsCount: (count: number) => string;
92
+ /** Accessible name of the presentational voice mark, when NUi icons are shown. */
93
+ voiceSearch: string;
94
+ /** Accessible name of the presentational sparkle mark, when NUi icons are shown. */
95
+ askNui: string;
96
+ }
97
+ /** Contentstack live-preview tags for the fields this panel shows. */
98
+ interface SearchEditTags {
99
+ cancelLabel?: Record<string, string>;
100
+ cancelShowIcon?: Record<string, string>;
101
+ searchPlaceholder?: Record<string, string>;
102
+ searchAriaLabel?: Record<string, string>;
103
+ mobileRotatingPlaceholder?: Record<string, string>;
104
+ recentSearchesHeading?: Record<string, string>;
105
+ clearAllLabel?: Record<string, string>;
106
+ enableRecentSearches?: Record<string, string>;
107
+ enableAutocomplete?: Record<string, string>;
86
108
  }
87
109
  /** The search box, controlled by the host. */
88
110
  interface SearchPanelInputProps {
@@ -111,6 +133,8 @@ interface SearchPanelRecentSearches {
111
133
  items: ReadonlyArray<string>;
112
134
  onSelect: (query: string) => void;
113
135
  onClear: () => void;
136
+ /** Show the heading and clear control even when there are no chips yet. */
137
+ showWhenEmpty?: boolean;
114
138
  }
115
139
  interface SearchPanelProps {
116
140
  isOpen: boolean;
@@ -120,12 +144,27 @@ interface SearchPanelProps {
120
144
  copy: SearchPanelCopy;
121
145
  input: SearchPanelInputProps;
122
146
  suggestions: SearchPanelSuggestionsProps;
147
+ /** When false, typeahead rows stay hidden. Defaults to true. */
148
+ showSuggestions?: boolean;
123
149
  recentSearches?: SearchPanelRecentSearches;
124
150
  /**
125
151
  * An embedded agent (the NUi widget). When set, the panel switches to its agent layout: the
126
152
  * search box, suggestions and recent searches are replaced by this content.
127
153
  */
128
154
  agentPanel?: React.ReactNode;
155
+ /** Show the branded voice and sparkle marks in the search box. They are not controls. */
156
+ showNuiIcons?: boolean;
157
+ /**
158
+ * Show the close icon beside the cancel label on desktop. Mobile never shows it.
159
+ * Defaults to showing it.
160
+ */
161
+ showCancelIcon?: boolean;
162
+ /** Placeholder phrases that rotate on small screens while the box is empty. */
163
+ rotatingPlaceholders?: ReadonlyArray<string>;
164
+ /** How long each rotating phrase is shown, in milliseconds. */
165
+ rotatingPlaceholderIntervalMs?: number;
166
+ /** Live-preview tags for the cancel control and the extended search box. */
167
+ editTags?: SearchEditTags;
129
168
  }
130
169
 
131
170
  /**
@@ -140,6 +179,6 @@ interface SearchPanelProps {
140
179
  * Presentational: it holds only UI state (highlighted row, expanded recent searches). Fetching,
141
180
  * routing, navigation and all of its text belong to the host.
142
181
  */
143
- declare function SearchPanel({ isOpen, onClose, logo, fallbackImageUrl, copy, input, suggestions, recentSearches, agentPanel, }: Readonly<SearchPanelProps>): React.ReactElement | null;
182
+ declare function SearchPanel({ isOpen, onClose, logo, fallbackImageUrl, copy, input, suggestions, showSuggestions, recentSearches, agentPanel, showNuiIcons, showCancelIcon, rotatingPlaceholders, rotatingPlaceholderIntervalMs, editTags, }: Readonly<SearchPanelProps>): React.ReactElement | null;
144
183
 
145
- export { type CatalogSuggestionItem, type DidYouMeanItem, SearchPanel, type SearchPanelCopy, type SearchPanelInputProps, type SearchPanelProps, type SearchPanelRecentSearches, type SearchPanelSuggestionsProps, type SuggestionOption };
184
+ export { type CatalogSuggestionItem, type DidYouMeanItem, type SearchEditTags, SearchPanel, type SearchPanelCopy, type SearchPanelInputProps, type SearchPanelProps, type SearchPanelRecentSearches, type SearchPanelSuggestionsProps, type SuggestionOption };
package/dist/index.d.ts CHANGED
@@ -23,6 +23,10 @@ interface CatalogSuggestionItem {
23
23
  productStatus: string | undefined;
24
24
  status: string | undefined;
25
25
  cartActionDisabled: boolean;
26
+ requiresProductPage?: boolean;
27
+ inventoryStatus?: string;
28
+ dangerousGoods?: boolean;
29
+ skuCount?: number;
26
30
  customProductType: string;
27
31
  slug: string | null;
28
32
  productSlug: string | null;
@@ -79,10 +83,28 @@ interface SearchPanelCopy {
79
83
  addToCart: (productName: string) => string;
80
84
  /** The accessible name of a bundle's action button, given the bundle's name. */
81
85
  openBundle: (productName: string) => string;
86
+ /** The accessible name of the product title/image control. */
87
+ openProductPage: (productName: string) => string;
82
88
  /** Announced while suggestions load. */
83
89
  suggestionsLoading: string;
84
90
  /** Announced when suggestions appear, given how many, for example "3 suggestions available". */
85
91
  suggestionsCount: (count: number) => string;
92
+ /** Accessible name of the presentational voice mark, when NUi icons are shown. */
93
+ voiceSearch: string;
94
+ /** Accessible name of the presentational sparkle mark, when NUi icons are shown. */
95
+ askNui: string;
96
+ }
97
+ /** Contentstack live-preview tags for the fields this panel shows. */
98
+ interface SearchEditTags {
99
+ cancelLabel?: Record<string, string>;
100
+ cancelShowIcon?: Record<string, string>;
101
+ searchPlaceholder?: Record<string, string>;
102
+ searchAriaLabel?: Record<string, string>;
103
+ mobileRotatingPlaceholder?: Record<string, string>;
104
+ recentSearchesHeading?: Record<string, string>;
105
+ clearAllLabel?: Record<string, string>;
106
+ enableRecentSearches?: Record<string, string>;
107
+ enableAutocomplete?: Record<string, string>;
86
108
  }
87
109
  /** The search box, controlled by the host. */
88
110
  interface SearchPanelInputProps {
@@ -111,6 +133,8 @@ interface SearchPanelRecentSearches {
111
133
  items: ReadonlyArray<string>;
112
134
  onSelect: (query: string) => void;
113
135
  onClear: () => void;
136
+ /** Show the heading and clear control even when there are no chips yet. */
137
+ showWhenEmpty?: boolean;
114
138
  }
115
139
  interface SearchPanelProps {
116
140
  isOpen: boolean;
@@ -120,12 +144,27 @@ interface SearchPanelProps {
120
144
  copy: SearchPanelCopy;
121
145
  input: SearchPanelInputProps;
122
146
  suggestions: SearchPanelSuggestionsProps;
147
+ /** When false, typeahead rows stay hidden. Defaults to true. */
148
+ showSuggestions?: boolean;
123
149
  recentSearches?: SearchPanelRecentSearches;
124
150
  /**
125
151
  * An embedded agent (the NUi widget). When set, the panel switches to its agent layout: the
126
152
  * search box, suggestions and recent searches are replaced by this content.
127
153
  */
128
154
  agentPanel?: React.ReactNode;
155
+ /** Show the branded voice and sparkle marks in the search box. They are not controls. */
156
+ showNuiIcons?: boolean;
157
+ /**
158
+ * Show the close icon beside the cancel label on desktop. Mobile never shows it.
159
+ * Defaults to showing it.
160
+ */
161
+ showCancelIcon?: boolean;
162
+ /** Placeholder phrases that rotate on small screens while the box is empty. */
163
+ rotatingPlaceholders?: ReadonlyArray<string>;
164
+ /** How long each rotating phrase is shown, in milliseconds. */
165
+ rotatingPlaceholderIntervalMs?: number;
166
+ /** Live-preview tags for the cancel control and the extended search box. */
167
+ editTags?: SearchEditTags;
129
168
  }
130
169
 
131
170
  /**
@@ -140,6 +179,6 @@ interface SearchPanelProps {
140
179
  * Presentational: it holds only UI state (highlighted row, expanded recent searches). Fetching,
141
180
  * routing, navigation and all of its text belong to the host.
142
181
  */
143
- declare function SearchPanel({ isOpen, onClose, logo, fallbackImageUrl, copy, input, suggestions, recentSearches, agentPanel, }: Readonly<SearchPanelProps>): React.ReactElement | null;
182
+ declare function SearchPanel({ isOpen, onClose, logo, fallbackImageUrl, copy, input, suggestions, showSuggestions, recentSearches, agentPanel, showNuiIcons, showCancelIcon, rotatingPlaceholders, rotatingPlaceholderIntervalMs, editTags, }: Readonly<SearchPanelProps>): React.ReactElement | null;
144
183
 
145
- export { type CatalogSuggestionItem, type DidYouMeanItem, SearchPanel, type SearchPanelCopy, type SearchPanelInputProps, type SearchPanelProps, type SearchPanelRecentSearches, type SearchPanelSuggestionsProps, type SuggestionOption };
184
+ export { type CatalogSuggestionItem, type DidYouMeanItem, type SearchEditTags, SearchPanel, type SearchPanelCopy, type SearchPanelInputProps, type SearchPanelProps, type SearchPanelRecentSearches, type SearchPanelSuggestionsProps, type SuggestionOption };