@pixpilot/shadcn 1.2.7 → 1.3.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.
@@ -83,7 +83,9 @@ interface ColorPickerSwatchProps extends Omit<DivProps, 'color'> {
83
83
  }
84
84
  declare function ColorPickerSwatch(props: ColorPickerSwatchProps): react_jsx_runtime41.JSX.Element;
85
85
  declare function ColorPickerEyeDropper(props: React.ComponentProps<typeof Button>): react_jsx_runtime41.JSX.Element | null;
86
- interface ColorPickerFormatSelectProps extends Omit<React.ComponentProps<typeof Select>, 'value' | 'onValueChange'>, Pick<React.ComponentProps<typeof SelectTrigger>, 'size' | 'className'> {}
86
+ interface ColorPickerFormatSelectProps extends Omit<React.ComponentProps<typeof Select>, 'value' | 'onValueChange'>, Pick<React.ComponentProps<typeof SelectTrigger>, 'size' | 'className'> {
87
+ id?: string;
88
+ }
87
89
  declare function ColorPickerFormatSelect(props: ColorPickerFormatSelectProps): react_jsx_runtime41.JSX.Element;
88
90
  interface ColorPickerInputProps extends Omit<React.ComponentProps<typeof Input>, 'value' | 'onChange' | 'color'> {
89
91
  withoutAlpha?: boolean;
@@ -37,6 +37,9 @@ const colorFormats = [
37
37
  "hsl",
38
38
  "hsb"
39
39
  ];
40
+ function getId(baseId, suffix) {
41
+ return baseId === void 0 ? void 0 : `${baseId}-${suffix}`;
42
+ }
40
43
  function hexToRgb(hex, alpha) {
41
44
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
42
45
  return result ? {
@@ -772,7 +775,7 @@ function ColorPickerEyeDropper(props) {
772
775
  });
773
776
  }
774
777
  function ColorPickerFormatSelect(props) {
775
- const { size, disabled, className,...selectProps } = props;
778
+ const { id, size, disabled, className,...selectProps } = props;
776
779
  const context = useColorPickerContext(FORMAT_SELECT_NAME);
777
780
  const store = useStoreContext(FORMAT_SELECT_NAME);
778
781
  const isDisabled = disabled || context.disabled;
@@ -787,11 +790,13 @@ function ColorPickerFormatSelect(props) {
787
790
  onValueChange: onFormatChange,
788
791
  disabled: isDisabled,
789
792
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
793
+ id,
790
794
  "data-slot": "color-picker-format-select-trigger",
791
795
  size: size ?? "sm",
792
796
  className: cn(className),
793
797
  children: /* @__PURE__ */ jsx(SelectValue, {})
794
798
  }), /* @__PURE__ */ jsx(SelectContent, { children: colorFormats.map((format$1) => /* @__PURE__ */ jsx(SelectItem, {
799
+ id: getId(id, `option-${format$1}`),
795
800
  value: format$1,
796
801
  children: format$1.toUpperCase()
797
802
  }, format$1)) })]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn",
3
3
  "type": "module",
4
- "version": "1.2.7",
4
+ "version": "1.3.1",
5
5
  "description": "A collection of reusable UI components built with shadcn/ui and Radix UI primitives.",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",