@gridui/choice 1.2.6 → 1.3.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.
package/README.md CHANGED
@@ -47,3 +47,8 @@ Only the setting copy and indicator are dimmed. Standalone Switch retains its
47
47
  whole-control disabled appearance.
48
48
 
49
49
  [Component reference](docs/reference/README.md) contains focused API pages for each public component.
50
+
51
+ Shared animation policy and tempo come from `MotionConfig` in `@gridui/motion`.
52
+ Disabled or reduced-motion policy settles decoration without disabling interaction.
53
+ See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/motion)
54
+ for CSS scopes, portal behavior, and specialized timing contracts.
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ var useChoice = (props) => {
49
49
 
50
50
  // src/checkbox/style.ts
51
51
  import { cva } from "class-variance-authority";
52
- var choiceStyles = cva("gridui-u-choice--inline-flex gridui-u-choice--size-5 gridui-u-choice--shrink-0 gridui-u-choice--cursor-pointer gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--rounded-control gridui-u-choice--border gridui-u-choice--border-control-border gridui-u-choice--bg-background gridui-u-choice--text-foreground gridui-u-choice--align-middle gridui-u-choice--data-[state=checked]:bg-accent-background gridui-u-choice--data-[state=checked]:text-accent-foreground gridui-u-choice--data-[state=indeterminate]:bg-accent-background gridui-u-choice--data-[state=indeterminate]:text-accent-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--data-readonly:cursor-default gridui-u-choice--aria-invalid:border-danger-foreground");
52
+ var choiceStyles = cva("gridui-u-choice--inline-flex gridui-u-choice--size-5 gridui-u-choice--shrink-0 gridui-u-choice--cursor-pointer gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--rounded-control gridui-u-choice--border gridui-u-choice--border-control-border gridui-u-choice--bg-background gridui-u-choice--text-foreground gridui-u-choice--align-middle gridui-u-choice--data-[state=checked]:bg-accent-background gridui-u-choice--data-[state=checked]:text-accent-foreground gridui-u-choice--data-[state=indeterminate]:bg-accent-background gridui-u-choice--data-[state=indeterminate]:text-accent-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--data-readonly:cursor-default gridui-u-choice--aria-invalid:border-status-danger-border");
53
53
 
54
54
  // src/checkbox/checkbox.tsx
55
55
  import { cn } from "@gridui/style-utils";
@@ -148,9 +148,11 @@ var Checkbox = (props) => {
148
148
  };
149
149
 
150
150
  // src/shared/switch-control.tsx
151
+ import { useMotionStyle } from "@gridui/motion/policy";
151
152
  import { cn as cn2 } from "@gridui/style-utils";
152
153
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
153
154
  var SwitchControl = (props) => {
155
+ const motionStyle = useMotionStyle();
154
156
  const {
155
157
  children,
156
158
  className,
@@ -197,6 +199,7 @@ var SwitchControl = (props) => {
197
199
  event.preventDefault();
198
200
  },
199
201
  className: cn2("gridui-switch-control", className),
202
+ style: { ...props.style, ...motionStyle },
200
203
  children: children(current)
201
204
  }
202
205
  ),
@@ -235,9 +238,11 @@ var SwitchControl = (props) => {
235
238
  };
236
239
 
237
240
  // src/shared/switch-indicator.tsx
241
+ import { useMotionStyle as useMotionStyle2 } from "@gridui/motion/policy";
238
242
  import { Check as Check2, Minus as Minus2 } from "lucide-react";
239
243
  import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
240
244
  var SwitchIndicator = (props) => {
245
+ const motionStyle = useMotionStyle2();
241
246
  const { checked, variant = "rail", stateLabels = {
242
247
  checked: "On",
243
248
  unchecked: "Off"
@@ -249,6 +254,7 @@ var SwitchIndicator = (props) => {
249
254
  "data-variant": variant,
250
255
  "data-state": checked ? "checked" : "unchecked",
251
256
  "aria-hidden": "true",
257
+ style: motionStyle,
252
258
  children: variant === "rail" ? /* @__PURE__ */ jsx3(
253
259
  "span",
254
260
  {
@@ -505,7 +511,7 @@ var ToggleGroup = (props) => {
505
511
 
506
512
  // src/toggle-group-item/style.ts
507
513
  import { cva as cva4 } from "class-variance-authority";
508
- var toggleStyles = cva4("gridui-u-choice--min-h-gridui-control gridui-u-choice--cursor-pointer gridui-u-choice--border-0 gridui-u-choice--bg-background gridui-u-choice--px-gridui-16 gridui-u-choice--py-gridui-8 gridui-u-choice--text-foreground gridui-u-choice--type-ui gridui-u-choice--data-[state=on]:bg-brand-tint gridui-u-choice--data-[state=on]:text-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--forced-colors:data-[state=on]:forced-color-adjust-none gridui-u-choice--forced-colors:data-[state=on]:bg-[Highlight] gridui-u-choice--forced-colors:data-[state=on]:text-[HighlightText] gridui-u-choice--forced-colors:outline-[CanvasText]", {
514
+ var toggleStyles = cva4("gridui-u-choice--min-h-gridui-control gridui-u-choice--cursor-pointer gridui-u-choice--border-0 gridui-u-choice--bg-background gridui-u-choice--px-gridui-16 gridui-u-choice--py-gridui-8 gridui-u-choice--text-foreground gridui-u-choice--type-ui gridui-u-choice--data-[state=on]:bg-selection-background gridui-u-choice--data-[state=on]:text-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--forced-colors:data-[state=on]:forced-color-adjust-none gridui-u-choice--forced-colors:data-[state=on]:bg-[Highlight] gridui-u-choice--forced-colors:data-[state=on]:text-[HighlightText] gridui-u-choice--forced-colors:outline-[CanvasText]", {
509
515
  variants: {
510
516
  layout: {
511
517
  standard: "gridui-u-choice--grow gridui-u-choice--basis-auto gridui-u-choice--min-w-0 gridui-u-choice--max-w-full gridui-u-choice--whitespace-normal gridui-u-choice--wrap-anywhere",
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/shared/use-choice.ts", "../src/checkbox/style.ts", "../src/checkbox/checkbox.tsx", "../src/shared/switch-control.tsx", "../src/shared/switch-indicator.tsx", "../src/switch/style.ts", "../src/switch/switch.tsx", "../src/shared/switch-setting.tsx", "../src/switch-group/switch-group.tsx", "../src/switch-panel/switch-panel.tsx", "../src/shared/context.ts", "../src/toggle-group/style.ts", "../src/toggle-group/toggle-group.tsx", "../src/toggle-group-item/style.ts", "../src/toggle-group-item/toggle-group-item.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Use Choice\n */\n\nimport { focusInvalidControl, useFormReset } from \"@gridui/form\";\nimport { type ChangeDetails, changeDetails } from \"@gridui/interaction\";\nimport { type ComponentPropsWithRef, type Ref, type SyntheticEvent, useImperativeHandle, useRef, useState } from \"react\";\n\nexport type ChoiceProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onChange\" | \"defaultChecked\"> & {\n readonly checked?: boolean | undefined;\n readonly defaultChecked?: boolean | undefined;\n readonly readOnly?: boolean | undefined;\n readonly required?: boolean | undefined;\n readonly uncheckedValue?: string | undefined;\n readonly inputRef?: Ref<HTMLInputElement> | undefined;\n readonly onCheckedChange?: ((checked: boolean, details: ChangeDetails) => void) | undefined;\n};\n\nexport const useChoice = (props: ChoiceProps) => {\n const { checked, defaultChecked = false, onCheckedChange, readOnly, disabled, inputRef, form } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultChecked);\n const input = useRef<HTMLInputElement>(null);\n const control = useRef<HTMLButtonElement>(null);\n const initial = useRef(defaultChecked);\n useImperativeHandle(props.ref, () => {\n return control.current as HTMLButtonElement;\n });\n useImperativeHandle(inputRef, () => {\n return input.current as HTMLInputElement;\n });\n useFormReset(input, () => {\n if (checked === undefined) {\n setLocal(initial.current);\n }\n }, form);\n const current = checked ?? local;\n const invalid = (event: SyntheticEvent<HTMLInputElement>) => {\n focusInvalidControl(event, () => {\n control.current?.focus();\n });\n };\n const change = (next: boolean, event: Event) => {\n if (readOnly || disabled || input.current?.matches(\":disabled\")) {\n return;\n }\n const details = changeDetails(event);\n onCheckedChange?.(next, details);\n if (!details.isCanceled && checked === undefined) {\n setLocal(next);\n }\n };\n return {\n current,\n input,\n control,\n change,\n invalid,\n };\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Checkbox\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const choiceStyles = cva(\"gridui-u-choice--inline-flex gridui-u-choice--size-5 gridui-u-choice--shrink-0 gridui-u-choice--cursor-pointer gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--rounded-control gridui-u-choice--border gridui-u-choice--border-control-border gridui-u-choice--bg-background gridui-u-choice--text-foreground gridui-u-choice--align-middle gridui-u-choice--data-[state=checked]:bg-accent-background gridui-u-choice--data-[state=checked]:text-accent-foreground gridui-u-choice--data-[state=indeterminate]:bg-accent-background gridui-u-choice--data-[state=indeterminate]:text-accent-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--data-readonly:cursor-default gridui-u-choice--aria-invalid:border-danger-foreground\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Checkbox\n * @description Checkbox\n */\n\nimport { type ChoiceProps, useChoice } from \"../shared/use-choice\";\nimport { choiceStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-checkbox\";\nimport { Check, Minus } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type CheckboxProps = ChoiceProps & {\n readonly indeterminate?: boolean | undefined;\n};\n\nexport const Checkbox: FC<CheckboxProps> = (props: CheckboxProps) => {\n const { className, indeterminate, inputRef, onCheckedChange, checked, defaultChecked,\n readOnly, uncheckedValue, name, value = \"on\", form, required, onClick, ...restProps } = props;\n const { current, input, control, change, invalid } = useChoice({\n ...props,\n inputRef,\n onCheckedChange,\n checked,\n defaultChecked,\n });\n return (<>\n <Primitive.Root\n {...restProps}\n ref={control}\n checked={indeterminate ? \"indeterminate\" : current}\n aria-required={required}\n aria-readonly={readOnly}\n data-readonly={readOnly ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n change(indeterminate ? true : !current, event.nativeEvent);\n }\n event.preventDefault();\n }}\n className={cn(choiceStyles(), className)}\n >\n <Primitive.Indicator>\n {indeterminate ? (<Minus\n size={16}\n aria-hidden=\"true\"\n />) : (<Check\n size={16}\n aria-hidden=\"true\"\n />)}\n </Primitive.Indicator>\n </Primitive.Root>\n <input\n ref={input}\n type=\"checkbox\"\n className=\"gridui-u-choice--sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n name={name}\n value={value}\n form={form}\n required={required}\n disabled={props.disabled}\n checked={current}\n readOnly={readOnly}\n onInvalid={invalid}\n onChange={(event) => {\n change(event.target.checked, event.nativeEvent);\n }}\n />\n {!current && uncheckedValue !== undefined && (<input\n type=\"hidden\"\n name={name}\n form={form}\n value={uncheckedValue}\n disabled={props.disabled}\n />)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Control\n */\n\nimport { type ChoiceProps, useChoice } from \"./use-choice\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC, ReactNode } from \"react\";\n\nexport type SwitchControlProps = ChoiceProps & {\n readonly children: (checked: boolean) => ReactNode;\n};\n\nexport const SwitchControl: FC<SwitchControlProps> = (props: SwitchControlProps) => {\n const { children, className, inputRef, onCheckedChange, checked, defaultChecked,\n readOnly, uncheckedValue, name, value = \"on\", form, required, onClick, type = \"button\", ...restProps } = props;\n const { current, input, control, change, invalid } = useChoice({\n ...props,\n inputRef,\n onCheckedChange,\n checked,\n defaultChecked,\n });\n return (<>\n <button\n {...restProps}\n ref={control}\n type={type}\n role=\"switch\"\n aria-checked={current}\n data-state={current ? \"checked\" : \"unchecked\"}\n data-disabled={props.disabled ? \"\" : undefined}\n aria-required={required}\n aria-readonly={readOnly}\n data-readonly={readOnly ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n change(!current, event.nativeEvent);\n }\n event.preventDefault();\n }}\n className={cn(\"gridui-switch-control\", className)}\n >\n {children(current)}\n </button>\n <input\n ref={input}\n type=\"checkbox\"\n className=\"gridui-u-choice--sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n name={name}\n value={value}\n form={form}\n required={required}\n disabled={props.disabled}\n checked={current}\n readOnly={readOnly}\n onInvalid={invalid}\n onChange={(event) => {\n change(event.target.checked, event.nativeEvent);\n }}\n />\n {!current && uncheckedValue !== undefined && (<input\n type=\"hidden\"\n name={name}\n form={form}\n value={uncheckedValue}\n disabled={props.disabled}\n />)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Indicator\n */\n\nimport type { SwitchPresentationProps } from \"./switch-options\";\nimport { Check, Minus } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type SwitchIndicatorProps = SwitchPresentationProps & {\n readonly checked: boolean;\n};\n\nexport const SwitchIndicator: FC<SwitchIndicatorProps> = (props: SwitchIndicatorProps) => {\n const { checked, variant = \"rail\", stateLabels = {\n checked: \"On\",\n unchecked: \"Off\",\n } } = props;\n return (<span\n className=\"gridui-switch-indicator gridui-u-choice--type-caption\"\n data-variant={variant}\n data-state={checked ? \"checked\" : \"unchecked\"}\n aria-hidden=\"true\"\n >\n {variant === \"rail\" ? (<span\n className=\"gridui-switch-thumb\"\n />) : (<>\n {checked ? (<Check\n className=\"gridui-switch-state-icon\"\n />) : (<Minus\n className=\"gridui-switch-state-icon\"\n />)}\n <span\n className=\"gridui-switch-state-label\"\n >\n {checked ? stateLabels.checked : stateLabels.unchecked}\n </span>\n </>)}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Switch\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const switchStyles = cva(\"gridui-switch gridui-u-choice--inline-flex gridui-u-choice--w-fit gridui-u-choice--max-w-full gridui-u-choice--min-h-gridui-control gridui-u-choice--min-w-gridui-control gridui-u-choice--shrink-0 gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--border-0 gridui-u-choice--bg-transparent gridui-u-choice--p-0 gridui-u-choice--align-middle gridui-u-choice--rounded-control\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Switch\n * @description Switch\n */\n\nimport { SwitchControl } from \"../shared/switch-control\";\nimport { SwitchIndicator } from \"../shared/switch-indicator\";\nimport type { SwitchOptions } from \"../shared/switch-options\";\nimport { switchStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type SwitchProps = SwitchOptions;\n\nexport const Switch: FC<SwitchProps> = (props: SwitchProps) => {\n const { variant, stateLabels, className, ...restProps } = props;\n return (<SwitchControl\n {...restProps}\n className={cn(switchStyles(), className)}\n >\n {(checked) => {\n return (<SwitchIndicator\n checked={checked}\n variant={variant}\n stateLabels={stateLabels}\n />);\n }}\n </SwitchControl>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Setting\n */\n\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchIndicator } from \"./switch-indicator\";\nimport type { SwitchSettingOptions } from \"./switch-options\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type FC, useId } from \"react\";\n\nexport type SwitchSettingProps = SwitchSettingOptions;\n\nexport const SwitchSetting: FC<SwitchSettingProps> = (props: SwitchSettingProps) => {\n const { control, label, description } = props;\n const { variant, stateLabels, className, ...controlProps } = control;\n const id = useId();\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n const hasDescription = description !== undefined && description !== null;\n const describedBy = [\n controlProps[\"aria-describedby\"],\n hasDescription ? descriptionId : undefined,\n ].filter(Boolean).join(\" \") || undefined;\n return (<SwitchControl\n {...controlProps}\n className={cn(\"gridui-switch-setting\", className)}\n aria-labelledby={controlProps[\"aria-labelledby\"] ?? (controlProps[\"aria-label\"] ? undefined : labelId)}\n aria-describedby={describedBy}\n >\n {(checked) => {\n return (<>\n <span\n className=\"gridui-switch-setting-copy\"\n >\n <span\n id={labelId}\n className=\"gridui-u-choice--type-ui\"\n >\n {label}\n </span>\n {hasDescription && (<span\n id={descriptionId}\n className=\"gridui-switch-setting-description gridui-u-choice--type-supporting\"\n >\n {description}\n </span>)}\n </span>\n <span\n className=\"gridui-switch-setting-end\"\n >\n <SwitchIndicator\n checked={checked}\n variant={variant}\n stateLabels={stateLabels}\n />\n </span>\n </>);\n }}\n </SwitchControl>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace SwitchGroup\n * @description Switch Group\n */\n\nimport type { SwitchOptions, SwitchPresentationProps, SwitchSettingCopy } from \"../shared/switch-options\";\nimport { SwitchSetting } from \"../shared/switch-setting\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type SwitchGroupItem = SwitchOptions & SwitchSettingCopy & {\n /** Stable item identity and native control ID. */\n readonly id: string;\n};\n\nexport type SwitchGroupProps = Omit<ComponentPropsWithRef<\"fieldset\">, \"children\"> & SwitchPresentationProps & {\n readonly items: readonly SwitchGroupItem[];\n readonly legend?: ReactNode;\n readonly density?: \"compact\" | \"comfortable\";\n};\n\nexport const SwitchGroup: FC<SwitchGroupProps> = (props: SwitchGroupProps) => {\n const { items, legend, density = \"compact\", variant, stateLabels, className, ...restProps } = props;\n return (<fieldset\n {...restProps}\n className={cn(\"gridui-switch-group\", className)}\n data-density={density}\n >\n {legend !== undefined && legend !== null && (<legend\n className=\"gridui-switch-group-legend gridui-u-choice--type-ui\"\n >\n {legend}\n </legend>)}\n {items.map((item) => {\n const { label, description, ...control } = item;\n return (<SwitchSetting\n key={item.id}\n label={label}\n description={description}\n control={{\n ...control,\n variant: item.variant ?? variant,\n stateLabels: item.stateLabels ?? stateLabels,\n }}\n />);\n })}\n </fieldset>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace SwitchPanel\n * @description Switch Panel\n */\n\nimport type { SwitchSettingOptions } from \"../shared/switch-options\";\nimport { SwitchSetting } from \"../shared/switch-setting\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Children, type ComponentPropsWithRef, type FC } from \"react\";\n\nexport type SwitchPanelProps = ComponentPropsWithRef<\"div\"> & SwitchSettingOptions;\n\nexport const SwitchPanel: FC<SwitchPanelProps> = (props: SwitchPanelProps) => {\n const { label, description, control, children, className, ...restProps } = props;\n const hasContent = Children.toArray(children).some((child) => {\n return child !== \"\";\n });\n return (<div\n {...restProps}\n className={cn(\"gridui-switch-panel\", className)}\n >\n <SwitchSetting\n label={label}\n description={description}\n control={control}\n />\n {hasContent && (<div\n className=\"gridui-switch-panel-content\"\n >\n {children}\n </div>)}\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport const ToggleGroupContext = createContext<\"standard\" | \"cells\">(\"standard\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroup\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const toggleGroupStyles = cva(\"gridui-toggle-group gridui-u-choice--inline-flex gridui-u-choice--max-w-full gridui-u-choice--flex-wrap gridui-u-choice--gap-px gridui-u-choice--border gridui-u-choice--border-border gridui-u-choice--bg-border gridui-u-choice--data-[orientation=vertical]:flex-col\", {\n variants: {\n layout: {\n standard: \"\",\n cells: \"gridui-u-choice--grid gridui-u-choice--w-full gridui-u-choice--grid-flow-col gridui-u-choice--auto-cols-fr gridui-u-choice--data-[orientation=vertical]:grid-flow-row gridui-u-choice--data-[orientation=vertical]:auto-rows-fr gridui-u-choice--data-[orientation=vertical]:grid-cols-1\",\n },\n },\n defaultVariants: { layout: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroup\n * @description Toggle Group\n */\n\nimport { ToggleGroupContext } from \"../shared/context\";\nimport { toggleGroupStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-toggle-group\";\nimport { type ComponentPropsWithRef, type FC, useState } from \"react\";\n\nexport type ToggleGroupProps = Omit<ComponentPropsWithRef<typeof Primitive.Root>, \"type\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"loop\"> & {\n readonly multiple?: boolean | undefined;\n readonly value?: string[] | undefined;\n readonly defaultValue?: string[] | undefined;\n readonly onValueChange?: ((value: string[]) => void) | undefined;\n readonly loopFocus?: boolean | undefined;\n readonly layout?: \"standard\" | \"cells\" | undefined;\n};\n\nexport const ToggleGroup: FC<ToggleGroupProps> = (props: ToggleGroupProps) => {\n const { className, multiple, value, defaultValue, onValueChange, loopFocus = true, layout = \"standard\", ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultValue ?? []);\n const current = value ?? local;\n return (<ToggleGroupContext.Provider\n value={layout}\n >\n <Primitive.Root\n {...restProps}\n loop={loopFocus}\n className={cn(toggleGroupStyles({ layout }), className)}\n data-layout={layout}\n type=\"multiple\"\n value={multiple ? current : current.slice(-1)}\n onValueChange={(next) => {\n const selected = multiple ? next : next.slice(-1);\n if (value === undefined) {\n setLocal(selected);\n }\n onValueChange?.(selected);\n }}\n />\n </ToggleGroupContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroupItem\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const toggleStyles = cva(\"gridui-u-choice--min-h-gridui-control gridui-u-choice--cursor-pointer gridui-u-choice--border-0 gridui-u-choice--bg-background gridui-u-choice--px-gridui-16 gridui-u-choice--py-gridui-8 gridui-u-choice--text-foreground gridui-u-choice--type-ui gridui-u-choice--data-[state=on]:bg-brand-tint gridui-u-choice--data-[state=on]:text-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--forced-colors:data-[state=on]:forced-color-adjust-none gridui-u-choice--forced-colors:data-[state=on]:bg-[Highlight] gridui-u-choice--forced-colors:data-[state=on]:text-[HighlightText] gridui-u-choice--forced-colors:outline-[CanvasText]\", {\n variants: {\n layout: {\n standard: \"gridui-u-choice--grow gridui-u-choice--basis-auto gridui-u-choice--min-w-0 gridui-u-choice--max-w-full gridui-u-choice--whitespace-normal gridui-u-choice--wrap-anywhere\",\n cells: \"gridui-u-choice--w-full gridui-u-choice--min-w-0 gridui-u-choice--whitespace-normal gridui-u-choice--wrap-anywhere gridui-u-choice--border-x-0 gridui-u-choice--border-t-0 gridui-u-choice--border-solid gridui-u-choice--border-transparent gridui-u-choice--px-gridui-8 gridui-u-choice--py-gridui-16 gridui-u-choice--text-center gridui-u-choice--data-[orientation=horizontal]:border-b-2 gridui-u-choice--data-[orientation=vertical]:border-b-0 gridui-u-choice--data-[orientation=vertical]:border-r-2 gridui-u-choice--rtl:data-[orientation=vertical]:border-r-0 gridui-u-choice--rtl:data-[orientation=vertical]:border-l-2 gridui-u-choice--data-[state=on]:font-medium\",\n },\n },\n defaultVariants: {\n layout: \"standard\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroupItem\n * @description Toggle Group Item\n */\n\nimport { ToggleGroupContext } from \"../shared/context\";\nimport { toggleStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-toggle-group\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type ToggleGroupItemProps = ComponentPropsWithRef<typeof Primitive.Item>;\n\nexport const ToggleGroupItem: FC<ToggleGroupItemProps> = (props: ToggleGroupItemProps) => {\n const { className, ...restProps } = props;\n const layout = useContext(ToggleGroupContext);\n return (<Primitive.Item\n {...restProps}\n className={cn(toggleStyles({ layout }), className)}\n />);\n};\n"],
5
- "mappings": ";AAOA,SAAS,qBAAqB,oBAAoB;AAClD,SAA6B,qBAAqB;AAClD,SAAoE,qBAAqB,QAAQ,gBAAgB;AAY1G,IAAM,YAAY,CAAC,UAAuB;AAC7C,QAAM,EAAE,SAAS,iBAAiB,OAAO,iBAAiB,UAAU,UAAU,UAAU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AAW;AAAA,QAAV;AAAA,UACI,GAAG;AAAA,UACJ,MAAM;AAAA,UACN,WAAWH,IAAG,kBAAkB,EAAE,OAAO,CAAC,GAAG,SAAS;AAAA,UACtD,eAAa;AAAA,UACb,MAAK;AAAA,UACL,OAAO,WAAW,UAAU,QAAQ,MAAM,EAAE;AAAA,UAC5C,eAAe,CAAC,SAAS;AACrB,kBAAM,WAAW,WAAW,OAAO,KAAK,MAAM,EAAE;AAChD,gBAAI,UAAU,QAAW;AACrB,uBAAS,QAAQ;AAAA,YACrB;AACA,4BAAgB,QAAQ;AAAA,UAC5B;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;;;ACzCA,SAAS,OAAAI,YAAW;AAEb,IAAM,eAAeA,KAAI,irBAAirB;AAAA,EAC7sB,UAAU;AAAA,IACN,QAAQ;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,IACX;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,QAAQ;AAAA,EACZ;AACJ,CAAC;;;ACVD,SAAS,MAAAC,WAAU;AACnB,YAAYC,gBAAe;AAC3B,SAA8C,kBAAkB;AAOpD,gBAAAC,YAAA;AAHL,IAAM,kBAA4C,CAAC,UAAgC;AACtF,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,QAAM,SAAS,WAAW,kBAAkB;AAC5C,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,IAAG,aAAa,EAAE,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA,EACrD;AACJ;",
6
- "names": ["cn", "Fragment", "jsx", "jsxs", "Check", "Minus", "Fragment", "jsx", "jsxs", "cva", "cn", "jsx", "cn", "Fragment", "jsx", "jsxs", "cn", "jsx", "jsxs", "cn", "jsx", "jsxs", "cva", "cn", "Primitive", "useState", "jsx", "cva", "cn", "Primitive", "jsx"]
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Use Choice\n */\n\nimport { focusInvalidControl, useFormReset } from \"@gridui/form\";\nimport { type ChangeDetails, changeDetails } from \"@gridui/interaction\";\nimport { type ComponentPropsWithRef, type Ref, type SyntheticEvent, useImperativeHandle, useRef, useState } from \"react\";\n\nexport type ChoiceProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onChange\" | \"defaultChecked\"> & {\n readonly checked?: boolean | undefined;\n readonly defaultChecked?: boolean | undefined;\n readonly readOnly?: boolean | undefined;\n readonly required?: boolean | undefined;\n readonly uncheckedValue?: string | undefined;\n readonly inputRef?: Ref<HTMLInputElement> | undefined;\n readonly onCheckedChange?: ((checked: boolean, details: ChangeDetails) => void) | undefined;\n};\n\nexport const useChoice = (props: ChoiceProps) => {\n const { checked, defaultChecked = false, onCheckedChange, readOnly, disabled, inputRef, form } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultChecked);\n const input = useRef<HTMLInputElement>(null);\n const control = useRef<HTMLButtonElement>(null);\n const initial = useRef(defaultChecked);\n useImperativeHandle(props.ref, () => {\n return control.current as HTMLButtonElement;\n });\n useImperativeHandle(inputRef, () => {\n return input.current as HTMLInputElement;\n });\n useFormReset(input, () => {\n if (checked === undefined) {\n setLocal(initial.current);\n }\n }, form);\n const current = checked ?? local;\n const invalid = (event: SyntheticEvent<HTMLInputElement>) => {\n focusInvalidControl(event, () => {\n control.current?.focus();\n });\n };\n const change = (next: boolean, event: Event) => {\n if (readOnly || disabled || input.current?.matches(\":disabled\")) {\n return;\n }\n const details = changeDetails(event);\n onCheckedChange?.(next, details);\n if (!details.isCanceled && checked === undefined) {\n setLocal(next);\n }\n };\n return {\n current,\n input,\n control,\n change,\n invalid,\n };\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Checkbox\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const choiceStyles = cva(\"gridui-u-choice--inline-flex gridui-u-choice--size-5 gridui-u-choice--shrink-0 gridui-u-choice--cursor-pointer gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--rounded-control gridui-u-choice--border gridui-u-choice--border-control-border gridui-u-choice--bg-background gridui-u-choice--text-foreground gridui-u-choice--align-middle gridui-u-choice--data-[state=checked]:bg-accent-background gridui-u-choice--data-[state=checked]:text-accent-foreground gridui-u-choice--data-[state=indeterminate]:bg-accent-background gridui-u-choice--data-[state=indeterminate]:text-accent-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--data-readonly:cursor-default gridui-u-choice--aria-invalid:border-status-danger-border\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Checkbox\n * @description Checkbox\n */\n\nimport { type ChoiceProps, useChoice } from \"../shared/use-choice\";\nimport { choiceStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-checkbox\";\nimport { Check, Minus } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type CheckboxProps = ChoiceProps & {\n readonly indeterminate?: boolean | undefined;\n};\n\nexport const Checkbox: FC<CheckboxProps> = (props: CheckboxProps) => {\n const { className, indeterminate, inputRef, onCheckedChange, checked, defaultChecked,\n readOnly, uncheckedValue, name, value = \"on\", form, required, onClick, ...restProps } = props;\n const { current, input, control, change, invalid } = useChoice({\n ...props,\n inputRef,\n onCheckedChange,\n checked,\n defaultChecked,\n });\n return (<>\n <Primitive.Root\n {...restProps}\n ref={control}\n checked={indeterminate ? \"indeterminate\" : current}\n aria-required={required}\n aria-readonly={readOnly}\n data-readonly={readOnly ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n change(indeterminate ? true : !current, event.nativeEvent);\n }\n event.preventDefault();\n }}\n className={cn(choiceStyles(), className)}\n >\n <Primitive.Indicator>\n {indeterminate ? (<Minus\n size={16}\n aria-hidden=\"true\"\n />) : (<Check\n size={16}\n aria-hidden=\"true\"\n />)}\n </Primitive.Indicator>\n </Primitive.Root>\n <input\n ref={input}\n type=\"checkbox\"\n className=\"gridui-u-choice--sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n name={name}\n value={value}\n form={form}\n required={required}\n disabled={props.disabled}\n checked={current}\n readOnly={readOnly}\n onInvalid={invalid}\n onChange={(event) => {\n change(event.target.checked, event.nativeEvent);\n }}\n />\n {!current && uncheckedValue !== undefined && (<input\n type=\"hidden\"\n name={name}\n form={form}\n value={uncheckedValue}\n disabled={props.disabled}\n />)}\n </>);\n};\n", "import { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Control\n */\n\nimport { type ChoiceProps, useChoice } from \"./use-choice\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC, ReactNode } from \"react\";\n\nexport type SwitchControlProps = ChoiceProps & {\n readonly children: (checked: boolean) => ReactNode;\n};\n\nexport const SwitchControl: FC<SwitchControlProps> = (props: SwitchControlProps) => {\n const motionStyle = useMotionStyle();\n const { children, className, inputRef, onCheckedChange, checked, defaultChecked,\n readOnly, uncheckedValue, name, value = \"on\", form, required, onClick, type = \"button\", ...restProps } = props;\n const { current, input, control, change, invalid } = useChoice({\n ...props,\n inputRef,\n onCheckedChange,\n checked,\n defaultChecked,\n });\n return (<>\n <button\n {...restProps}\n ref={control}\n type={type}\n role=\"switch\"\n aria-checked={current}\n data-state={current ? \"checked\" : \"unchecked\"}\n data-disabled={props.disabled ? \"\" : undefined}\n aria-required={required}\n aria-readonly={readOnly}\n data-readonly={readOnly ? \"\" : undefined}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n change(!current, event.nativeEvent);\n }\n event.preventDefault();\n }}\n className={cn(\"gridui-switch-control\", className)}\n style={{ ...(props.style), ...motionStyle }}\n >\n {children(current)}\n </button>\n <input\n ref={input}\n type=\"checkbox\"\n className=\"gridui-u-choice--sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n name={name}\n value={value}\n form={form}\n required={required}\n disabled={props.disabled}\n checked={current}\n readOnly={readOnly}\n onInvalid={invalid}\n onChange={(event) => {\n change(event.target.checked, event.nativeEvent);\n }}\n />\n {!current && uncheckedValue !== undefined && (<input\n type=\"hidden\"\n name={name}\n form={form}\n value={uncheckedValue}\n disabled={props.disabled}\n />)}\n </>);\n};\n", "import { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Indicator\n */\n\nimport type { SwitchPresentationProps } from \"./switch-options\";\nimport { Check, Minus } from \"lucide-react\";\nimport type { FC } from \"react\";\n\nexport type SwitchIndicatorProps = SwitchPresentationProps & {\n readonly checked: boolean;\n};\n\nexport const SwitchIndicator: FC<SwitchIndicatorProps> = (props: SwitchIndicatorProps) => {\n const motionStyle = useMotionStyle();\n const { checked, variant = \"rail\", stateLabels = {\n checked: \"On\",\n unchecked: \"Off\",\n } } = props;\n return (<span\n className=\"gridui-switch-indicator gridui-u-choice--type-caption\"\n data-variant={variant}\n data-state={checked ? \"checked\" : \"unchecked\"}\n aria-hidden=\"true\"\n style={motionStyle}\n >\n {variant === \"rail\" ? (<span\n className=\"gridui-switch-thumb\"\n />) : (<>\n {checked ? (<Check\n className=\"gridui-switch-state-icon\"\n />) : (<Minus\n className=\"gridui-switch-state-icon\"\n />)}\n <span\n className=\"gridui-switch-state-label\"\n >\n {checked ? stateLabels.checked : stateLabels.unchecked}\n </span>\n </>)}\n </span>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Switch\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const switchStyles = cva(\"gridui-switch gridui-u-choice--inline-flex gridui-u-choice--w-fit gridui-u-choice--max-w-full gridui-u-choice--min-h-gridui-control gridui-u-choice--min-w-gridui-control gridui-u-choice--shrink-0 gridui-u-choice--items-center gridui-u-choice--justify-center gridui-u-choice--border-0 gridui-u-choice--bg-transparent gridui-u-choice--p-0 gridui-u-choice--align-middle gridui-u-choice--rounded-control\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Switch\n * @description Switch\n */\n\nimport { SwitchControl } from \"../shared/switch-control\";\nimport { SwitchIndicator } from \"../shared/switch-indicator\";\nimport type { SwitchOptions } from \"../shared/switch-options\";\nimport { switchStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type SwitchProps = SwitchOptions;\n\nexport const Switch: FC<SwitchProps> = (props: SwitchProps) => {\n const { variant, stateLabels, className, ...restProps } = props;\n return (<SwitchControl\n {...restProps}\n className={cn(switchStyles(), className)}\n >\n {(checked) => {\n return (<SwitchIndicator\n checked={checked}\n variant={variant}\n stateLabels={stateLabels}\n />);\n }}\n </SwitchControl>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Switch Setting\n */\n\nimport { SwitchControl } from \"./switch-control\";\nimport { SwitchIndicator } from \"./switch-indicator\";\nimport type { SwitchSettingOptions } from \"./switch-options\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type FC, useId } from \"react\";\n\nexport type SwitchSettingProps = SwitchSettingOptions;\n\nexport const SwitchSetting: FC<SwitchSettingProps> = (props: SwitchSettingProps) => {\n const { control, label, description } = props;\n const { variant, stateLabels, className, ...controlProps } = control;\n const id = useId();\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n const hasDescription = description !== undefined && description !== null;\n const describedBy = [\n controlProps[\"aria-describedby\"],\n hasDescription ? descriptionId : undefined,\n ].filter(Boolean).join(\" \") || undefined;\n return (<SwitchControl\n {...controlProps}\n className={cn(\"gridui-switch-setting\", className)}\n aria-labelledby={controlProps[\"aria-labelledby\"] ?? (controlProps[\"aria-label\"] ? undefined : labelId)}\n aria-describedby={describedBy}\n >\n {(checked) => {\n return (<>\n <span\n className=\"gridui-switch-setting-copy\"\n >\n <span\n id={labelId}\n className=\"gridui-u-choice--type-ui\"\n >\n {label}\n </span>\n {hasDescription && (<span\n id={descriptionId}\n className=\"gridui-switch-setting-description gridui-u-choice--type-supporting\"\n >\n {description}\n </span>)}\n </span>\n <span\n className=\"gridui-switch-setting-end\"\n >\n <SwitchIndicator\n checked={checked}\n variant={variant}\n stateLabels={stateLabels}\n />\n </span>\n </>);\n }}\n </SwitchControl>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace SwitchGroup\n * @description Switch Group\n */\n\nimport type { SwitchOptions, SwitchPresentationProps, SwitchSettingCopy } from \"../shared/switch-options\";\nimport { SwitchSetting } from \"../shared/switch-setting\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type SwitchGroupItem = SwitchOptions & SwitchSettingCopy & {\n /** Stable item identity and native control ID. */\n readonly id: string;\n};\n\nexport type SwitchGroupProps = Omit<ComponentPropsWithRef<\"fieldset\">, \"children\"> & SwitchPresentationProps & {\n readonly items: readonly SwitchGroupItem[];\n readonly legend?: ReactNode;\n readonly density?: \"compact\" | \"comfortable\";\n};\n\nexport const SwitchGroup: FC<SwitchGroupProps> = (props: SwitchGroupProps) => {\n const { items, legend, density = \"compact\", variant, stateLabels, className, ...restProps } = props;\n return (<fieldset\n {...restProps}\n className={cn(\"gridui-switch-group\", className)}\n data-density={density}\n >\n {legend !== undefined && legend !== null && (<legend\n className=\"gridui-switch-group-legend gridui-u-choice--type-ui\"\n >\n {legend}\n </legend>)}\n {items.map((item) => {\n const { label, description, ...control } = item;\n return (<SwitchSetting\n key={item.id}\n label={label}\n description={description}\n control={{\n ...control,\n variant: item.variant ?? variant,\n stateLabels: item.stateLabels ?? stateLabels,\n }}\n />);\n })}\n </fieldset>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace SwitchPanel\n * @description Switch Panel\n */\n\nimport type { SwitchSettingOptions } from \"../shared/switch-options\";\nimport { SwitchSetting } from \"../shared/switch-setting\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Children, type ComponentPropsWithRef, type FC } from \"react\";\n\nexport type SwitchPanelProps = ComponentPropsWithRef<\"div\"> & SwitchSettingOptions;\n\nexport const SwitchPanel: FC<SwitchPanelProps> = (props: SwitchPanelProps) => {\n const { label, description, control, children, className, ...restProps } = props;\n const hasContent = Children.toArray(children).some((child) => {\n return child !== \"\";\n });\n return (<div\n {...restProps}\n className={cn(\"gridui-switch-panel\", className)}\n >\n <SwitchSetting\n label={label}\n description={description}\n control={control}\n />\n {hasContent && (<div\n className=\"gridui-switch-panel-content\"\n >\n {children}\n </div>)}\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace Shared\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport const ToggleGroupContext = createContext<\"standard\" | \"cells\">(\"standard\");\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroup\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const toggleGroupStyles = cva(\"gridui-toggle-group gridui-u-choice--inline-flex gridui-u-choice--max-w-full gridui-u-choice--flex-wrap gridui-u-choice--gap-px gridui-u-choice--border gridui-u-choice--border-border gridui-u-choice--bg-border gridui-u-choice--data-[orientation=vertical]:flex-col\", {\n variants: {\n layout: {\n standard: \"\",\n cells: \"gridui-u-choice--grid gridui-u-choice--w-full gridui-u-choice--grid-flow-col gridui-u-choice--auto-cols-fr gridui-u-choice--data-[orientation=vertical]:grid-flow-row gridui-u-choice--data-[orientation=vertical]:auto-rows-fr gridui-u-choice--data-[orientation=vertical]:grid-cols-1\",\n },\n },\n defaultVariants: { layout: \"standard\" },\n});\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroup\n * @description Toggle Group\n */\n\nimport { ToggleGroupContext } from \"../shared/context\";\nimport { toggleGroupStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-toggle-group\";\nimport { type ComponentPropsWithRef, type FC, useState } from \"react\";\n\nexport type ToggleGroupProps = Omit<ComponentPropsWithRef<typeof Primitive.Root>, \"type\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"loop\"> & {\n readonly multiple?: boolean | undefined;\n readonly value?: string[] | undefined;\n readonly defaultValue?: string[] | undefined;\n readonly onValueChange?: ((value: string[]) => void) | undefined;\n readonly loopFocus?: boolean | undefined;\n readonly layout?: \"standard\" | \"cells\" | undefined;\n};\n\nexport const ToggleGroup: FC<ToggleGroupProps> = (props: ToggleGroupProps) => {\n const { className, multiple, value, defaultValue, onValueChange, loopFocus = true, layout = \"standard\", ...restProps } = props;\n const [\n local,\n setLocal,\n ] = useState(defaultValue ?? []);\n const current = value ?? local;\n return (<ToggleGroupContext.Provider\n value={layout}\n >\n <Primitive.Root\n {...restProps}\n loop={loopFocus}\n className={cn(toggleGroupStyles({ layout }), className)}\n data-layout={layout}\n type=\"multiple\"\n value={multiple ? current : current.slice(-1)}\n onValueChange={(next) => {\n const selected = multiple ? next : next.slice(-1);\n if (value === undefined) {\n setLocal(selected);\n }\n onValueChange?.(selected);\n }}\n />\n </ToggleGroupContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroupItem\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const toggleStyles = cva(\"gridui-u-choice--min-h-gridui-control gridui-u-choice--cursor-pointer gridui-u-choice--border-0 gridui-u-choice--bg-background gridui-u-choice--px-gridui-16 gridui-u-choice--py-gridui-8 gridui-u-choice--text-foreground gridui-u-choice--type-ui gridui-u-choice--data-[state=on]:bg-selection-background gridui-u-choice--data-[state=on]:text-foreground gridui-u-choice--data-disabled:cursor-not-allowed gridui-u-choice--data-disabled:opacity-50 gridui-u-choice--forced-colors:data-[state=on]:forced-color-adjust-none gridui-u-choice--forced-colors:data-[state=on]:bg-[Highlight] gridui-u-choice--forced-colors:data-[state=on]:text-[HighlightText] gridui-u-choice--forced-colors:outline-[CanvasText]\", {\n variants: {\n layout: {\n standard: \"gridui-u-choice--grow gridui-u-choice--basis-auto gridui-u-choice--min-w-0 gridui-u-choice--max-w-full gridui-u-choice--whitespace-normal gridui-u-choice--wrap-anywhere\",\n cells: \"gridui-u-choice--w-full gridui-u-choice--min-w-0 gridui-u-choice--whitespace-normal gridui-u-choice--wrap-anywhere gridui-u-choice--border-x-0 gridui-u-choice--border-t-0 gridui-u-choice--border-solid gridui-u-choice--border-transparent gridui-u-choice--px-gridui-8 gridui-u-choice--py-gridui-16 gridui-u-choice--text-center gridui-u-choice--data-[orientation=horizontal]:border-b-2 gridui-u-choice--data-[orientation=vertical]:border-b-0 gridui-u-choice--data-[orientation=vertical]:border-r-2 gridui-u-choice--rtl:data-[orientation=vertical]:border-r-0 gridui-u-choice--rtl:data-[orientation=vertical]:border-l-2 gridui-u-choice--data-[state=on]:font-medium\",\n },\n },\n defaultVariants: {\n layout: \"standard\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Choice\n * @namespace ToggleGroupItem\n * @description Toggle Group Item\n */\n\nimport { ToggleGroupContext } from \"../shared/context\";\nimport { toggleStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-toggle-group\";\nimport { type ComponentPropsWithRef, type FC, useContext } from \"react\";\n\nexport type ToggleGroupItemProps = ComponentPropsWithRef<typeof Primitive.Item>;\n\nexport const ToggleGroupItem: FC<ToggleGroupItemProps> = (props: ToggleGroupItemProps) => {\n const { className, ...restProps } = props;\n const layout = useContext(ToggleGroupContext);\n return (<Primitive.Item\n {...restProps}\n className={cn(toggleStyles({ layout }), className)}\n />);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,qBAAqB,oBAAoB;AAClD,SAA6B,qBAAqB;AAClD,SAAoE,qBAAqB,QAAQ,gBAAgB;AAY1G,IAAM,YAAY,CAAC,UAAuB;AAC7C,QAAM,EAAE,SAAS,iBAAiB,OAAO,iBAAiB,UAAU,UAAU,UAAU,KAAK,IAAI;AACjG,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,cAAc;AAC3B,QAAM,QAAQ,OAAyB,IAAI;AAC3C,QAAM,U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AAnB;AAAA,MACL,OAAO;AAAA,MAEP,0BAAAA;AAAA,QAAW;AAAA,QAAV;AAAA,UACI,GAAG;AAAA,UACJ,MAAM;AAAA,UACN,WAAWH,IAAG,kBAAkB,EAAE,OAAO,CAAC,GAAG,SAAS;AAAA,UACtD,eAAa;AAAA,UACb,MAAK;AAAA,UACL,OAAO,WAAW,UAAU,QAAQ,MAAM,EAAE;AAAA,UAC5C,eAAe,CAAC,SAAS;AACrB,kBAAM,WAAW,WAAW,OAAO,KAAK,MAAM,EAAE;AAChD,gBAAI,UAAU,QAAW;AACrB,uBAAS,QAAQ;AAAA,YACrB;AACA,4BAAgB,QAAQ;AAAA,UAC5B;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;;;ACzCA,SAAS,OAAAI,YAAW;AAEb,IAAM,eAAeA,KAAI,2rBAA2rB;AAAA,EACvtB,UAAU;AAAA,IACN,QAAQ;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,IACX;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,QAAQ;AAAA,EACZ;AACJ,CAAC;;;ACVD,SAAS,MAAAC,WAAU;AACnB,YAAYC,gBAAe;AAC3B,SAA8C,kBAAkB;AAOpD,gBAAAC,YAAA;AAHL,IAAM,kBAA4C,CAAC,UAAgC;AACtF,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,QAAM,SAAS,WAAW,kBAAkB;AAC5C,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ,WAAWF,IAAG,aAAa,EAAE,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA,EACrD;AACJ;",
6
+ "names": ["cn", "Fragment", "jsx", "jsxs", "useMotionStyle", "Check", "Minus", "Fragment", "jsx", "jsxs", "cva", "cn", "jsx", "cn", "Fragment", "jsx", "jsxs", "cn", "jsx", "jsxs", "cn", "jsx", "jsxs", "cva", "cn", "Primitive", "useState", "jsx", "cva", "cn", "Primitive", "jsx"]
7
7
  }
package/dist/styles.css CHANGED
@@ -141,14 +141,17 @@
141
141
  }
142
142
  .gridui-u-choice--type-caption {
143
143
  font: var(--gridui-type-caption);
144
+ font-family: var(--gridui-font-body);
144
145
  letter-spacing: normal;
145
146
  }
146
147
  .gridui-u-choice--type-supporting {
147
148
  font: var(--gridui-type-supporting);
149
+ font-family: var(--gridui-font-body);
148
150
  letter-spacing: normal;
149
151
  }
150
152
  .gridui-u-choice--type-ui {
151
153
  font: var(--gridui-type-ui);
154
+ font-family: var(--gridui-font-body);
152
155
  letter-spacing: normal;
153
156
  }
154
157
  .gridui-u-choice--wrap-anywhere {
@@ -160,8 +163,8 @@
160
163
  .gridui-u-choice--text-foreground {
161
164
  color: var(--gridui-foreground);
162
165
  }
163
- .gridui-u-choice--aria-invalid\:border-danger-foreground[aria-invalid="true"] {
164
- border-color: var(--gridui-danger-foreground);
166
+ .gridui-u-choice--aria-invalid\:border-status-danger-border[aria-invalid="true"] {
167
+ border-color: var(--gridui-status-danger-border);
165
168
  }
166
169
  .gridui-u-choice--data-disabled\:cursor-not-allowed[data-disabled] {
167
170
  cursor: not-allowed;
@@ -208,8 +211,8 @@
208
211
  .gridui-u-choice--data-\[state\=indeterminate\]\:text-accent-foreground[data-state="indeterminate"] {
209
212
  color: var(--gridui-accent-foreground);
210
213
  }
211
- .gridui-u-choice--data-\[state\=on\]\:bg-brand-tint[data-state="on"] {
212
- background-color: var(--gridui-brand-tint);
214
+ .gridui-u-choice--data-\[state\=on\]\:bg-selection-background[data-state="on"] {
215
+ background-color: var(--gridui-selection-background);
213
216
  }
214
217
  .gridui-u-choice--data-\[state\=on\]\:font-medium[data-state="on"] {
215
218
  --tw-font-weight: var(--font-weight-medium);
@@ -269,11 +272,11 @@
269
272
  background: var(--gridui-background);
270
273
  color: var(--gridui-foreground);
271
274
  pointer-events: none;
272
- transition: background-color var(--gridui-motion-duration-quick), border-color var(--gridui-motion-duration-quick);
275
+ transition: var(--gridui-motion-transition, background-color calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)), border-color calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)));
273
276
  }
274
277
  .gridui-switch-indicator[data-state="checked"] {
275
278
  border-color: var(--gridui-accent-background);
276
- background: var(--gridui-brand-tint);
279
+ background: var(--gridui-selection-background);
277
280
  }
278
281
  .gridui-switch-thumb {
279
282
  flex-shrink: 0;
@@ -282,7 +285,7 @@
282
285
  margin-inline-start: 0;
283
286
  border-radius: var(--gridui-control-radius);
284
287
  background: var(--gridui-muted);
285
- transition: margin-inline-start var(--gridui-motion-duration-quick) var(--gridui-motion-ease-out);
288
+ transition: var(--gridui-motion-transition, margin-inline-start calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out));
286
289
  }
287
290
  .gridui-switch-indicator[data-state="checked"] .gridui-switch-thumb {
288
291
  margin-inline-start: max(0px, calc(100% - var(--_gridui-switch-thumb-size)));
@@ -313,7 +316,7 @@
313
316
  overflow-wrap: anywhere;
314
317
  }
315
318
  .gridui-switch-control[aria-invalid="true"] .gridui-switch-indicator {
316
- border-color: var(--gridui-danger-foreground);
319
+ border-color: var(--gridui-status-danger-border);
317
320
  }
318
321
  .gridui-switch-setting {
319
322
  display: flex;
@@ -427,7 +430,7 @@
427
430
  border: 0;
428
431
  }
429
432
  .gridui-switch-panel > .gridui-switch-setting[aria-invalid="true"] {
430
- box-shadow: inset 0 0 0 1px var(--gridui-danger-foreground);
433
+ box-shadow: inset 0 0 0 1px var(--gridui-status-danger-border);
431
434
  }
432
435
  .gridui-switch-panel-content {
433
436
  box-sizing: border-box;
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/choice",
4
- "version": "1.2.6",
4
+ "version": "1.3.0",
5
5
  "category": "core",
6
6
  "description": "GridUI React choice",
7
7
  "usage": "Core family. Public components: `Checkbox`, `Switch`, `SwitchGroup`, `SwitchPanel`, `ToggleGroup`, and `ToggleGroupItem`. Each exports its named Props contract. Switch presentation types and `SwitchGroupItem` describe their supported configuration.",
@@ -102,14 +102,13 @@
102
102
  "examples": [
103
103
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/boolean-settings.mdx",
104
104
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/checkboxes.mdx",
105
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/getting-started.mdx",
105
106
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/settings-panels.mdx",
106
107
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/toggle-selections.mdx",
107
108
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/checkbox.stories.tsx",
108
- "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/choices.stories.tsx",
109
109
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/switch-control.stories.tsx",
110
110
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/switch-group.stories.tsx",
111
111
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/switch-panel.stories.tsx",
112
- "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/switch.stories.tsx",
113
112
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/choice/stories/toggle-group.stories.tsx"
114
113
  ]
115
114
  }
@@ -69,16 +69,16 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
69
69
 
70
70
  Whether the group is disabled from user interaction.
71
71
 
72
+ ### orientation
73
+
74
+ ``("vertical" | "horizontal") | undefined`` · Optional
75
+
72
76
  ### rovingFocus
73
77
 
74
78
  ``boolean | undefined`` · Optional
75
79
 
76
80
  Whether the group should maintain roving focus of its buttons.
77
81
 
78
- ### orientation
79
-
80
- ``("vertical" | "horizontal") | undefined`` · Optional
81
-
82
82
  ### multiple
83
83
 
84
84
  ``boolean | undefined`` · Optional
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/choice",
3
- "version": "1.2.6",
3
+ "version": "1.3.0",
4
4
  "description": "GridUI React choice",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,20 +27,21 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/form": "^4.1.1",
31
- "@gridui/interaction": "^1.2.1",
30
+ "@gridui/form": "^4.1.2",
31
+ "@gridui/interaction": "^1.3.0",
32
+ "@gridui/motion": "^1.0.1",
32
33
  "@gridui/style-utils": "^4.0.0",
33
- "@gridui/theme": "^2.5.3",
34
+ "@gridui/theme": "^3.0.0",
34
35
  "@radix-ui/react-checkbox": "1.4.1",
35
36
  "@radix-ui/react-toggle-group": "1.2.1",
36
37
  "class-variance-authority": "0.7.1",
37
- "lucide-react": "1.70.0"
38
+ "lucide-react": "1.72.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@gridui-internal/configuration": "0.0.0-internal",
41
- "@gridui/button": "4.1.0",
42
+ "@gridui/button": "5.1.0",
42
43
  "@jest/globals": "30.5.2",
43
- "@storybook/react-vite": "10.6.6",
44
+ "@storybook/react-vite": "10.6.7",
44
45
  "@types/jest": "30.0.0",
45
46
  "@types/node": "26.6.6",
46
47
  "@types/react": "19.3.0",
@@ -53,7 +54,6 @@
53
54
  "scripts": {
54
55
  "build": "node ../../scripts/compilation/package.ts",
55
56
  "compile": "tsc --project tsconfig.json",
56
- "test": "jest",
57
- "coverage": "jest --coverage"
57
+ "test": "jest"
58
58
  }
59
59
  }