@timeax/form-palette 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -8,7 +8,6 @@ import { DayPicker } from 'react-day-picker';
8
8
  import * as class_variance_authority_types from 'class-variance-authority/types';
9
9
  import { VariantProps } from 'class-variance-authority';
10
10
  import * as SwitchPrimitive from '@radix-ui/react-switch';
11
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
11
  import { $ZodError } from 'zod/v4/core';
13
12
  import './../../../../node_modules/@inertiajs/core/types/types.d';
14
13
  import 'axios';
@@ -1870,8 +1869,6 @@ interface ShadcnToggleUiProps extends Omit<React.ComponentProps<typeof Switch>,
1870
1869
  */
1871
1870
  type ShadcnToggleVariantProps$1 = ShadcnToggleUiProps & Pick<BaseProps, "value" | "onValue" | "error">;
1872
1871
 
1873
- declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): react_jsx_runtime.JSX.Element;
1874
-
1875
1872
  /**
1876
1873
  * Visual size of the radio UI.
1877
1874
  */
@@ -1919,6 +1916,7 @@ interface RadioRenderOptionContext<TValue> {
1919
1916
  disabled: boolean;
1920
1917
  size: RadioSize;
1921
1918
  density: RadioDensity;
1919
+ click(): void;
1922
1920
  /**
1923
1921
  * DOM id of this option (tied to the underlying RadioGroupItem).
1924
1922
  */
@@ -1956,7 +1954,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
1956
1954
  * items = [{ id: "free", title: "Free" }]
1957
1955
  * optionValue = "id"
1958
1956
  */
1959
- optionValue?: keyof TItem;
1957
+ optionValue?: (keyof TItem) | string;
1960
1958
  /**
1961
1959
  * Property name on TItem that holds the **label**.
1962
1960
  *
@@ -1964,7 +1962,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
1964
1962
  * items = [{ id: "free", title: "Free" }]
1965
1963
  * optionLabel = "title"
1966
1964
  */
1967
- optionLabel?: keyof TItem;
1965
+ optionLabel?: (keyof TItem) | string;
1968
1966
  /**
1969
1967
  * Optional custom renderer for each option.
1970
1968
  *
@@ -2027,8 +2025,9 @@ interface ShadcnRadioUiProps<TItem, TValue> {
2027
2025
  /**
2028
2026
  * Full props for the Shadcn-based radio variant.
2029
2027
  */
2030
- type ShadcnRadioVariantProps<TValue, TItem = RadioItem<TValue>> = ShadcnRadioUiProps<TItem, TValue> & Pick<VariantBaseProps<TValue | undefined>, "value" | "onValue" | "error" | "disabled" | "required"> & Pick<React.ComponentProps<typeof RadioGroup>, "name"> & {
2028
+ type ShadcnRadioVariantProps<TValue, TItem = RadioItem<TValue>> = ShadcnRadioUiProps<TItem, TValue> & Pick<VariantBaseProps<TValue | undefined>, "value" | "onValue" | "error" | "disabled" | "required"> & {
2031
2029
  id?: string;
2030
+ name?: string;
2032
2031
  className?: string;
2033
2032
  "aria-describedby"?: string;
2034
2033
  };
@@ -2094,6 +2093,7 @@ interface CheckboxRenderOptionContext<TValue> {
2094
2093
  size: CheckboxSize;
2095
2094
  density: CheckboxDensity;
2096
2095
  checkboxId?: string;
2096
+ click(): void;
2097
2097
  /**
2098
2098
  * Prebuilt Shadcn checkbox node.
2099
2099
  */
@@ -2354,6 +2354,7 @@ interface ShadcnMultiSelectVariantProps extends Pick<VariantBaseProps<SelectPrim
2354
2354
  selected: boolean;
2355
2355
  index: number;
2356
2356
  option: React.ReactNode;
2357
+ click(): void;
2357
2358
  }) => React.ReactNode;
2358
2359
  /**
2359
2360
  * Custom renderer for the trigger summary.
@@ -2760,6 +2761,7 @@ interface ShadcnTreeSelectVariantProps extends Pick<VariantBaseProps<TreeValue>,
2760
2761
  selected: boolean;
2761
2762
  index: number;
2762
2763
  option: React.ReactNode;
2764
+ click(): void;
2763
2765
  }) => React.ReactNode;
2764
2766
  renderValue?: (ctx: {
2765
2767
  selectedItems: NormalizedTreeItem[];
@@ -2974,6 +2976,7 @@ interface ShadcnSelectVariantProps extends Pick<VariantBaseProps<SelectPrimitive
2974
2976
  selected: boolean;
2975
2977
  index: number;
2976
2978
  option: React.ReactNode;
2979
+ click(): void;
2977
2980
  }) => React.ReactNode;
2978
2981
  /**
2979
2982
  * Custom renderer for the trigger value.
package/dist/index.d.ts CHANGED
@@ -8,7 +8,6 @@ import { DayPicker } from 'react-day-picker';
8
8
  import * as class_variance_authority_types from 'class-variance-authority/types';
9
9
  import { VariantProps } from 'class-variance-authority';
10
10
  import * as SwitchPrimitive from '@radix-ui/react-switch';
11
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
11
  import { $ZodError } from 'zod/v4/core';
13
12
  import './../../../../node_modules/@inertiajs/core/types/types.d';
14
13
  import 'axios';
@@ -1870,8 +1869,6 @@ interface ShadcnToggleUiProps extends Omit<React.ComponentProps<typeof Switch>,
1870
1869
  */
1871
1870
  type ShadcnToggleVariantProps$1 = ShadcnToggleUiProps & Pick<BaseProps, "value" | "onValue" | "error">;
1872
1871
 
1873
- declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): react_jsx_runtime.JSX.Element;
1874
-
1875
1872
  /**
1876
1873
  * Visual size of the radio UI.
1877
1874
  */
@@ -1919,6 +1916,7 @@ interface RadioRenderOptionContext<TValue> {
1919
1916
  disabled: boolean;
1920
1917
  size: RadioSize;
1921
1918
  density: RadioDensity;
1919
+ click(): void;
1922
1920
  /**
1923
1921
  * DOM id of this option (tied to the underlying RadioGroupItem).
1924
1922
  */
@@ -1956,7 +1954,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
1956
1954
  * items = [{ id: "free", title: "Free" }]
1957
1955
  * optionValue = "id"
1958
1956
  */
1959
- optionValue?: keyof TItem;
1957
+ optionValue?: (keyof TItem) | string;
1960
1958
  /**
1961
1959
  * Property name on TItem that holds the **label**.
1962
1960
  *
@@ -1964,7 +1962,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
1964
1962
  * items = [{ id: "free", title: "Free" }]
1965
1963
  * optionLabel = "title"
1966
1964
  */
1967
- optionLabel?: keyof TItem;
1965
+ optionLabel?: (keyof TItem) | string;
1968
1966
  /**
1969
1967
  * Optional custom renderer for each option.
1970
1968
  *
@@ -2027,8 +2025,9 @@ interface ShadcnRadioUiProps<TItem, TValue> {
2027
2025
  /**
2028
2026
  * Full props for the Shadcn-based radio variant.
2029
2027
  */
2030
- type ShadcnRadioVariantProps<TValue, TItem = RadioItem<TValue>> = ShadcnRadioUiProps<TItem, TValue> & Pick<VariantBaseProps<TValue | undefined>, "value" | "onValue" | "error" | "disabled" | "required"> & Pick<React.ComponentProps<typeof RadioGroup>, "name"> & {
2028
+ type ShadcnRadioVariantProps<TValue, TItem = RadioItem<TValue>> = ShadcnRadioUiProps<TItem, TValue> & Pick<VariantBaseProps<TValue | undefined>, "value" | "onValue" | "error" | "disabled" | "required"> & {
2031
2029
  id?: string;
2030
+ name?: string;
2032
2031
  className?: string;
2033
2032
  "aria-describedby"?: string;
2034
2033
  };
@@ -2094,6 +2093,7 @@ interface CheckboxRenderOptionContext<TValue> {
2094
2093
  size: CheckboxSize;
2095
2094
  density: CheckboxDensity;
2096
2095
  checkboxId?: string;
2096
+ click(): void;
2097
2097
  /**
2098
2098
  * Prebuilt Shadcn checkbox node.
2099
2099
  */
@@ -2354,6 +2354,7 @@ interface ShadcnMultiSelectVariantProps extends Pick<VariantBaseProps<SelectPrim
2354
2354
  selected: boolean;
2355
2355
  index: number;
2356
2356
  option: React.ReactNode;
2357
+ click(): void;
2357
2358
  }) => React.ReactNode;
2358
2359
  /**
2359
2360
  * Custom renderer for the trigger summary.
@@ -2760,6 +2761,7 @@ interface ShadcnTreeSelectVariantProps extends Pick<VariantBaseProps<TreeValue>,
2760
2761
  selected: boolean;
2761
2762
  index: number;
2762
2763
  option: React.ReactNode;
2764
+ click(): void;
2763
2765
  }) => React.ReactNode;
2764
2766
  renderValue?: (ctx: {
2765
2767
  selectedItems: NormalizedTreeItem[];
@@ -2974,6 +2976,7 @@ interface ShadcnSelectVariantProps extends Pick<VariantBaseProps<SelectPrimitive
2974
2976
  selected: boolean;
2975
2977
  index: number;
2976
2978
  option: React.ReactNode;
2979
+ click(): void;
2977
2980
  }) => React.ReactNode;
2978
2981
  /**
2979
2982
  * Custom renderer for the trigger value.
package/dist/index.js CHANGED
@@ -35570,6 +35570,7 @@ var InnerShadcnRadioVariant = (props, ref) => {
35570
35570
  () => normalizeItems(
35571
35571
  items,
35572
35572
  mappers,
35573
+ //@ts-ignore
35573
35574
  optionValue,
35574
35575
  optionLabel
35575
35576
  ),
@@ -35702,6 +35703,10 @@ var InnerShadcnRadioVariant = (props, ref) => {
35702
35703
  size: size4,
35703
35704
  density,
35704
35705
  optionId,
35706
+ click() {
35707
+ if (optionDisabled) return;
35708
+ handleSelect(displayItem.value);
35709
+ },
35705
35710
  radio: radioNode
35706
35711
  })
35707
35712
  },
@@ -36593,6 +36598,11 @@ var InnerShadcnCheckboxVariant = (props, ref) => {
36593
36598
  size: size4,
36594
36599
  density,
36595
36600
  checkboxId,
36601
+ click() {
36602
+ if (optionDisabled) return;
36603
+ const nextInternal = effectiveTristate ? internalState === "none" ? true : internalState === true ? false : "none" : internalState === true ? false : true;
36604
+ updateGroupValue(item.value, nextInternal, effectiveTristate);
36605
+ },
36596
36606
  checkbox: checkboxNode
36597
36607
  }),
36598
36608
  hiddenInput
@@ -37014,7 +37024,13 @@ var ShadcnSelectVariant = React54__namespace.forwardRef(function ShadcnSelectVar
37014
37024
  item,
37015
37025
  selected: selectedItem != null && String(selectedItem.value) === String(item.value),
37016
37026
  index: index2,
37017
- option: optionNode
37027
+ option: optionNode,
37028
+ click() {
37029
+ if (disabled || readOnly || item.disabled) return;
37030
+ handleChange(String(item.value));
37031
+ setOpen(false);
37032
+ setQuery("");
37033
+ }
37018
37034
  });
37019
37035
  }),
37020
37036
  virtualScroll && renderedItems.length < filteredItems.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1 text-[10px] text-muted-foreground text-center", children: "Scroll to load more\u2026" })
@@ -37756,7 +37772,11 @@ var ShadcnMultiSelectVariant = React54__namespace.forwardRef(function ShadcnMult
37756
37772
  item,
37757
37773
  selected,
37758
37774
  index: index2,
37759
- option: row
37775
+ option: row,
37776
+ click() {
37777
+ if (item.disabled) return;
37778
+ handleToggleValue(item.value);
37779
+ }
37760
37780
  });
37761
37781
  }),
37762
37782
  showSelectAll && selectAllPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -40399,7 +40419,7 @@ var ShadcnTreeSelectVariant = React54__namespace.forwardRef(function ShadcnTreeS
40399
40419
  displayedNodes.map((item, index2) => {
40400
40420
  const selected = selectedValues.includes(item.value);
40401
40421
  const isExpanded = expanded.has(item.value);
40402
- return /* @__PURE__ */ jsxRuntime.jsxs(
40422
+ const optionNode = /* @__PURE__ */ jsxRuntime.jsxs(
40403
40423
  "div",
40404
40424
  {
40405
40425
  className: cn(
@@ -40457,6 +40477,16 @@ var ShadcnTreeSelectVariant = React54__namespace.forwardRef(function ShadcnTreeS
40457
40477
  },
40458
40478
  item.key
40459
40479
  );
40480
+ if (!renderOption) return optionNode;
40481
+ return renderOption({
40482
+ item,
40483
+ selected,
40484
+ index: index2,
40485
+ option: optionNode,
40486
+ click() {
40487
+ if (!item.disabled) handleToggleValue(item);
40488
+ }
40489
+ });
40460
40490
  })
40461
40491
  ] });
40462
40492
  const SelectBody = /* @__PURE__ */ jsxRuntime.jsxs(