@pixpilot/shadcn-ui 0.45.0 → 0.46.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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/AbsoluteFill.d.ts
5
5
 
@@ -10,7 +10,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
10
10
  */
11
11
  declare function AbsoluteFill(props: React.HTMLAttributes<HTMLDivElement> & {
12
12
  ref?: React.Ref<HTMLDivElement>;
13
- }): react_jsx_runtime0.JSX.Element;
13
+ }): react_jsx_runtime3.JSX.Element;
14
14
  declare namespace AbsoluteFill {
15
15
  var displayName: string;
16
16
  }
package/dist/Button.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Button, Tooltip, buttonVariants } from "@pixpilot/shadcn";
2
2
  import React from "react";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
6
6
  //#region src/Button.d.ts
@@ -39,7 +39,7 @@ interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<
39
39
  }
40
40
  declare function Button$1(props: ButtonProps & {
41
41
  ref?: React.Ref<HTMLButtonElement>;
42
- }): react_jsx_runtime0.JSX.Element;
42
+ }): react_jsx_runtime4.JSX.Element;
43
43
  declare namespace Button$1 {
44
44
  var displayName: string;
45
45
  }
@@ -1,6 +1,6 @@
1
1
  import { Select, SelectContent } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime1 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/ColorSelect.d.ts
6
6
  interface ColorSelectOption {
@@ -15,6 +15,6 @@ type BaseColorSelectProps = {
15
15
  placeholder?: string;
16
16
  keyboardMode?: 'cycle' | 'dropdown';
17
17
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
18
- declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime1.JSX.Element;
18
+ declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime5.JSX.Element;
19
19
  //#endregion
20
20
  export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
@@ -1,6 +1,6 @@
1
1
  import { Card } from "@pixpilot/shadcn";
2
2
  import React, { ReactNode } from "react";
3
- import * as react_jsx_runtime2 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/ContentCard.d.ts
6
6
  interface SectionCardProps extends React.ComponentProps<typeof Card> {
@@ -8,7 +8,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
8
8
  children: ReactNode;
9
9
  marginBottom?: boolean;
10
10
  }
11
- declare function ContentCard(props: SectionCardProps): react_jsx_runtime2.JSX.Element;
11
+ declare function ContentCard(props: SectionCardProps): react_jsx_runtime6.JSX.Element;
12
12
  declare namespace ContentCard {
13
13
  var displayName: string;
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import { Calendar } from "@pixpilot/shadcn";
2
2
  import { ComponentProps } from "react";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/DatePicker.d.ts
6
6
  type DatePickerProps = {
@@ -8,7 +8,7 @@ type DatePickerProps = {
8
8
  onChange?: (date: Date | undefined) => void;
9
9
  placeholder?: string;
10
10
  } & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
11
- declare function DatePicker(props: DatePickerProps): react_jsx_runtime3.JSX.Element;
11
+ declare function DatePicker(props: DatePickerProps): react_jsx_runtime7.JSX.Element;
12
12
  declare namespace DatePicker {
13
13
  var displayName: string;
14
14
  }
package/dist/Rating.cjs CHANGED
@@ -1,39 +1,204 @@
1
1
  const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
2
  let __pixpilot_shadcn = require("@pixpilot/shadcn");
3
3
  __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
4
+ let lucide_react = require("lucide-react");
5
+ lucide_react = require_rolldown_runtime.__toESM(lucide_react);
6
+ let react = require("react");
7
+ react = require_rolldown_runtime.__toESM(react);
4
8
  let react_jsx_runtime = require("react/jsx-runtime");
5
9
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
10
+ let class_variance_authority = require("class-variance-authority");
11
+ class_variance_authority = require_rolldown_runtime.__toESM(class_variance_authority);
6
12
 
7
13
  //#region src/Rating.tsx
8
14
  const DEFAULT_MAX_RATING = 5;
15
+ const ratingVariants = (0, class_variance_authority.cva)("inline-flex items-center gap-1", {
16
+ variants: { size: {
17
+ sm: "[&_svg]:size-4",
18
+ default: "[&_svg]:size-5",
19
+ lg: "[&_svg]:size-6",
20
+ xl: "[&_svg]:size-7"
21
+ } },
22
+ defaultVariants: { size: "default" }
23
+ });
24
+ const sizePixels = {
25
+ sm: 16,
26
+ default: 20,
27
+ lg: 24,
28
+ xl: 28
29
+ };
9
30
  const colorClasses = {
10
- default: "[&_svg]:!fill-yellow-400 [&_svg]:!text-yellow-400 dark:[&_svg]:!fill-yellow-500 dark:[&_svg]:!text-yellow-500 [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
11
- primary: "[&_svg]:!fill-primary [&_svg]:!text-primary [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
12
- secondary: "[&_svg]:!fill-secondary [&_svg]:!text-secondary-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
13
- destructive: "[&_svg]:!fill-destructive [&_svg]:!text-destructive [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
31
+ default: "[&_svg]:!fill-yellow-400 [&_svg]:!text-yellow-400 dark:[&_svg]:!fill-yellow-500 dark:[&_svg]:!text-yellow-500 [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
32
+ primary: "[&_svg]:!fill-primary [&_svg]:!text-primary [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
33
+ secondary: "[&_svg]:!fill-secondary [&_svg]:!text-secondary-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
34
+ destructive: "[&_svg]:!fill-destructive [&_svg]:!text-destructive [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
14
35
  foreground: "[&_svg]:!fill-foreground [&_svg]:!text-foreground [&_svg.fill-transparent]:!fill-transparent",
15
- accent: "[&_svg]:!fill-accent [&_svg]:!text-accent-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
16
- muted: "[&_svg]:!fill-muted [&_svg]:!text-muted-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
17
- ring: "[&_svg]:!fill-ring [&_svg]:!text-ring [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground"
36
+ accent: "[&_svg]:!fill-accent [&_svg]:!text-accent-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
37
+ muted: "[&_svg]:!fill-muted [&_svg]:!text-muted-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
38
+ ring: "[&_svg]:!fill-ring [&_svg]:!text-ring [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30"
18
39
  };
19
- /**
20
- * Rating component wrapper with enhanced functionality
21
- */
22
- function Rating({ max = DEFAULT_MAX_RATING, color = "default",...props }) {
23
- const colorClass = colorClasses[color];
24
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Rating, {
25
- max,
40
+ const RatingContext = react.createContext(null);
41
+ function useRating() {
42
+ const context = react.use(RatingContext);
43
+ if (!context) throw new Error("useRating must be used within a Rating component");
44
+ return context;
45
+ }
46
+ function buildFallbackOptions(max) {
47
+ return Array.from({ length: max }, (_, index) => {
48
+ const value = index + 1;
49
+ return {
50
+ value,
51
+ label: `Rate ${value}`
52
+ };
53
+ });
54
+ }
55
+ function getIndexForValue(value, options) {
56
+ if (!value) return 0;
57
+ const foundIndex = options.findIndex((option) => option.value === value);
58
+ return foundIndex === -1 ? 0 : foundIndex + 1;
59
+ }
60
+ function RatingButton({ index, className,...props }) {
61
+ const { selectedIndex, hoverIndex, setHoverIndex, setValueByIndex, max, readOnly, disabled, size, iconType, options, colorClassName } = useRating();
62
+ const isFilled = (hoverIndex || selectedIndex) >= index;
63
+ const label = options[index - 1]?.label;
64
+ const labelText = typeof label === "string" && label.length > 0 ? label : void 0;
65
+ const hasLabelText = labelText !== void 0;
66
+ const labelTextOrEmpty = labelText ?? "";
67
+ const Icon = iconType === "circle" ? lucide_react.Circle : lucide_react.Star;
68
+ const handleClick = () => {
69
+ if (readOnly || disabled) return;
70
+ setValueByIndex(index);
71
+ };
72
+ const handleMouseEnter = () => {
73
+ if (readOnly || disabled) return;
74
+ setHoverIndex(index);
75
+ };
76
+ const handleKeyDown = (event) => {
77
+ if (readOnly || disabled) return;
78
+ switch (event.key) {
79
+ case "ArrowLeft":
80
+ case "ArrowDown":
81
+ event.preventDefault();
82
+ setValueByIndex(Math.max(1, index - 1));
83
+ break;
84
+ case "ArrowRight":
85
+ case "ArrowUp":
86
+ event.preventDefault();
87
+ setValueByIndex(Math.min(max, index + 1));
88
+ break;
89
+ case "Home":
90
+ event.preventDefault();
91
+ setValueByIndex(1);
92
+ break;
93
+ case "End":
94
+ event.preventDefault();
95
+ setValueByIndex(max);
96
+ break;
97
+ case "Enter":
98
+ case " ":
99
+ event.preventDefault();
100
+ setValueByIndex(index);
101
+ break;
102
+ default: break;
103
+ }
104
+ };
105
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
106
+ type: "button",
107
+ role: "radio",
108
+ "aria-checked": index === selectedIndex,
109
+ "aria-label": labelText ?? `Rate ${index}`,
110
+ title: labelText,
111
+ disabled: disabled || readOnly,
112
+ onClick: handleClick,
113
+ onMouseEnter: handleMouseEnter,
114
+ onKeyDown: handleKeyDown,
115
+ className: (0, __pixpilot_shadcn.cn)("inline-flex items-center justify-center transition-all outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm", readOnly && "cursor-default", !readOnly && !disabled && "cursor-pointer hover:scale-110", disabled && "opacity-50 cursor-not-allowed", colorClassName, className),
26
116
  ...props,
27
- children: Array.from({ length: max }, (_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.RatingButton, {
28
- index: i + 1,
29
- className: colorClass
30
- }, i + 1))
117
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
118
+ className: (0, __pixpilot_shadcn.cn)("transition-all", isFilled ? "fill-current text-current" : "fill-transparent text-foreground/30"),
119
+ size,
120
+ "aria-hidden": "true"
121
+ }), hasLabelText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
122
+ className: "sr-only",
123
+ children: labelTextOrEmpty
124
+ }) : null]
125
+ });
126
+ }
127
+ function Rating({ value: valueProp, defaultValue, onValueChange, options: optionsProp, max: maxProp = DEFAULT_MAX_RATING, iconType = "star", size = "default", readOnly = false, disabled = false, name, required, color = "default", className, children,...props }) {
128
+ const isControlled = valueProp !== void 0;
129
+ const [internalValue, setInternalValue] = react.useState(defaultValue ?? 0);
130
+ const [hoverIndex, setHoverIndex] = react.useState(0);
131
+ const value = isControlled ? valueProp : internalValue;
132
+ const options = react.useMemo(() => {
133
+ const explicitOptions = optionsProp?.filter(Boolean);
134
+ return explicitOptions && explicitOptions.length > 0 ? explicitOptions : buildFallbackOptions(maxProp);
135
+ }, [maxProp, optionsProp]);
136
+ const max = options.length;
137
+ const selectedIndex = react.useMemo(() => getIndexForValue(value, options), [options, value]);
138
+ const setValue = react.useCallback((nextValue) => {
139
+ if (!isControlled) setInternalValue(nextValue);
140
+ onValueChange?.(nextValue);
141
+ }, [isControlled, onValueChange]);
142
+ const setValueByIndex = react.useCallback((index) => {
143
+ const nextOption = options[Math.min(Math.max(index, 1), max) - 1];
144
+ if (!nextOption) return;
145
+ setValue(nextOption.value);
146
+ }, [
147
+ max,
148
+ options,
149
+ setValue
150
+ ]);
151
+ const colorClassName = colorClasses[color];
152
+ const contextValue = react.useMemo(() => ({
153
+ value,
154
+ hoverIndex,
155
+ selectedIndex,
156
+ options,
157
+ max,
158
+ readOnly,
159
+ disabled,
160
+ size: sizePixels[size ?? "default"],
161
+ iconType,
162
+ colorClassName,
163
+ setHoverIndex,
164
+ setValueByIndex
165
+ }), [
166
+ colorClassName,
167
+ disabled,
168
+ hoverIndex,
169
+ iconType,
170
+ max,
171
+ options,
172
+ readOnly,
173
+ selectedIndex,
174
+ size,
175
+ value,
176
+ setValueByIndex
177
+ ]);
178
+ const handleMouseLeave = () => {
179
+ if (readOnly || disabled) return;
180
+ setHoverIndex(0);
181
+ };
182
+ const nameText = typeof name === "string" && name.length > 0 ? name : void 0;
183
+ const hasNameText = nameText !== void 0;
184
+ const nameTextOrEmpty = nameText ?? "";
185
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingContext, {
186
+ value: contextValue,
187
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
188
+ role: "radiogroup",
189
+ tabIndex: 0,
190
+ className: (0, __pixpilot_shadcn.cn)(ratingVariants({ size }), className),
191
+ onMouseLeave: handleMouseLeave,
192
+ ...props,
193
+ children: [children ?? Array.from({ length: max }, (_, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RatingButton, { index: index + 1 }, index)), hasNameText ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
194
+ type: "hidden",
195
+ name: nameTextOrEmpty,
196
+ value: value || "",
197
+ required
198
+ }) : null]
199
+ })
31
200
  });
32
201
  }
33
- /**
34
- * Individual rating button component
35
- */
36
- const RatingButton = __pixpilot_shadcn.RatingButton;
37
202
 
38
203
  //#endregion
39
204
  exports.Rating = Rating;
package/dist/Rating.d.cts CHANGED
@@ -1,26 +1,57 @@
1
1
  import * as react_jsx_runtime4 from "react/jsx-runtime";
2
- import { RatingButton, RatingButtonProps, RatingProps } from "@pixpilot/shadcn";
2
+ import * as React$1 from "react";
3
+ import { VariantProps } from "class-variance-authority";
4
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
3
5
 
4
6
  //#region src/Rating.d.ts
5
- interface RatingProps$1 extends Omit<RatingProps, 'children'> {
6
- /**
7
- * Color variant for the rating
8
- * @default 'default'
9
- */
10
- color?: 'default' | 'primary' | 'secondary' | 'destructive' | 'foreground' | 'accent' | 'muted' | 'ring';
7
+ type RatingColor = 'default' | 'primary' | 'secondary' | 'destructive' | 'foreground' | 'accent' | 'muted' | 'ring';
8
+ interface RatingOption {
9
+ label: string;
10
+ value: number;
11
11
  }
12
- interface RatingButtonProps$1 extends RatingButtonProps {}
13
- /**
14
- * Rating component wrapper with enhanced functionality
15
- */
12
+ declare const ratingVariants: (props?: ({
13
+ size?: "sm" | "default" | "lg" | "xl" | null | undefined;
14
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
+ type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
+ type IconType = 'star' | 'circle';
17
+ interface RatingProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
18
+ value?: number;
19
+ defaultValue?: number;
20
+ onValueChange?: (value: number) => void;
21
+ max?: number;
22
+ options?: RatingOption[];
23
+ iconType?: IconType;
24
+ size?: RatingSize;
25
+ readOnly?: boolean;
26
+ disabled?: boolean;
27
+ name?: string;
28
+ required?: boolean;
29
+ color?: RatingColor;
30
+ }
31
+ interface RatingButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
32
+ index: number;
33
+ }
34
+ declare function RatingButton({
35
+ index,
36
+ className,
37
+ ...props
38
+ }: RatingButtonProps): react_jsx_runtime4.JSX.Element;
16
39
  declare function Rating({
17
- max,
40
+ value: valueProp,
41
+ defaultValue,
42
+ onValueChange,
43
+ options: optionsProp,
44
+ max: maxProp,
45
+ iconType,
46
+ size,
47
+ readOnly,
48
+ disabled,
49
+ name,
50
+ required,
18
51
  color,
52
+ className,
53
+ children,
19
54
  ...props
20
- }: RatingProps$1): react_jsx_runtime4.JSX.Element;
21
- /**
22
- * Individual rating button component
23
- */
24
- declare const RatingButton$1: typeof RatingButton;
55
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime4.JSX.Element;
25
56
  //#endregion
26
- export { Rating, RatingButton$1 as RatingButton, RatingButtonProps$1 as RatingButtonProps, RatingProps$1 as RatingProps };
57
+ export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
package/dist/Rating.d.ts CHANGED
@@ -1,26 +1,57 @@
1
- import { RatingButton, RatingButtonProps, RatingProps } from "@pixpilot/shadcn";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
1
+ import * as React$1 from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { VariantProps } from "class-variance-authority";
4
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
3
5
 
4
6
  //#region src/Rating.d.ts
5
- interface RatingProps$1 extends Omit<RatingProps, 'children'> {
6
- /**
7
- * Color variant for the rating
8
- * @default 'default'
9
- */
10
- color?: 'default' | 'primary' | 'secondary' | 'destructive' | 'foreground' | 'accent' | 'muted' | 'ring';
7
+ type RatingColor = 'default' | 'primary' | 'secondary' | 'destructive' | 'foreground' | 'accent' | 'muted' | 'ring';
8
+ interface RatingOption {
9
+ label: string;
10
+ value: number;
11
11
  }
12
- interface RatingButtonProps$1 extends RatingButtonProps {}
13
- /**
14
- * Rating component wrapper with enhanced functionality
15
- */
16
- declare function Rating$1({
17
- max,
12
+ declare const ratingVariants: (props?: ({
13
+ size?: "sm" | "default" | "lg" | "xl" | null | undefined;
14
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
15
+ type RatingSize = VariantProps<typeof ratingVariants>['size'];
16
+ type IconType = 'star' | 'circle';
17
+ interface RatingProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
18
+ value?: number;
19
+ defaultValue?: number;
20
+ onValueChange?: (value: number) => void;
21
+ max?: number;
22
+ options?: RatingOption[];
23
+ iconType?: IconType;
24
+ size?: RatingSize;
25
+ readOnly?: boolean;
26
+ disabled?: boolean;
27
+ name?: string;
28
+ required?: boolean;
29
+ color?: RatingColor;
30
+ }
31
+ interface RatingButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
32
+ index: number;
33
+ }
34
+ declare function RatingButton({
35
+ index,
36
+ className,
37
+ ...props
38
+ }: RatingButtonProps): react_jsx_runtime0.JSX.Element;
39
+ declare function Rating({
40
+ value: valueProp,
41
+ defaultValue,
42
+ onValueChange,
43
+ options: optionsProp,
44
+ max: maxProp,
45
+ iconType,
46
+ size,
47
+ readOnly,
48
+ disabled,
49
+ name,
50
+ required,
18
51
  color,
52
+ className,
53
+ children,
19
54
  ...props
20
- }: RatingProps$1): react_jsx_runtime4.JSX.Element;
21
- /**
22
- * Individual rating button component
23
- */
24
- declare const RatingButton$1: typeof RatingButton;
55
+ }: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime0.JSX.Element;
25
56
  //#endregion
26
- export { Rating$1 as Rating, RatingButton$1 as RatingButton, RatingButtonProps$1 as RatingButtonProps, RatingProps$1 as RatingProps };
57
+ export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
package/dist/Rating.js CHANGED
@@ -1,36 +1,198 @@
1
- import { Rating, RatingButton } from "@pixpilot/shadcn";
2
- import { jsx } from "react/jsx-runtime";
1
+ import { cn } from "@pixpilot/shadcn";
2
+ import { Circle, Star } from "lucide-react";
3
+ import * as React$1 from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
3
6
 
4
7
  //#region src/Rating.tsx
5
8
  const DEFAULT_MAX_RATING = 5;
9
+ const ratingVariants = cva("inline-flex items-center gap-1", {
10
+ variants: { size: {
11
+ sm: "[&_svg]:size-4",
12
+ default: "[&_svg]:size-5",
13
+ lg: "[&_svg]:size-6",
14
+ xl: "[&_svg]:size-7"
15
+ } },
16
+ defaultVariants: { size: "default" }
17
+ });
18
+ const sizePixels = {
19
+ sm: 16,
20
+ default: 20,
21
+ lg: 24,
22
+ xl: 28
23
+ };
6
24
  const colorClasses = {
7
- default: "[&_svg]:!fill-yellow-400 [&_svg]:!text-yellow-400 dark:[&_svg]:!fill-yellow-500 dark:[&_svg]:!text-yellow-500 [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
8
- primary: "[&_svg]:!fill-primary [&_svg]:!text-primary [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
9
- secondary: "[&_svg]:!fill-secondary [&_svg]:!text-secondary-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
10
- destructive: "[&_svg]:!fill-destructive [&_svg]:!text-destructive [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
25
+ default: "[&_svg]:!fill-yellow-400 [&_svg]:!text-yellow-400 dark:[&_svg]:!fill-yellow-500 dark:[&_svg]:!text-yellow-500 [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
26
+ primary: "[&_svg]:!fill-primary [&_svg]:!text-primary [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
27
+ secondary: "[&_svg]:!fill-secondary [&_svg]:!text-secondary-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
28
+ destructive: "[&_svg]:!fill-destructive [&_svg]:!text-destructive [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
11
29
  foreground: "[&_svg]:!fill-foreground [&_svg]:!text-foreground [&_svg.fill-transparent]:!fill-transparent",
12
- accent: "[&_svg]:!fill-accent [&_svg]:!text-accent-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
13
- muted: "[&_svg]:!fill-muted [&_svg]:!text-muted-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground",
14
- ring: "[&_svg]:!fill-ring [&_svg]:!text-ring [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground"
30
+ accent: "[&_svg]:!fill-accent [&_svg]:!text-accent-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
31
+ muted: "[&_svg]:!fill-muted [&_svg]:!text-muted-foreground [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30",
32
+ ring: "[&_svg]:!fill-ring [&_svg]:!text-ring [&_svg.fill-transparent]:!fill-transparent [&_svg.fill-transparent]:!text-foreground/30"
15
33
  };
16
- /**
17
- * Rating component wrapper with enhanced functionality
18
- */
19
- function Rating$1({ max = DEFAULT_MAX_RATING, color = "default",...props }) {
20
- const colorClass = colorClasses[color];
21
- return /* @__PURE__ */ jsx(Rating, {
22
- max,
34
+ const RatingContext = React$1.createContext(null);
35
+ function useRating() {
36
+ const context = React$1.use(RatingContext);
37
+ if (!context) throw new Error("useRating must be used within a Rating component");
38
+ return context;
39
+ }
40
+ function buildFallbackOptions(max) {
41
+ return Array.from({ length: max }, (_, index) => {
42
+ const value = index + 1;
43
+ return {
44
+ value,
45
+ label: `Rate ${value}`
46
+ };
47
+ });
48
+ }
49
+ function getIndexForValue(value, options) {
50
+ if (!value) return 0;
51
+ const foundIndex = options.findIndex((option) => option.value === value);
52
+ return foundIndex === -1 ? 0 : foundIndex + 1;
53
+ }
54
+ function RatingButton({ index, className,...props }) {
55
+ const { selectedIndex, hoverIndex, setHoverIndex, setValueByIndex, max, readOnly, disabled, size, iconType, options, colorClassName } = useRating();
56
+ const isFilled = (hoverIndex || selectedIndex) >= index;
57
+ const label = options[index - 1]?.label;
58
+ const labelText = typeof label === "string" && label.length > 0 ? label : void 0;
59
+ const hasLabelText = labelText !== void 0;
60
+ const labelTextOrEmpty = labelText ?? "";
61
+ const Icon = iconType === "circle" ? Circle : Star;
62
+ const handleClick = () => {
63
+ if (readOnly || disabled) return;
64
+ setValueByIndex(index);
65
+ };
66
+ const handleMouseEnter = () => {
67
+ if (readOnly || disabled) return;
68
+ setHoverIndex(index);
69
+ };
70
+ const handleKeyDown = (event) => {
71
+ if (readOnly || disabled) return;
72
+ switch (event.key) {
73
+ case "ArrowLeft":
74
+ case "ArrowDown":
75
+ event.preventDefault();
76
+ setValueByIndex(Math.max(1, index - 1));
77
+ break;
78
+ case "ArrowRight":
79
+ case "ArrowUp":
80
+ event.preventDefault();
81
+ setValueByIndex(Math.min(max, index + 1));
82
+ break;
83
+ case "Home":
84
+ event.preventDefault();
85
+ setValueByIndex(1);
86
+ break;
87
+ case "End":
88
+ event.preventDefault();
89
+ setValueByIndex(max);
90
+ break;
91
+ case "Enter":
92
+ case " ":
93
+ event.preventDefault();
94
+ setValueByIndex(index);
95
+ break;
96
+ default: break;
97
+ }
98
+ };
99
+ return /* @__PURE__ */ jsxs("button", {
100
+ type: "button",
101
+ role: "radio",
102
+ "aria-checked": index === selectedIndex,
103
+ "aria-label": labelText ?? `Rate ${index}`,
104
+ title: labelText,
105
+ disabled: disabled || readOnly,
106
+ onClick: handleClick,
107
+ onMouseEnter: handleMouseEnter,
108
+ onKeyDown: handleKeyDown,
109
+ className: cn("inline-flex items-center justify-center transition-all outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm", readOnly && "cursor-default", !readOnly && !disabled && "cursor-pointer hover:scale-110", disabled && "opacity-50 cursor-not-allowed", colorClassName, className),
23
110
  ...props,
24
- children: Array.from({ length: max }, (_, i) => /* @__PURE__ */ jsx(RatingButton, {
25
- index: i + 1,
26
- className: colorClass
27
- }, i + 1))
111
+ children: [/* @__PURE__ */ jsx(Icon, {
112
+ className: cn("transition-all", isFilled ? "fill-current text-current" : "fill-transparent text-foreground/30"),
113
+ size,
114
+ "aria-hidden": "true"
115
+ }), hasLabelText ? /* @__PURE__ */ jsx("span", {
116
+ className: "sr-only",
117
+ children: labelTextOrEmpty
118
+ }) : null]
119
+ });
120
+ }
121
+ function Rating({ value: valueProp, defaultValue, onValueChange, options: optionsProp, max: maxProp = DEFAULT_MAX_RATING, iconType = "star", size = "default", readOnly = false, disabled = false, name, required, color = "default", className, children,...props }) {
122
+ const isControlled = valueProp !== void 0;
123
+ const [internalValue, setInternalValue] = React$1.useState(defaultValue ?? 0);
124
+ const [hoverIndex, setHoverIndex] = React$1.useState(0);
125
+ const value = isControlled ? valueProp : internalValue;
126
+ const options = React$1.useMemo(() => {
127
+ const explicitOptions = optionsProp?.filter(Boolean);
128
+ return explicitOptions && explicitOptions.length > 0 ? explicitOptions : buildFallbackOptions(maxProp);
129
+ }, [maxProp, optionsProp]);
130
+ const max = options.length;
131
+ const selectedIndex = React$1.useMemo(() => getIndexForValue(value, options), [options, value]);
132
+ const setValue = React$1.useCallback((nextValue) => {
133
+ if (!isControlled) setInternalValue(nextValue);
134
+ onValueChange?.(nextValue);
135
+ }, [isControlled, onValueChange]);
136
+ const setValueByIndex = React$1.useCallback((index) => {
137
+ const nextOption = options[Math.min(Math.max(index, 1), max) - 1];
138
+ if (!nextOption) return;
139
+ setValue(nextOption.value);
140
+ }, [
141
+ max,
142
+ options,
143
+ setValue
144
+ ]);
145
+ const colorClassName = colorClasses[color];
146
+ const contextValue = React$1.useMemo(() => ({
147
+ value,
148
+ hoverIndex,
149
+ selectedIndex,
150
+ options,
151
+ max,
152
+ readOnly,
153
+ disabled,
154
+ size: sizePixels[size ?? "default"],
155
+ iconType,
156
+ colorClassName,
157
+ setHoverIndex,
158
+ setValueByIndex
159
+ }), [
160
+ colorClassName,
161
+ disabled,
162
+ hoverIndex,
163
+ iconType,
164
+ max,
165
+ options,
166
+ readOnly,
167
+ selectedIndex,
168
+ size,
169
+ value,
170
+ setValueByIndex
171
+ ]);
172
+ const handleMouseLeave = () => {
173
+ if (readOnly || disabled) return;
174
+ setHoverIndex(0);
175
+ };
176
+ const nameText = typeof name === "string" && name.length > 0 ? name : void 0;
177
+ const hasNameText = nameText !== void 0;
178
+ const nameTextOrEmpty = nameText ?? "";
179
+ return /* @__PURE__ */ jsx(RatingContext, {
180
+ value: contextValue,
181
+ children: /* @__PURE__ */ jsxs("div", {
182
+ role: "radiogroup",
183
+ tabIndex: 0,
184
+ className: cn(ratingVariants({ size }), className),
185
+ onMouseLeave: handleMouseLeave,
186
+ ...props,
187
+ children: [children ?? Array.from({ length: max }, (_, index) => /* @__PURE__ */ jsx(RatingButton, { index: index + 1 }, index)), hasNameText ? /* @__PURE__ */ jsx("input", {
188
+ type: "hidden",
189
+ name: nameTextOrEmpty,
190
+ value: value || "",
191
+ required
192
+ }) : null]
193
+ })
28
194
  });
29
195
  }
30
- /**
31
- * Individual rating button component
32
- */
33
- const RatingButton$1 = RatingButton;
34
196
 
35
197
  //#endregion
36
- export { Rating$1 as Rating, RatingButton$1 as RatingButton };
198
+ export { Rating, RatingButton };
package/dist/Select.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
  import { Select, SelectContent } from "@pixpilot/shadcn";
3
3
  import React, { ComponentProps } from "react";
4
4
 
@@ -46,6 +46,6 @@ type BaseSelectProps = {
46
46
  */
47
47
  clearable?: boolean;
48
48
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
49
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime5.JSX.Element;
49
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime6.JSX.Element;
50
50
  //#endregion
51
51
  export { Select$1 as Select, SelectContentProps, SelectOption };
package/dist/Select.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Select, SelectContent } from "@pixpilot/shadcn";
2
2
  import React, { ComponentProps } from "react";
3
- import * as react_jsx_runtime5 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/Select.d.ts
6
6
  interface SelectOption {
@@ -46,6 +46,6 @@ type BaseSelectProps = {
46
46
  */
47
47
  clearable?: boolean;
48
48
  } & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
49
- declare function Select$1(props: BaseSelectProps): react_jsx_runtime5.JSX.Element;
49
+ declare function Select$1(props: BaseSelectProps): react_jsx_runtime1.JSX.Element;
50
50
  //#endregion
51
51
  export { Select$1 as Select, SelectContentProps, SelectOption };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "./CommandOptionList.cjs";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/TagsInput.d.ts
5
5
  interface TagsInputProps {
@@ -55,6 +55,6 @@ declare function TagsInput({
55
55
  addOnPaste,
56
56
  addOnTab,
57
57
  onValidate
58
- }: TagsInputProps): react_jsx_runtime6.JSX.Element;
58
+ }: TagsInputProps): react_jsx_runtime7.JSX.Element;
59
59
  //#endregion
60
60
  export { TagsInput, TagsInputProps };
@@ -1,5 +1,5 @@
1
1
  import { CommandOptionListItem } from "./CommandOptionList.js";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/TagsInput.d.ts
5
5
  interface TagsInputProps {
@@ -55,6 +55,6 @@ declare function TagsInput({
55
55
  addOnPaste,
56
56
  addOnTab,
57
57
  onValidate
58
- }: TagsInputProps): react_jsx_runtime6.JSX.Element;
58
+ }: TagsInputProps): react_jsx_runtime2.JSX.Element;
59
59
  //#endregion
60
60
  export { TagsInput, TagsInputProps };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
  import * as React$1 from "react";
3
3
  import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
4
4
 
@@ -9,14 +9,14 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<_radix_ui_re
9
9
  declare function DialogHeader({
10
10
  className,
11
11
  ...props
12
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
12
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
13
13
  declare function DialogBody({
14
14
  className,
15
15
  ...props
16
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
16
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
17
17
  declare function DialogFooter({
18
18
  className,
19
19
  ...props
20
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
20
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime9.JSX.Element;
21
21
  //#endregion
22
22
  export { DialogBody, DialogContent, DialogFooter, DialogHeader };
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
  import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
4
4
 
5
5
  //#region src/dialog/Dialog.d.ts
@@ -9,14 +9,14 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<_radix_ui_re
9
9
  declare function DialogHeader({
10
10
  className,
11
11
  ...props
12
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
12
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
13
13
  declare function DialogBody({
14
14
  className,
15
15
  ...props
16
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
16
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
17
17
  declare function DialogFooter({
18
18
  className,
19
19
  ...props
20
- }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime7.JSX.Element;
20
+ }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
21
21
  //#endregion
22
22
  export { DialogBody, DialogContent, DialogFooter, DialogHeader };
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.cjs";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime7.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime8.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.js";
2
- import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime12.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime17.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.cjs";
2
- import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-inline/FileUploadInline.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime11.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime13.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.js";
2
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-inline/FileUploadInline.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime10.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime12.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
package/dist/index.d.cts CHANGED
@@ -45,7 +45,7 @@ import { Pagination, PaginationProps } from "./pagination/Pagination.cjs";
45
45
  import "./pagination/index.cjs";
46
46
  import { Popover, PopoverAnchor, PopoverContent, PopoverContentProps, PopoverTrigger } from "./popover/Popover.cjs";
47
47
  import "./popover/index.cjs";
48
- import { Rating, RatingButton, RatingButtonProps, RatingProps } from "./Rating.cjs";
48
+ import { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps } from "./Rating.cjs";
49
49
  import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarItems } from "./rich-text-editor/RichTextEditor.cjs";
50
50
  import "./rich-text-editor/index.cjs";
51
51
  import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.cjs";
@@ -74,4 +74,4 @@ import { Toaster } from "./toast/ToastProvider.cjs";
74
74
  import "./toast/index.cjs";
75
75
  import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.cjs";
76
76
  import { cn } from "@pixpilot/shadcn";
77
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
77
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
package/dist/index.d.ts CHANGED
@@ -47,7 +47,7 @@ import { Pagination, PaginationProps } from "./pagination/Pagination.js";
47
47
  import "./pagination/index.js";
48
48
  import { Popover, PopoverAnchor, PopoverContent, PopoverContentProps, PopoverTrigger } from "./popover/Popover.js";
49
49
  import "./popover/index.js";
50
- import { Rating, RatingButton, RatingButtonProps, RatingProps } from "./Rating.js";
50
+ import { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps } from "./Rating.js";
51
51
  import { RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ToolbarItems } from "./rich-text-editor/RichTextEditor.js";
52
52
  import "./rich-text-editor/index.js";
53
53
  import { ScaledPreview, ScaledPreviewProps, ScaledPreviewSize } from "./ScaledPreview.js";
@@ -76,4 +76,4 @@ import { Toaster } from "./toast/ToastProvider.js";
76
76
  import "./toast/index.js";
77
77
  import { isSvgMarkupString, svgMarkupToMaskUrl } from "./utils/svg.js";
78
78
  import { cn } from "@pixpilot/shadcn";
79
- export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
79
+ export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogProvider, DialogProviderProps, DialogTitle, DialogTrigger, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, IconToggle, IconToggleProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, Popover, PopoverAnchor, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverTrigger, PresetColor, Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps, RichTextEditor, RichTextEditorProps, RichTextEditorSlots, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectContentProps, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ToastMessage, Toaster, ToolbarItems, cn, isSvgMarkupString, showConfirmDialog, svgMarkupToMaskUrl, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime13 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeDropdown.d.ts
4
4
  interface ThemeModeDropdownProps {
@@ -17,7 +17,7 @@ interface ThemeModeDropdownProps {
17
17
  * Provides Light / Dark / System options.
18
18
  * Pure component - requires themeValue and onChange props.
19
19
  */
20
- declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime13.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime15.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
4
  type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
@@ -25,7 +25,7 @@ interface ThemeModeSwitchInsideProps {
25
25
  * Icons are embedded within the switch control.
26
26
  * Pure component - requires value and onChange props.
27
27
  */
28
- declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime14.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime16.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime15 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
4
  interface ThemeModeSwitchOutsideProps {
@@ -22,7 +22,7 @@ interface ThemeModeSwitchOutsideProps {
22
22
  * Icons flank the switch control on either side.
23
23
  * Pure component - requires value and onChange props.
24
24
  */
25
- declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime15.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime17.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
@@ -13,7 +13,7 @@ interface ThemeModeToggleButtonProps {
13
13
  * Light/Dark toggle button.
14
14
  * Pure component - toggles between light and dark.
15
15
  */
16
- declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime16.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime14.JSX.Element;
17
17
  declare namespace ThemeModeToggleButton {
18
18
  var displayName: string;
19
19
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "0.45.0",
4
+ "version": "0.46.0",
5
5
  "description": "Custom UI components and utilities built with shadcn/ui.",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",
@@ -61,11 +61,11 @@
61
61
  "tsdown": "^0.15.12",
62
62
  "typescript": "^5.9.3",
63
63
  "@internal/eslint-config": "0.3.0",
64
+ "@internal/hooks": "0.0.0",
64
65
  "@internal/prettier-config": "0.0.1",
65
66
  "@internal/tsconfig": "0.1.0",
66
67
  "@internal/tsdown-config": "0.1.0",
67
- "@internal/vitest-config": "0.1.0",
68
- "@internal/hooks": "0.0.0"
68
+ "@internal/vitest-config": "0.1.0"
69
69
  },
70
70
  "prettier": "@internal/prettier-config",
71
71
  "scripts": {