@choice-ui/react 1.9.0 → 1.9.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.
Files changed (42) hide show
  1. package/dist/components/button/dist/index.js +7 -0
  2. package/dist/components/checkbox/dist/index.d.ts +10 -1
  3. package/dist/components/checkbox/dist/index.js +49 -5
  4. package/dist/components/colors/dist/index.d.ts +39 -6
  5. package/dist/components/colors/src/color-gradients-paint/color-gradient-combined.js +1 -4
  6. package/dist/components/colors/src/color-gradients-paint/color-gradient-slider.d.ts +4 -4
  7. package/dist/components/colors/src/color-gradients-paint/color-gradient-slider.js +9 -8
  8. package/dist/components/colors/src/color-image-paint/color-image-paint.js +2 -2
  9. package/dist/components/colors/src/color-slider/color-slider.d.ts +14 -6
  10. package/dist/components/colors/src/color-slider/color-slider.js +124 -46
  11. package/dist/components/colors/src/color-slider/components/index.d.ts +2 -0
  12. package/dist/components/colors/src/color-slider/components/thumb.d.ts +8 -0
  13. package/dist/components/colors/src/color-slider/components/thumb.js +49 -0
  14. package/dist/components/colors/src/color-slider/components/track.d.ts +18 -0
  15. package/dist/components/colors/src/color-slider/components/track.js +19 -0
  16. package/dist/components/colors/src/color-slider/context.d.ts +23 -0
  17. package/dist/components/colors/src/color-slider/context.js +13 -0
  18. package/dist/components/colors/src/color-slider/index.d.ts +2 -0
  19. package/dist/components/colors/src/color-slider/tv.d.ts +3 -0
  20. package/dist/components/colors/src/color-slider/tv.js +2 -1
  21. package/dist/components/colors/src/color-solid-paint/color-solid-paint.js +4 -7
  22. package/dist/components/colors/src/color-solid-paint/solid-paint-alpha-slider.js +2 -2
  23. package/dist/components/colors/src/color-solid-paint/solid-paint-hue-slider.js +2 -2
  24. package/dist/components/colors/src/simple-color-picker/simple-color-picker.js +4 -7
  25. package/dist/components/dropdown/dist/index.d.ts +6 -0
  26. package/dist/components/dropdown/dist/index.js +20 -10
  27. package/dist/components/emoji-picker/dist/index.d.ts +29 -1
  28. package/dist/components/emoji-picker/dist/index.js +144 -42
  29. package/dist/components/form/src/adapters/range-adapter.js +2 -2
  30. package/dist/components/icon-button/dist/index.d.ts +1 -1
  31. package/dist/components/icon-button/dist/index.js +39 -0
  32. package/dist/components/menus/dist/index.d.ts +5 -0
  33. package/dist/components/menus/dist/index.js +32 -3
  34. package/dist/components/radio/dist/index.d.ts +9 -1
  35. package/dist/components/radio/dist/index.js +50 -6
  36. package/dist/components/range/dist/index.d.ts +276 -20
  37. package/dist/components/range/dist/index.js +1030 -602
  38. package/dist/components/textarea/dist/index.js +3 -1
  39. package/dist/components/tooltip/dist/index.d.ts +2 -0
  40. package/dist/components/tooltip/dist/index.js +23 -5
  41. package/dist/components/virtual-select/dist/index.d.ts +48 -0
  42. package/package.json +20 -32
@@ -507,7 +507,9 @@ var TextareaTv = tcv({
507
507
  container: "bg-gray-700",
508
508
  textarea: "text-white placeholder:text-white/40"
509
509
  },
510
- reset: {}
510
+ reset: {
511
+ container: "rounded-none border-0"
512
+ }
511
513
  },
512
514
  resize: {
513
515
  auto: {},
@@ -10,6 +10,7 @@ interface TooltipProps {
10
10
  className?: string;
11
11
  content?: React.ReactNode;
12
12
  disabled?: boolean;
13
+ interactive?: boolean;
13
14
  offset?: number;
14
15
  onOpenChange?: (open: boolean) => void;
15
16
  open?: boolean;
@@ -23,6 +24,7 @@ interface TooltipProps {
23
24
  withArrow?: boolean;
24
25
  }
25
26
  interface TooltipContentProps extends React.HTMLProps<HTMLDivElement> {
27
+ interactive?: boolean;
26
28
  portalId?: string;
27
29
  variant?: "default" | "light";
28
30
  withArrow?: boolean;
@@ -128,7 +128,15 @@ var TooltipArrow = forwardRef(function TooltipArrow2({ className, variant = "def
128
128
  });
129
129
  var TooltipContent = forwardRef(
130
130
  function TooltipContent2(props, propRef) {
131
- const { className, withArrow = true, variant = "default", children, portalId, ...rest } = props;
131
+ const {
132
+ className,
133
+ withArrow = true,
134
+ variant = "default",
135
+ children,
136
+ portalId,
137
+ interactive = true,
138
+ ...rest
139
+ } = props;
132
140
  const state = useTooltipState();
133
141
  const ref = useMergeRefs([state.refs.setFloating, propRef]);
134
142
  const { isInstantPhase, currentId } = useDelayGroup(state.context, {
@@ -157,19 +165,27 @@ var TooltipContent = forwardRef(
157
165
  });
158
166
  const tv = useMemo(() => tooltipContentVariants({ variant }), [variant]);
159
167
  if (state.disabled || !isMounted) return null;
168
+ const floatingProps = state.getFloatingProps(rest);
160
169
  return /* @__PURE__ */ jsx(FloatingPortal, { id: portalId, children: /* @__PURE__ */ jsx(
161
170
  "div",
162
171
  {
163
172
  ref,
164
- style: state.floatingStyles,
165
- ...state.getFloatingProps(rest),
173
+ style: {
174
+ ...state.floatingStyles,
175
+ pointerEvents: interactive ? void 0 : "none"
176
+ },
177
+ ...floatingProps,
166
178
  className: "z-tooltip",
167
179
  children: /* @__PURE__ */ jsxs(
168
180
  "div",
169
181
  {
170
182
  className: tcx(tv.root({ className })),
171
183
  "data-state": state.open ? "open" : "closed",
172
- style: styles,
184
+ style: {
185
+ ...styles,
186
+ pointerEvents: interactive ? void 0 : "none",
187
+ cursor: interactive ? void 0 : "default"
188
+ },
173
189
  children: [
174
190
  children,
175
191
  withArrow && /* @__PURE__ */ jsx(TooltipArrow, { variant })
@@ -272,7 +288,8 @@ function TooltipRoot(props) {
272
288
  withArrow = true,
273
289
  variant = "default",
274
290
  offset: offset2 = 8,
275
- portalId = PORTAL_ROOT_ID
291
+ portalId = PORTAL_ROOT_ID,
292
+ interactive = true
276
293
  } = props;
277
294
  const tooltip = useTooltip({
278
295
  placement,
@@ -291,6 +308,7 @@ function TooltipRoot(props) {
291
308
  variant,
292
309
  portalId,
293
310
  className,
311
+ interactive,
294
312
  children: [
295
313
  content,
296
314
  shortcut && /* @__PURE__ */ jsx(
@@ -0,0 +1,48 @@
1
+ import { MenuContextContent, MenuDivider, MenuEmpty, MenuContextItem, MenuSearch, MenuTrigger, MenuValue } from '../../menus/src';
2
+ import { FloatingFocusManagerProps } from '@floating-ui/react';
3
+ import { default as React } from 'react';
4
+ interface VirtualSelectOption<T = unknown> {
5
+ value: string;
6
+ label: string;
7
+ disabled?: boolean;
8
+ data?: T;
9
+ }
10
+ interface VirtualSelectProps<T = unknown> {
11
+ className?: string;
12
+ closeOnEscape?: boolean;
13
+ disabled?: boolean;
14
+ emptyText?: string;
15
+ focusManagerProps?: Partial<FloatingFocusManagerProps>;
16
+ matchTriggerWidth?: boolean;
17
+ maxHeight?: number;
18
+ onChange?: (value: string) => void;
19
+ onOpenChange?: (open: boolean) => void;
20
+ open?: boolean;
21
+ options: VirtualSelectOption<T>[];
22
+ overscan?: number;
23
+ placeholder?: string;
24
+ placement?: "bottom-start" | "bottom-end";
25
+ portalId?: string;
26
+ readOnly?: boolean;
27
+ renderOption?: (option: VirtualSelectOption<T>, isSelected: boolean) => React.ReactNode;
28
+ renderValue?: (option: VirtualSelectOption<T> | null) => React.ReactNode;
29
+ root?: HTMLElement | null;
30
+ searchPlaceholder?: string;
31
+ size?: "default" | "large";
32
+ value?: string | null;
33
+ variant?: "default" | "light" | "reset";
34
+ }
35
+ interface VirtualSelectComponentType {
36
+ <T = unknown>(props: VirtualSelectProps<T>): React.ReactElement | null;
37
+ displayName?: string;
38
+ Content: typeof MenuContextContent;
39
+ Divider: typeof MenuDivider;
40
+ Empty: typeof MenuEmpty;
41
+ Item: typeof MenuContextItem;
42
+ Search: typeof MenuSearch;
43
+ Trigger: typeof MenuTrigger;
44
+ Value: typeof MenuValue;
45
+ }
46
+ declare const VirtualSelect: VirtualSelectComponentType;
47
+
48
+ export { VirtualSelect, type VirtualSelectOption, type VirtualSelectProps };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@choice-ui/react",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "A desktop-first React UI component library built for professional desktop applications with comprehensive documentation",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "source": "./app/index.ts",
8
8
  "main": "./dist/index.js",
9
- "types": "./app/index.ts",
9
+ "types": "./dist/index.d.ts",
10
10
  "files": [
11
11
  "dist",
12
12
  "README.md",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "exports": {
16
16
  ".": {
17
- "types": "./app/index.ts",
17
+ "types": "./dist/index.d.ts",
18
18
  "import": "./dist/index.js"
19
19
  },
20
20
  "./styles/*": "./dist/styles/*",
@@ -22,36 +22,10 @@
22
22
  "./llms.txt": "./dist/llms.txt"
23
23
  },
24
24
  "publishConfig": {
25
- "access": "public",
26
- "types": "./dist/index.d.ts",
27
- "main": "./dist/index.js",
28
- "exports": {
29
- ".": {
30
- "types": "./dist/index.d.ts",
31
- "import": "./dist/index.js"
32
- },
33
- "./styles/*": "./dist/styles/*",
34
- "./tailwind.css": "./dist/tailwind.css",
35
- "./llms.txt": "./dist/llms.txt"
36
- }
37
- },
38
- "scripts": {
39
- "build": "pnpm run clean && pnpm --filter @choice-ui/shared build && vite build",
40
- "build:watch": "vite build --watch",
41
- "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
42
- "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
43
- "lint:types": "tsc",
44
- "clean": "rimraf dist",
45
- "prepublishOnly": "pnpm run build",
46
- "plop": "pnpm dlx plop",
47
- "test": "jest",
48
- "test:watch": "jest --watch",
49
- "test:coverage": "jest --coverage",
50
- "madge": "npx madge --circular --extensions ts app/"
25
+ "access": "public"
51
26
  },
52
27
  "dependencies": {
53
28
  "@choiceform/icons-react": "^1.3.8",
54
- "@choice-ui/design-tokens": "workspace:*",
55
29
  "classnames": "^2.5.1",
56
30
  "tailwind-merge": "^3.3.1",
57
31
  "tailwind-variants": "^3.1.0",
@@ -85,7 +59,8 @@
85
59
  "remark-breaks": "^4.0.0",
86
60
  "remark-math": "^6.0.0",
87
61
  "harden-react-markdown": "^1.0.4",
88
- "shiki": "^3.9.2"
62
+ "shiki": "^3.9.2",
63
+ "@choice-ui/design-tokens": "0.2.16"
89
64
  },
90
65
  "devDependencies": {
91
66
  "@babel/core": "^7.27.1",
@@ -136,5 +111,18 @@
136
111
  "peerDependencies": {
137
112
  "react": ">=18.0.0",
138
113
  "react-dom": ">=18.0.0"
114
+ },
115
+ "scripts": {
116
+ "build": "pnpm run clean && pnpm --filter @choice-ui/shared build && vite build",
117
+ "build:watch": "vite build --watch",
118
+ "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
119
+ "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
120
+ "lint:types": "tsc",
121
+ "clean": "rimraf dist",
122
+ "plop": "pnpm dlx plop",
123
+ "test": "jest",
124
+ "test:watch": "jest --watch",
125
+ "test:coverage": "jest --coverage",
126
+ "madge": "npx madge --circular --extensions ts app/"
139
127
  }
140
- }
128
+ }