@choice-ui/react 1.8.9 → 1.9.0

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.
@@ -244,13 +244,6 @@ var buttonTv = tcv({
244
244
  loading: false,
245
245
  variant: "dark",
246
246
  class: { button: "active:bg-gray-600" }
247
- },
248
- {
249
- disabled: false,
250
- loading: false,
251
- variant: "secondary",
252
- active: false,
253
- class: { button: "hover:bg-secondary-background" }
254
247
  }
255
248
  ],
256
249
  defaultVariants: {
@@ -1,14 +1,6 @@
1
1
  import { HTMLProps, ReactNode } from 'react';
2
2
  import * as react from 'react';
3
3
 
4
- interface CheckboxIconProps extends Omit<HTMLProps<HTMLDivElement>, "children"> {
5
- children?: ReactNode | ((props: {
6
- value?: boolean;
7
- mixed?: boolean;
8
- }) => ReactNode);
9
- }
10
- declare const CheckboxIcon: react.MemoExoticComponent<react.ForwardRefExoticComponent<Omit<CheckboxIconProps, "ref"> & react.RefAttributes<HTMLDivElement>>>;
11
-
12
4
  interface CheckboxLabelProps extends Omit<HTMLProps<HTMLLabelElement>, "htmlFor" | "id" | "disabled"> {
13
5
  children: ReactNode;
14
6
  }
@@ -28,10 +20,9 @@ interface CheckboxType {
28
20
  (props: CheckboxProps & {
29
21
  ref?: React.Ref<HTMLInputElement>;
30
22
  }): JSX.Element;
31
- Icon: typeof CheckboxIcon;
32
23
  Label: typeof CheckboxLabel;
33
24
  displayName?: string;
34
25
  }
35
26
  declare const Checkbox: CheckboxType;
36
27
 
37
- export { Checkbox, type CheckboxIconProps, type CheckboxLabelProps, type CheckboxProps };
28
+ export { Checkbox, type CheckboxProps };
@@ -1,5 +1,5 @@
1
1
  import { Indeterminate, Check } from "@choiceform/icons-react";
2
- import { memo, forwardRef, useId, Children, isValidElement, createContext, useContext } from "react";
2
+ import { memo, forwardRef, useId, createContext, useContext } from "react";
3
3
  import { useEventCallback } from "usehooks-ts";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { tcv, tcx } from "../../../shared/utils/tcx/tcx.js";
@@ -137,38 +137,6 @@ var checkboxTv = tcv({
137
137
  focused: false
138
138
  }
139
139
  });
140
- var CheckboxIcon = memo(
141
- forwardRef(function CheckboxIcon2(props, ref) {
142
- const { className, children, ...rest } = props;
143
- const { value, mixed, disabled, variant } = useCheckboxContext();
144
- const tv = checkboxTv({
145
- type: "checkbox",
146
- variant,
147
- disabled,
148
- checked: value || mixed
149
- });
150
- const renderIcon = () => {
151
- if (typeof children === "function") {
152
- return children({ value, mixed });
153
- }
154
- if (children !== void 0) {
155
- return children;
156
- }
157
- return mixed ? /* @__PURE__ */ jsx(Indeterminate, {}) : value ? /* @__PURE__ */ jsx(Check, {}) : null;
158
- };
159
- return /* @__PURE__ */ jsx(
160
- "div",
161
- {
162
- ref,
163
- className: tcx(tv.box(), className),
164
- "data-active": value,
165
- ...rest,
166
- children: renderIcon()
167
- }
168
- );
169
- })
170
- );
171
- CheckboxIcon.displayName = "Checkbox.Icon";
172
140
  var CheckboxLabel = memo(
173
141
  forwardRef(function CheckboxLabel2(props, ref) {
174
142
  const { children, className, ...rest } = props;
@@ -227,23 +195,12 @@ var CheckboxBase = forwardRef(function Checkbox(props, ref) {
227
195
  }
228
196
  onKeyDown == null ? void 0 : onKeyDown(e);
229
197
  });
230
- const isIconElement = (child) => {
231
- var _a;
232
- return isValidElement(child) && (child.type === CheckboxIcon || ((_a = child.type) == null ? void 0 : _a.displayName) === "Checkbox.Icon");
233
- };
234
- const childArray = Children.toArray(children);
235
- const iconChild = childArray.find(isIconElement);
236
- const otherChildren = childArray.filter((child) => !isIconElement(child));
237
198
  const renderChildren = () => {
238
- if (otherChildren.length === 1) {
239
- const child = otherChildren[0];
240
- if (typeof child === "string" || typeof child === "number") {
241
- return /* @__PURE__ */ jsx(CheckboxLabel, { children: child });
242
- }
199
+ if (typeof children === "string" || typeof children === "number") {
200
+ return /* @__PURE__ */ jsx(CheckboxLabel, { children });
243
201
  }
244
- return otherChildren;
202
+ return children;
245
203
  };
246
- const renderDefaultIcon = () => /* @__PURE__ */ jsx("div", { className: tv.box(), children: mixed ? /* @__PURE__ */ jsx(Indeterminate, {}) : value ? /* @__PURE__ */ jsx(Check, {}) : null });
247
204
  return /* @__PURE__ */ jsx(
248
205
  CheckboxContext.Provider,
249
206
  {
@@ -277,7 +234,7 @@ var CheckboxBase = forwardRef(function Checkbox(props, ref) {
277
234
  ...rest
278
235
  }
279
236
  ),
280
- iconChild ?? renderDefaultIcon()
237
+ /* @__PURE__ */ jsx("div", { className: tv.box(), children: mixed ? /* @__PURE__ */ jsx(Indeterminate, {}) : value ? /* @__PURE__ */ jsx(Check, {}) : null })
281
238
  ] }),
282
239
  renderChildren()
283
240
  ] })
@@ -286,7 +243,6 @@ var CheckboxBase = forwardRef(function Checkbox(props, ref) {
286
243
  });
287
244
  var MemoizedCheckbox = memo(CheckboxBase);
288
245
  var Checkbox2 = MemoizedCheckbox;
289
- Checkbox2.Icon = CheckboxIcon;
290
246
  Checkbox2.Label = CheckboxLabel;
291
247
  Checkbox2.displayName = "Checkbox";
292
248
  export {
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Button } from "../../../button/dist/index.js";
3
- import { Range as Range2 } from "../../../range/dist/index.js";
3
+ import { Range } from "../../../range/dist/index.js";
4
4
  import React__default, { memo, useState, useRef, useMemo, useEffect, useCallback } from "react";
5
5
  import { useEventCallback } from "usehooks-ts";
6
6
  import { ColorImageToolbar } from "./color-image-toolbar.js";
@@ -209,7 +209,7 @@ const ColorImagePaint = memo(function ColorImagePaint2(props) {
209
209
  return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
210
210
  /* @__PURE__ */ jsx("span", { className: styles.adjustLabel(), children: (_a2 = features == null ? void 0 : features.labels) == null ? void 0 : _a2[filterName] }),
211
211
  /* @__PURE__ */ jsx(
212
- Range2,
212
+ Range,
213
213
  {
214
214
  min: -100,
215
215
  max: 100,
@@ -7,12 +7,6 @@ interface DropdownProps {
7
7
  * @default true
8
8
  */
9
9
  autoSelectFirstItem?: boolean;
10
- /**
11
- * Whether to avoid collisions by flipping or shifting the dropdown position.
12
- * When false, the dropdown will strictly follow the placement direction.
13
- * @default true
14
- */
15
- avoidCollisions?: boolean;
16
10
  children?: React.ReactNode;
17
11
  disabledNested?: boolean;
18
12
  focusManagerProps?: Partial<FloatingFocusManagerProps>;
@@ -13,7 +13,6 @@ var DropdownComponent = memo(function DropdownComponent2(props) {
13
13
  const {
14
14
  children,
15
15
  autoSelectFirstItem = true,
16
- avoidCollisions = true,
17
16
  disabledNested = false,
18
17
  offset: offsetDistance = DEFAULT_OFFSET,
19
18
  placement = "bottom-start",
@@ -78,14 +77,11 @@ var DropdownComponent = memo(function DropdownComponent2(props) {
78
77
  });
79
78
  });
80
79
  const lastPositionRef = useRef(null);
81
- const middleware = useMemo(() => {
82
- const baseMiddleware = [
83
- offset({ mainAxis: isNested ? 10 : offsetDistance, alignmentAxis: isNested ? -4 : 0 })
84
- ];
85
- if (avoidCollisions) {
86
- baseMiddleware.push(flip(), shift());
87
- }
88
- baseMiddleware.push(
80
+ const middleware = useMemo(
81
+ () => [
82
+ offset({ mainAxis: isNested ? 10 : offsetDistance, alignmentAxis: isNested ? -4 : 0 }),
83
+ flip(),
84
+ shift(),
89
85
  size({
90
86
  padding: 4,
91
87
  apply({ elements, availableHeight, rects }) {
@@ -108,9 +104,9 @@ var DropdownComponent = memo(function DropdownComponent2(props) {
108
104
  }
109
105
  }
110
106
  })
111
- );
112
- return baseMiddleware;
113
- }, [isNested, offsetDistance, matchTriggerWidth, scrollRef, avoidCollisions]);
107
+ ],
108
+ [isNested, offsetDistance, matchTriggerWidth, scrollRef]
109
+ );
114
110
  const { refs, floatingStyles, context, isPositioned } = useFloating({
115
111
  nodeId,
116
112
  open: isControlledOpen,
@@ -54,7 +54,7 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
54
54
  }
55
55
  onOpenChange == null ? void 0 : onOpenChange(newOpen);
56
56
  });
57
- const { nodeId, item, isNested } = useMenuTree({
57
+ const { nodeId, item, isNested, tree } = useMenuTree({
58
58
  disabledNested,
59
59
  handleOpenChange,
60
60
  isControlledOpen
@@ -169,11 +169,17 @@ const DropdownComponent = memo(function DropdownComponent2(props) {
169
169
  bubbles: true,
170
170
  escapeKey: true
171
171
  });
172
+ const handleNavigate = useEventCallback((index) => {
173
+ setActiveIndex(index);
174
+ if (tree && index !== null) {
175
+ tree.events.emit("navigate", { nodeId, index });
176
+ }
177
+ });
172
178
  const listNavigation = useListNavigation(context, {
173
179
  listRef: elementsRef,
174
180
  activeIndex,
175
181
  nested: isNested,
176
- onNavigate: setActiveIndex,
182
+ onNavigate: handleNavigate,
177
183
  loop: true
178
184
  });
179
185
  const typeahead = useTypeahead(context, {
@@ -15,24 +15,12 @@ type VirtualItem = {
15
15
  emojis: EmojiData[];
16
16
  type: "emojis";
17
17
  };
18
- interface CategoryNames {
19
- activities: string;
20
- animalsNature: string;
21
- flags: string;
22
- foodDrink: string;
23
- frequentlyUsed: string;
24
- objects: string;
25
- smileysPeople: string;
26
- symbols: string;
27
- travelPlaces: string;
28
- }
29
18
  interface UseEmojiDataProps {
30
- categoryNames?: CategoryNames;
31
19
  columns: number;
32
20
  searchQuery: string;
33
21
  showFrequentlyUsed: boolean;
34
22
  }
35
- declare function useEmojiData({ searchQuery, columns, showFrequentlyUsed, categoryNames, }: UseEmojiDataProps): {
23
+ declare function useEmojiData({ searchQuery, columns, showFrequentlyUsed }: UseEmojiDataProps): {
36
24
  categorizedData: VirtualItem[];
37
25
  categoryIndexMap: Map<EmojiCategory, number>;
38
26
  searchResults: {
@@ -64,22 +52,6 @@ interface EmojiPickerProps {
64
52
  showFooter?: boolean;
65
53
  value?: EmojiData | null;
66
54
  variant?: "default" | "dark" | "light";
67
- i18n?: {
68
- noEmojisFoundTitle?: string;
69
- noEmojisFoundDescription?: string;
70
- footerPickAnEmoji?: string;
71
- categories?: {
72
- frequentlyUsed: string;
73
- smileysPeople: string;
74
- animalsNature: string;
75
- foodDrink: string;
76
- travelPlaces: string;
77
- activities: string;
78
- objects: string;
79
- symbols: string;
80
- flags: string;
81
- };
82
- };
83
55
  }
84
56
  declare const EmojiPicker: React.NamedExoticComponent<EmojiPickerProps>;
85
57
 
@@ -141,7 +141,7 @@ var emojiFooterTv = tcv({
141
141
  var emojiEmptyTv = tcv({
142
142
  slots: {
143
143
  container: "flex h-32 flex-col items-center justify-center p-4 text-center",
144
- title: "text-body-large-strong",
144
+ title: "text-heading-display",
145
145
  description: "mt-2 w-32"
146
146
  },
147
147
  variants: {
@@ -179,20 +179,13 @@ var EmojiCategoryHeader = forwardRef(
179
179
  );
180
180
  }
181
181
  );
182
- var EmojiFooter = memo(function EmojiFooter2({
183
- hoveredEmoji,
184
- selectedEmoji,
185
- variant = "dark",
186
- i18n = {
187
- pickAnEmoji: "Pick an emoji..."
188
- }
189
- }) {
182
+ function EmojiFooter({ hoveredEmoji, selectedEmoji, variant = "dark" }) {
190
183
  var _a, _b;
191
184
  const tv = emojiFooterTv({ variant });
192
185
  return /* @__PURE__ */ jsxs("div", { className: tv.footer(), children: [
193
186
  /* @__PURE__ */ jsx("div", { className: tv.emojiPreview(), children: ((_a = hoveredEmoji || selectedEmoji) == null ? void 0 : _a.emoji) || /* @__PURE__ */ jsx("div", { className: tv.emojiPreviewEmpty() }) }),
194
187
  /* @__PURE__ */ jsxs("div", { className: tv.emojiInfo(), children: [
195
- /* @__PURE__ */ jsx("div", { className: tv.emojiName(), children: (hoveredEmoji == null ? void 0 : hoveredEmoji.name) || (selectedEmoji == null ? void 0 : selectedEmoji.name) || i18n.pickAnEmoji }),
188
+ /* @__PURE__ */ jsx("div", { className: tv.emojiName(), children: (hoveredEmoji == null ? void 0 : hoveredEmoji.name) || (selectedEmoji == null ? void 0 : selectedEmoji.name) || "Pick an emoji..." }),
196
189
  hoveredEmoji || selectedEmoji ? /* @__PURE__ */ jsxs("div", { className: tv.emojiCode(), children: [
197
190
  ":",
198
191
  (_b = hoveredEmoji || selectedEmoji) == null ? void 0 : _b.nameUrl,
@@ -200,7 +193,7 @@ var EmojiFooter = memo(function EmojiFooter2({
200
193
  ] }) : /* @__PURE__ */ jsx(Fragment, {})
201
194
  ] })
202
195
  ] });
203
- });
196
+ }
204
197
  var EmojiItem = memo(function EmojiItem2(props) {
205
198
  const { emoji, onSelect, onHover, selected = false, variant = "dark" } = props;
206
199
  return /* @__PURE__ */ jsx(
@@ -216,17 +209,11 @@ var EmojiItem = memo(function EmojiItem2(props) {
216
209
  }
217
210
  );
218
211
  });
219
- var EmojiEmpty = memo(function EmojiEmpty2({
220
- variant = "dark",
221
- i18n = {
222
- title: "No emoji found",
223
- description: "You can search for an emoji by name or use the search bar to find it."
224
- }
225
- }) {
212
+ var EmojiEmpty = memo(function EmojiEmpty2({ variant = "dark" }) {
226
213
  const tv = emojiEmptyTv({ variant });
227
214
  return /* @__PURE__ */ jsxs("div", { className: tv.container(), children: [
228
- /* @__PURE__ */ jsx("div", { className: tv.title(), children: i18n.title }),
229
- /* @__PURE__ */ jsx("p", { className: tv.description(), children: i18n.description })
215
+ /* @__PURE__ */ jsx("div", { className: tv.title(), children: "No emoji found" }),
216
+ /* @__PURE__ */ jsx("p", { className: tv.description(), children: "You can search for an emoji by name or use the search bar to find it." })
230
217
  ] });
231
218
  });
232
219
  var emojis = [
@@ -11740,15 +11727,15 @@ var emojis = [
11740
11727
  }
11741
11728
  ];
11742
11729
  var categories = [
11743
- { id: "frequently_used" },
11744
- { id: "smileys_people", range: [1, 460] },
11745
- { id: "animals_nature", range: [465, 591] },
11746
- { id: "food_drink", range: [592, 712] },
11747
- { id: "travel_places", range: [713, 922] },
11748
- { id: "activities", range: [923, 1001] },
11749
- { id: "objects", range: [1002, 1234] },
11750
- { id: "symbols", range: [1235, 1451] },
11751
- { id: "flags", range: [1452, 1719] }
11730
+ { id: "frequently_used", name: "Frequently used" },
11731
+ { id: "smileys_people", name: "Smileys & People", range: [1, 460] },
11732
+ { id: "animals_nature", name: "Animals & Nature", range: [465, 591] },
11733
+ { id: "food_drink", name: "Food & Drink", range: [592, 712] },
11734
+ { id: "travel_places", name: "Travel & Places", range: [713, 922] },
11735
+ { id: "activities", name: "Activities", range: [923, 1001] },
11736
+ { id: "objects", name: "Objects", range: [1002, 1234] },
11737
+ { id: "symbols", name: "Symbols", range: [1235, 1451] },
11738
+ { id: "flags", name: "Flags", range: [1452, 1719] }
11752
11739
  ];
11753
11740
  var STORAGE_KEY = "emoji-picker-frequently-used";
11754
11741
  function getEmojiCategory(id) {
@@ -11782,34 +11769,7 @@ function saveFrequentlyUsedEmoji(emojiId) {
11782
11769
  } catch {
11783
11770
  }
11784
11771
  }
11785
- var defaultCategoryNames = {
11786
- frequentlyUsed: "Frequently used",
11787
- smileysPeople: "Smileys & People",
11788
- animalsNature: "Animals & Nature",
11789
- foodDrink: "Food & Drink",
11790
- travelPlaces: "Travel & Places",
11791
- activities: "Activities",
11792
- objects: "Objects",
11793
- symbols: "Symbols",
11794
- flags: "Flags"
11795
- };
11796
- var categoryIdToI18nKey = {
11797
- frequently_used: "frequentlyUsed",
11798
- smileys_people: "smileysPeople",
11799
- animals_nature: "animalsNature",
11800
- food_drink: "foodDrink",
11801
- travel_places: "travelPlaces",
11802
- activities: "activities",
11803
- objects: "objects",
11804
- symbols: "symbols",
11805
- flags: "flags"
11806
- };
11807
- function useEmojiData({
11808
- searchQuery,
11809
- columns,
11810
- showFrequentlyUsed,
11811
- categoryNames = defaultCategoryNames
11812
- }) {
11772
+ function useEmojiData({ searchQuery, columns, showFrequentlyUsed }) {
11813
11773
  const [frequentlyUsed, setFrequentlyUsed] = useState([]);
11814
11774
  useEffect(() => {
11815
11775
  if (showFrequentlyUsed) {
@@ -11839,7 +11799,7 @@ function useEmojiData({
11839
11799
  items.push({
11840
11800
  type: "header",
11841
11801
  category: "frequently_used",
11842
- title: categoryNames.frequentlyUsed
11802
+ title: "Frequently used"
11843
11803
  });
11844
11804
  for (let i = 0; i < frequentlyUsed.length; i += columns) {
11845
11805
  items.push({
@@ -11854,11 +11814,10 @@ function useEmojiData({
11854
11814
  (emoji) => emoji.id >= category.range[0] && emoji.id <= category.range[1]
11855
11815
  );
11856
11816
  if (categoryEmojis.length > 0) {
11857
- const i18nKey = categoryIdToI18nKey[category.id];
11858
11817
  items.push({
11859
11818
  type: "header",
11860
11819
  category: category.id,
11861
- title: i18nKey ? categoryNames[i18nKey] : category.id
11820
+ title: category.name
11862
11821
  });
11863
11822
  for (let i = 0; i < categoryEmojis.length; i += columns) {
11864
11823
  items.push({
@@ -11869,7 +11828,7 @@ function useEmojiData({
11869
11828
  }
11870
11829
  });
11871
11830
  return items;
11872
- }, [searchQuery, searchResults, frequentlyUsed, columns, showFrequentlyUsed, categoryNames]);
11831
+ }, [searchQuery, searchResults, frequentlyUsed, columns, showFrequentlyUsed]);
11873
11832
  const categoryIndexMap = useMemo(() => {
11874
11833
  const map = /* @__PURE__ */ new Map();
11875
11834
  categorizedData.forEach((item, index) => {
@@ -11925,8 +11884,6 @@ function useEmojiScroll({
11925
11884
  const [currentVisibleCategory, setCurrentVisibleCategory] = useState("frequently_used");
11926
11885
  const isScrollingToTarget = useRef(false);
11927
11886
  const isInternalUpdate = useRef(false);
11928
- const scrollingTimeoutRef = useRef(null);
11929
- const internalUpdateTimeoutRef = useRef(null);
11930
11887
  const virtualizer = useVirtualizer({
11931
11888
  count: categorizedData.length,
11932
11889
  getScrollElement: () => scrollRef.current,
@@ -11991,10 +11948,7 @@ function useEmojiScroll({
11991
11948
  align: "start",
11992
11949
  behavior: "auto"
11993
11950
  });
11994
- if (scrollingTimeoutRef.current) {
11995
- clearTimeout(scrollingTimeoutRef.current);
11996
- }
11997
- scrollingTimeoutRef.current = setTimeout(() => {
11951
+ setTimeout(() => {
11998
11952
  isScrollingToTarget.current = false;
11999
11953
  }, 100);
12000
11954
  }
@@ -12007,33 +11961,17 @@ function useEmojiScroll({
12007
11961
  align: "center",
12008
11962
  behavior: "auto"
12009
11963
  });
12010
- if (scrollingTimeoutRef.current) {
12011
- clearTimeout(scrollingTimeoutRef.current);
12012
- }
12013
- scrollingTimeoutRef.current = setTimeout(() => {
11964
+ setTimeout(() => {
12014
11965
  isScrollingToTarget.current = false;
12015
11966
  }, 100);
12016
11967
  }
12017
11968
  });
12018
11969
  const markInternalUpdate = useEventCallback(() => {
12019
11970
  isInternalUpdate.current = true;
12020
- if (internalUpdateTimeoutRef.current) {
12021
- clearTimeout(internalUpdateTimeoutRef.current);
12022
- }
12023
- internalUpdateTimeoutRef.current = setTimeout(() => {
11971
+ setTimeout(() => {
12024
11972
  isInternalUpdate.current = false;
12025
11973
  }, 50);
12026
11974
  });
12027
- useEffect(() => {
12028
- return () => {
12029
- if (scrollingTimeoutRef.current) {
12030
- clearTimeout(scrollingTimeoutRef.current);
12031
- }
12032
- if (internalUpdateTimeoutRef.current) {
12033
- clearTimeout(internalUpdateTimeoutRef.current);
12034
- }
12035
- };
12036
- }, []);
12037
11975
  useEffect(() => {
12038
11976
  if (value && !searchQuery.trim() && !isInternalUpdate.current) {
12039
11977
  scrollToEmoji(value);
@@ -12058,6 +11996,17 @@ function useEmojiScroll({
12058
11996
  PADDING
12059
11997
  };
12060
11998
  }
11999
+ var categoriesWithIcons = [
12000
+ { id: "frequently_used", name: "Frequently used", icon: /* @__PURE__ */ jsx(EmojiFrequentlyUsed, {}) },
12001
+ { id: "smileys_people", name: "Smileys & People", icon: /* @__PURE__ */ jsx(EmojiSmileysPeople, {}) },
12002
+ { id: "animals_nature", name: "Animals & Nature", icon: /* @__PURE__ */ jsx(EmojiAnimalsNature, {}) },
12003
+ { id: "food_drink", name: "Food & Drink", icon: /* @__PURE__ */ jsx(EmojiFoodDrink, {}) },
12004
+ { id: "travel_places", name: "Travel & Places", icon: /* @__PURE__ */ jsx(EmojiTravelPlaces, {}) },
12005
+ { id: "activities", name: "Activities", icon: /* @__PURE__ */ jsx(EmojiActivity, {}) },
12006
+ { id: "objects", name: "Objects", icon: /* @__PURE__ */ jsx(EmojiObjects, {}) },
12007
+ { id: "symbols", name: "Symbols", icon: /* @__PURE__ */ jsx(EmojiSymbols, {}) },
12008
+ { id: "flags", name: "Flags", icon: /* @__PURE__ */ jsx(EmojiFlags, {}) }
12009
+ ];
12061
12010
  var EmojiPicker = memo(function EmojiPicker2({
12062
12011
  value,
12063
12012
  onChange,
@@ -12070,49 +12019,11 @@ var EmojiPicker = memo(function EmojiPicker2({
12070
12019
  showSearch = true,
12071
12020
  showFooter = true,
12072
12021
  children,
12073
- variant = "dark",
12074
- i18n = {
12075
- noEmojisFoundTitle: "No emoji found",
12076
- noEmojisFoundDescription: "You can search for an emoji by name or use the search bar to find it.",
12077
- footerPickAnEmoji: "Pick an emoji...",
12078
- categories: {
12079
- frequentlyUsed: "Frequently used",
12080
- smileysPeople: "Smileys & People",
12081
- animalsNature: "Animals & Nature",
12082
- foodDrink: "Food & Drink",
12083
- travelPlaces: "Travel & Places",
12084
- activities: "Activities",
12085
- objects: "Objects",
12086
- symbols: "Symbols",
12087
- flags: "Flags"
12088
- }
12089
- }
12022
+ variant = "dark"
12090
12023
  }) {
12091
12024
  const [searchQuery, setSearchQuery] = useState("");
12092
12025
  const [hoveredEmoji, setHoveredEmoji] = useState(null);
12093
- const safeColumns = Math.max(1, columns);
12094
12026
  const tv = emojiTv({ variant });
12095
- const categoriesWithIcons = useMemo(
12096
- () => {
12097
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12098
- return [
12099
- {
12100
- id: "frequently_used",
12101
- name: (_a = i18n.categories) == null ? void 0 : _a.frequentlyUsed,
12102
- icon: /* @__PURE__ */ jsx(EmojiFrequentlyUsed, {})
12103
- },
12104
- { id: "smileys_people", name: (_b = i18n.categories) == null ? void 0 : _b.smileysPeople, icon: /* @__PURE__ */ jsx(EmojiSmileysPeople, {}) },
12105
- { id: "animals_nature", name: (_c = i18n.categories) == null ? void 0 : _c.animalsNature, icon: /* @__PURE__ */ jsx(EmojiAnimalsNature, {}) },
12106
- { id: "food_drink", name: (_d = i18n.categories) == null ? void 0 : _d.foodDrink, icon: /* @__PURE__ */ jsx(EmojiFoodDrink, {}) },
12107
- { id: "travel_places", name: (_e = i18n.categories) == null ? void 0 : _e.travelPlaces, icon: /* @__PURE__ */ jsx(EmojiTravelPlaces, {}) },
12108
- { id: "activities", name: (_f = i18n.categories) == null ? void 0 : _f.activities, icon: /* @__PURE__ */ jsx(EmojiActivity, {}) },
12109
- { id: "objects", name: (_g = i18n.categories) == null ? void 0 : _g.objects, icon: /* @__PURE__ */ jsx(EmojiObjects, {}) },
12110
- { id: "symbols", name: (_h = i18n.categories) == null ? void 0 : _h.symbols, icon: /* @__PURE__ */ jsx(EmojiSymbols, {}) },
12111
- { id: "flags", name: (_i = i18n.categories) == null ? void 0 : _i.flags, icon: /* @__PURE__ */ jsx(EmojiFlags, {}) }
12112
- ];
12113
- },
12114
- [i18n.categories]
12115
- );
12116
12027
  const {
12117
12028
  categorizedData,
12118
12029
  categoryIndexMap,
@@ -12120,9 +12031,8 @@ var EmojiPicker = memo(function EmojiPicker2({
12120
12031
  findEmojiPosition
12121
12032
  } = useEmojiData({
12122
12033
  searchQuery,
12123
- columns: safeColumns,
12124
- showFrequentlyUsed,
12125
- categoryNames: i18n.categories
12034
+ columns,
12035
+ showFrequentlyUsed
12126
12036
  });
12127
12037
  const {
12128
12038
  scrollRef,
@@ -12138,7 +12048,7 @@ var EmojiPicker = memo(function EmojiPicker2({
12138
12048
  findEmojiPosition,
12139
12049
  searchQuery,
12140
12050
  value,
12141
- columns: safeColumns
12051
+ columns
12142
12052
  });
12143
12053
  const availableCategories = useMemo(() => {
12144
12054
  return categoriesWithIcons.filter((category) => {
@@ -12147,7 +12057,7 @@ var EmojiPicker = memo(function EmojiPicker2({
12147
12057
  }
12148
12058
  return true;
12149
12059
  });
12150
- }, [categoriesWithIcons, showFrequentlyUsed]);
12060
+ }, [showFrequentlyUsed]);
12151
12061
  const handleEmojiSelect = useEventCallback((emoji) => {
12152
12062
  markInternalUpdate();
12153
12063
  addToFrequentlyUsed(emoji.id);
@@ -12163,7 +12073,7 @@ var EmojiPicker = memo(function EmojiPicker2({
12163
12073
  const rootStyle = {
12164
12074
  "--emoji-height": `${height}px`,
12165
12075
  "--emoji-padding": `${PADDING2}px`,
12166
- "--emoji-columns": `${safeColumns}`
12076
+ "--emoji-columns": `${columns}`
12167
12077
  };
12168
12078
  return /* @__PURE__ */ jsxs(
12169
12079
  "div",
@@ -12266,16 +12176,7 @@ var EmojiPicker = memo(function EmojiPicker2({
12266
12176
  },
12267
12177
  virtualItem.key
12268
12178
  );
12269
- }) : /* @__PURE__ */ jsx(
12270
- EmojiEmpty,
12271
- {
12272
- variant,
12273
- i18n: {
12274
- title: i18n.noEmojisFoundTitle,
12275
- description: i18n.noEmojisFoundDescription
12276
- }
12277
- }
12278
- )
12179
+ }) : /* @__PURE__ */ jsx(EmojiEmpty, { variant })
12279
12180
  }
12280
12181
  )
12281
12182
  }
@@ -12287,10 +12188,7 @@ var EmojiPicker = memo(function EmojiPicker2({
12287
12188
  {
12288
12189
  hoveredEmoji,
12289
12190
  selectedEmoji: value || null,
12290
- variant,
12291
- i18n: {
12292
- pickAnEmoji: i18n.footerPickAnEmoji
12293
- }
12191
+ variant
12294
12192
  }
12295
12193
  ),
12296
12194
  children
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Range as Range2 } from "../../../range/dist/index.js";
2
+ import { Range } from "../../../range/dist/index.js";
3
3
  import { filterFormProps, BaseAdapter } from "./base-adapter.js";
4
4
  function RangeAdapter({
5
5
  className,
@@ -23,7 +23,7 @@ function RangeAdapter({
23
23
  legendMode: true,
24
24
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
25
25
  /* @__PURE__ */ jsx(
26
- Range2,
26
+ Range,
27
27
  {
28
28
  value,
29
29
  onChange: (inputValue) => onChange(inputValue),
@@ -14,7 +14,7 @@ interface IconButtonProps extends Omit<HTMLProps<HTMLElement>, "size" | "as"> {
14
14
  readOnly?: boolean;
15
15
  size?: "default" | "large" | "reset";
16
16
  tooltip?: TooltipProps;
17
- variant?: "default" | "secondary" | "solid" | "highlight" | "ghost" | "dark" | "submit" | "reset";
17
+ variant?: "default" | "secondary" | "solid" | "highlight" | "ghost" | "dark" | "reset";
18
18
  }
19
19
  declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLElement>>;
20
20