@oztix/roadie-components 2.0.2 → 2.1.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.
- package/dist/Accordion.d.ts +6 -8
- package/dist/Accordion.d.ts.map +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/Accordion.js.map +1 -1
- package/dist/Autocomplete.d.ts +24 -23
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete.js +1 -1
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.d.ts +1 -1
- package/dist/Breadcrumb.d.ts +12 -14
- package/dist/Breadcrumb.d.ts.map +1 -1
- package/dist/Breadcrumb.js +1 -1
- package/dist/Breadcrumb.js.map +1 -1
- package/dist/Button.d.ts +2 -3
- package/dist/Button.js +1 -1
- package/dist/Card.d.ts +9 -11
- package/dist/Card.d.ts.map +1 -1
- package/dist/Card.js +1 -1
- package/dist/Card.js.map +1 -1
- package/dist/Carousel.d.ts +257 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/Carousel.js +2 -0
- package/dist/Carousel.js.map +1 -0
- package/dist/Code.d.ts +1 -1
- package/dist/Combobox.d.ts +25 -24
- package/dist/Combobox.d.ts.map +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/Combobox.js.map +1 -1
- package/dist/Field.d.ts +14 -17
- package/dist/Field.d.ts.map +1 -1
- package/dist/Field.js +1 -1
- package/dist/Field.js.map +1 -1
- package/dist/Fieldset.d.ts +11 -14
- package/dist/Fieldset.d.ts.map +1 -1
- package/dist/Fieldset.js +1 -1
- package/dist/Fieldset.js.map +1 -1
- package/dist/{Button-DdE0vCfo.js → IconButton-0UdUDm0O.js} +1 -1
- package/dist/IconButton-0UdUDm0O.js.map +1 -0
- package/dist/{Button-Dt1TGgrL.d.ts → IconButton-BajbaUJ_.d.ts} +15 -3
- package/dist/IconButton-BajbaUJ_.d.ts.map +1 -0
- package/dist/LinkButton-9nnOzX_0.js.map +1 -1
- package/dist/LinkButton.d.ts +1 -1
- package/dist/RadioGroup.d.ts +14 -17
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.d.ts +30 -29
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1 -1
- package/dist/Select.js.map +1 -1
- package/dist/Separator.d.ts +1 -1
- package/dist/Steps.d.ts +24 -26
- package/dist/Steps.d.ts.map +1 -1
- package/dist/Steps.js +1 -1
- package/dist/Steps.js.map +1 -1
- package/dist/{index-0w-ydb3o.d.ts → index-4M9XZOF1.d.ts} +25 -7
- package/dist/index-4M9XZOF1.d.ts.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +23 -3
- package/dist/Button-DdE0vCfo.js.map +0 -1
- package/dist/Button-Dt1TGgrL.d.ts.map +0 -1
- package/dist/index-0w-ydb3o.d.ts.map +0 -1
- package/dist/index-C3_4djmE.d.ts +0 -17
- package/dist/index-C3_4djmE.d.ts.map +0 -1
package/dist/Combobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","names":["ComboboxPrimitive"],"sources":["../src/components/Combobox/index.tsx"],"sourcesContent":["'use client'\n\nimport type { RefAttributes } from 'react'\n\nimport {\n type ComboboxFilter,\n type ComboboxFilterOptions,\n Combobox as ComboboxPrimitive\n} from '@base-ui/react/combobox'\nimport { CaretDownIcon, CheckIcon, XIcon } from '@phosphor-icons/react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\nimport { useFieldContext } from '../Field'\n\nexport const useFilter = ComboboxPrimitive.useFilter\nexport type { ComboboxFilter as Filter, ComboboxFilterOptions as FilterOptions }\n\n/* ─── Input group variants (matches Input/Select trigger) ─── */\n\nexport const comboboxInputGroupVariants = cva(\n 'inline-flex w-full items-center rounded-lg font-sans',\n {\n variants: {\n intent: intentVariants,\n emphasis: {\n normal:\n 'emphasis-sunken border border-subtle is-interactive-field-group',\n subtle:\n 'bg-subtle text-normal border border-transparent is-interactive-field-group'\n },\n size: {\n sm: 'h-8 px-1.5 text-base',\n md: 'h-10 px-2 text-base',\n lg: 'h-12 px-2 text-base'\n }\n },\n defaultVariants: {\n emphasis: 'normal',\n size: 'md'\n }\n }\n)\n\n/* ─── Root ─── */\n\nexport type ComboboxRootProps = ComboboxPrimitive.Root.Props<unknown>\n\nexport function ComboboxRoot(props: ComboboxRootProps) {\n return <ComboboxPrimitive.Root {...props} />\n}\n\nComboboxRoot.displayName = 'Combobox'\n\n/* ─── Label ─── */\n\nexport type ComboboxLabelProps = ComboboxPrimitive.Label.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.Label\n className={cn('text-sm font-medium text-normal', className)}\n {...props}\n />\n )\n}\n\nComboboxLabel.displayName = 'Combobox.Label'\n\n/* ─── InputGroup ─── */\n\nexport type ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props &\n RefAttributes<HTMLDivElement> &\n VariantProps<typeof comboboxInputGroupVariants>\n\nexport function ComboboxInputGroup({\n className,\n intent,\n emphasis,\n size,\n ...props\n}: ComboboxInputGroupProps) {\n const fieldContext = useFieldContext()\n const inField = !!fieldContext.fieldId\n\n return (\n <ComboboxPrimitive.InputGroup\n className={cn(\n comboboxInputGroupVariants({ intent, emphasis, size, className })\n )}\n aria-invalid={(inField && fieldContext.invalid) || undefined}\n {...props}\n />\n )\n}\n\nComboboxInputGroup.displayName = 'Combobox.InputGroup'\n\n/* ─── Input ─── */\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props &\n RefAttributes<HTMLInputElement>\n\nexport function ComboboxInput({ className, ...props }: ComboboxInputProps) {\n const fieldContext = useFieldContext()\n const inField = !!fieldContext.fieldId\n\n return (\n <ComboboxPrimitive.Input\n className={cn(\n 'min-w-0 flex-1 bg-transparent outline-none placeholder:text-subtle',\n className\n )}\n {...(inField && {\n id: fieldContext.fieldId,\n 'aria-invalid': fieldContext.invalid || undefined,\n 'aria-required': fieldContext.required || undefined,\n 'aria-describedby': fieldContext.invalid\n ? fieldContext.errorTextId || undefined\n : fieldContext.helperTextId || undefined\n })}\n {...props}\n />\n )\n}\n\nComboboxInput.displayName = 'Combobox.Input'\n\n/* ─── Trigger ─── */\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props &\n RefAttributes<HTMLButtonElement>\n\nexport function ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n className={cn(\n 'duration-moderate shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180',\n className\n )}\n {...props}\n >\n {children ?? <CaretDownIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nComboboxTrigger.displayName = 'Combobox.Trigger'\n\n/* ─── Clear ─── */\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props &\n RefAttributes<HTMLButtonElement>\n\nexport function ComboboxClear({\n className,\n children,\n ...props\n}: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n className={cn(\n 'shrink-0 cursor-pointer text-subtle hover:text-normal',\n className\n )}\n {...props}\n >\n {children ?? <XIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.Clear>\n )\n}\n\nComboboxClear.displayName = 'Combobox.Clear'\n\n/* ─── Portal ─── */\n\nexport type ComboboxPortalProps = ComboboxPrimitive.Portal.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPortal(props: ComboboxPortalProps) {\n return <ComboboxPrimitive.Portal {...props} />\n}\n\nComboboxPortal.displayName = 'Combobox.Portal'\n\n/* ─── Positioner ─── */\n\nexport type ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPositioner({\n className,\n ...props\n}: ComboboxPositionerProps) {\n return (\n <ComboboxPrimitive.Positioner\n className={cn('z-50', className)}\n sideOffset={4}\n {...props}\n />\n )\n}\n\nComboboxPositioner.displayName = 'Combobox.Positioner'\n\n/* ─── Popup ─── */\n\nexport type ComboboxPopupProps = ComboboxPrimitive.Popup.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPopup({ className, ...props }: ComboboxPopupProps) {\n return (\n <ComboboxPrimitive.Popup\n className={cn(\n 'max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg',\n 'origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxPopup.displayName = 'Combobox.Popup'\n\n/* ─── List ─── */\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxList({ className, ...props }: ComboboxListProps) {\n return <ComboboxPrimitive.List className={className} {...props} />\n}\n\nComboboxList.displayName = 'Combobox.List'\n\n/* ─── Item ─── */\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxItem({ className, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n className={cn(\n 'flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none',\n 'data-[highlighted]:bg-subtle',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxItem.displayName = 'Combobox.Item'\n\n/* ─── Collection ─── */\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport function ComboboxCollection(props: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection {...props} />\n}\n\nComboboxCollection.displayName = 'Combobox.Collection'\n\n/* ─── ItemIndicator ─── */\n\nexport type ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function ComboboxItemIndicator({\n className,\n children,\n ...props\n}: ComboboxItemIndicatorProps) {\n return (\n <ComboboxPrimitive.ItemIndicator\n className={cn('shrink-0 text-subtle', className)}\n {...props}\n >\n {children ?? <CheckIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.ItemIndicator>\n )\n}\n\nComboboxItemIndicator.displayName = 'Combobox.ItemIndicator'\n\n/* ─── Group ─── */\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return (\n <ComboboxPrimitive.Group\n className={cn('[&+&]:mt-1', className)}\n {...props}\n />\n )\n}\n\nComboboxGroup.displayName = 'Combobox.Group'\n\n/* ─── GroupLabel ─── */\n\nexport type ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxGroupLabel({\n className,\n ...props\n}: ComboboxGroupLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n className={cn(\n 'px-2 py-1.5 text-xs font-medium text-subtle select-none',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxGroupLabel.displayName = 'Combobox.GroupLabel'\n\n/* ─── Empty ─── */\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n className={cn(\n 'text-center text-sm text-subtle empty:hidden [&:not(:empty)]:px-3 [&:not(:empty)]:py-4',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxEmpty.displayName = 'Combobox.Empty'\n\n/* ─── Status ─── */\n\nexport type ComboboxStatusProps = ComboboxPrimitive.Status.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxStatus({ className, ...props }: ComboboxStatusProps) {\n return (\n <ComboboxPrimitive.Status className={cn('sr-only', className)} {...props} />\n )\n}\n\nComboboxStatus.displayName = 'Combobox.Status'\n\n/* ─── Compound export ─── */\n\nexport const Combobox = Object.assign(ComboboxRoot, {\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Clear: ComboboxClear,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n Collection: ComboboxCollection,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Status: ComboboxStatus\n})\n\nexport type ComboboxProps = ComboboxRootProps\n"],"mappings":"6WAiBA,MAAa,EAAYA,EAAkB,UAK9B,EAA6B,EACxC,uDACA,CACE,SAAU,CACR,OAAQ,EACR,SAAU,CACR,OACE,kEACF,OACE,6EACH,CACD,KAAM,CACJ,GAAI,uBACJ,GAAI,sBACJ,GAAI,sBACL,CACF,CACD,gBAAiB,CACf,SAAU,SACV,KAAM,KACP,CACF,CACF,CAMD,SAAgB,EAAa,EAA0B,CACrD,OAAO,EAACA,EAAkB,KAAnB,CAAwB,GAAI,EAAS,CAAA,CAG9C,EAAa,YAAc,WAO3B,SAAgB,EAAc,CAAE,YAAW,GAAG,GAA6B,CACzE,OACE,EAACA,EAAkB,MAAnB,CACE,UAAW,EAAG,kCAAmC,EAAU,CAC3D,GAAI,EACJ,CAAA,CAIN,EAAc,YAAc,iBAQ5B,SAAgB,EAAmB,CACjC,YACA,SACA,WACA,OACA,GAAG,GACuB,CAC1B,IAAM,EAAe,GAAiB,CAChC,EAAU,CAAC,CAAC,EAAa,QAE/B,OACE,EAACA,EAAkB,WAAnB,CACE,UAAW,EACT,EAA2B,CAAE,SAAQ,WAAU,OAAM,YAAW,CAAC,CAClE,CACD,eAAe,GAAW,EAAa,SAAY,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hF,EAAe,YAAc,kBAI7B,MAAa,EAAW,OAAO,OAAO,EAAc,CAClD,MAAO,EACP,WAAY,EACZ,MAAO,EACP,QAAS,EACT,MAAO,EACP,OAAQ,EACR,WAAY,EACZ,MAAO,EACP,KAAM,EACN,KAAM,EACN,WAAY,EACZ,cAAe,EACf,MAAO,EACP,WAAY,EACZ,MAAO,EACP,OAAQ,EACT,CAAC"}
|
|
1
|
+
{"version":3,"file":"Combobox.js","names":["ComboboxPrimitive"],"sources":["../src/components/Combobox/index.tsx"],"sourcesContent":["'use client'\n\nimport type { RefAttributes } from 'react'\n\nimport {\n type ComboboxFilter,\n type ComboboxFilterOptions,\n Combobox as ComboboxPrimitive\n} from '@base-ui/react/combobox'\nimport { CaretDownIcon, CheckIcon, XIcon } from '@phosphor-icons/react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\nimport { useFieldContext } from '../Field'\n\nexport const useFilter = ComboboxPrimitive.useFilter\nexport type { ComboboxFilter as Filter, ComboboxFilterOptions as FilterOptions }\n\n/* ─── Input group variants (matches Input/Select trigger) ─── */\n\nexport const comboboxInputGroupVariants = cva(\n 'inline-flex w-full items-center rounded-lg font-sans',\n {\n variants: {\n intent: intentVariants,\n emphasis: {\n normal:\n 'emphasis-sunken border border-subtle is-interactive-field-group',\n subtle:\n 'bg-subtle text-normal border border-transparent is-interactive-field-group'\n },\n size: {\n sm: 'h-8 px-1.5 text-base',\n md: 'h-10 px-2 text-base',\n lg: 'h-12 px-2 text-base'\n }\n },\n defaultVariants: {\n emphasis: 'normal',\n size: 'md'\n }\n }\n)\n\n/* ─── Root ─── */\n\nexport type ComboboxProps = ComboboxPrimitive.Root.Props<unknown>\n\n/**\n * @deprecated Use `ComboboxProps` instead.\n */\nexport type ComboboxRootProps = ComboboxProps\n\nexport function Combobox(props: ComboboxProps) {\n return <ComboboxPrimitive.Root {...props} />\n}\n\nCombobox.displayName = 'Combobox'\n\n/* ─── Label ─── */\n\nexport type ComboboxLabelProps = ComboboxPrimitive.Label.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxLabel({ className, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.Label\n className={cn('text-sm font-medium text-normal', className)}\n {...props}\n />\n )\n}\n\nComboboxLabel.displayName = 'Combobox.Label'\n\n/* ─── InputGroup ─── */\n\nexport type ComboboxInputGroupProps = ComboboxPrimitive.InputGroup.Props &\n RefAttributes<HTMLDivElement> &\n VariantProps<typeof comboboxInputGroupVariants>\n\nexport function ComboboxInputGroup({\n className,\n intent,\n emphasis,\n size,\n ...props\n}: ComboboxInputGroupProps) {\n const fieldContext = useFieldContext()\n const inField = !!fieldContext.fieldId\n\n return (\n <ComboboxPrimitive.InputGroup\n className={cn(\n comboboxInputGroupVariants({ intent, emphasis, size, className })\n )}\n aria-invalid={(inField && fieldContext.invalid) || undefined}\n {...props}\n />\n )\n}\n\nComboboxInputGroup.displayName = 'Combobox.InputGroup'\n\n/* ─── Input ─── */\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props &\n RefAttributes<HTMLInputElement>\n\nexport function ComboboxInput({ className, ...props }: ComboboxInputProps) {\n const fieldContext = useFieldContext()\n const inField = !!fieldContext.fieldId\n\n return (\n <ComboboxPrimitive.Input\n className={cn(\n 'min-w-0 flex-1 bg-transparent outline-none placeholder:text-subtle',\n className\n )}\n {...(inField && {\n id: fieldContext.fieldId,\n 'aria-invalid': fieldContext.invalid || undefined,\n 'aria-required': fieldContext.required || undefined,\n 'aria-describedby': fieldContext.invalid\n ? fieldContext.errorTextId || undefined\n : fieldContext.helperTextId || undefined\n })}\n {...props}\n />\n )\n}\n\nComboboxInput.displayName = 'Combobox.Input'\n\n/* ─── Trigger ─── */\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props &\n RefAttributes<HTMLButtonElement>\n\nexport function ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n className={cn(\n 'duration-moderate shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180',\n className\n )}\n {...props}\n >\n {children ?? <CaretDownIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nComboboxTrigger.displayName = 'Combobox.Trigger'\n\n/* ─── Clear ─── */\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props &\n RefAttributes<HTMLButtonElement>\n\nexport function ComboboxClear({\n className,\n children,\n ...props\n}: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n className={cn(\n 'shrink-0 cursor-pointer text-subtle hover:text-normal',\n className\n )}\n {...props}\n >\n {children ?? <XIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.Clear>\n )\n}\n\nComboboxClear.displayName = 'Combobox.Clear'\n\n/* ─── Portal ─── */\n\nexport type ComboboxPortalProps = ComboboxPrimitive.Portal.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPortal(props: ComboboxPortalProps) {\n return <ComboboxPrimitive.Portal {...props} />\n}\n\nComboboxPortal.displayName = 'Combobox.Portal'\n\n/* ─── Positioner ─── */\n\nexport type ComboboxPositionerProps = ComboboxPrimitive.Positioner.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPositioner({\n className,\n ...props\n}: ComboboxPositionerProps) {\n return (\n <ComboboxPrimitive.Positioner\n className={cn('z-50', className)}\n sideOffset={4}\n {...props}\n />\n )\n}\n\nComboboxPositioner.displayName = 'Combobox.Positioner'\n\n/* ─── Popup ─── */\n\nexport type ComboboxPopupProps = ComboboxPrimitive.Popup.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxPopup({ className, ...props }: ComboboxPopupProps) {\n return (\n <ComboboxPrimitive.Popup\n className={cn(\n 'max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg',\n 'origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxPopup.displayName = 'Combobox.Popup'\n\n/* ─── List ─── */\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxList({ className, ...props }: ComboboxListProps) {\n return <ComboboxPrimitive.List className={className} {...props} />\n}\n\nComboboxList.displayName = 'Combobox.List'\n\n/* ─── Item ─── */\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxItem({ className, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n className={cn(\n 'flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none',\n 'data-[highlighted]:bg-subtle',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxItem.displayName = 'Combobox.Item'\n\n/* ─── Collection ─── */\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport function ComboboxCollection(props: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection {...props} />\n}\n\nComboboxCollection.displayName = 'Combobox.Collection'\n\n/* ─── ItemIndicator ─── */\n\nexport type ComboboxItemIndicatorProps = ComboboxPrimitive.ItemIndicator.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function ComboboxItemIndicator({\n className,\n children,\n ...props\n}: ComboboxItemIndicatorProps) {\n return (\n <ComboboxPrimitive.ItemIndicator\n className={cn('shrink-0 text-subtle', className)}\n {...props}\n >\n {children ?? <CheckIcon weight='bold' className='size-4' />}\n </ComboboxPrimitive.ItemIndicator>\n )\n}\n\nComboboxItemIndicator.displayName = 'Combobox.ItemIndicator'\n\n/* ─── Group ─── */\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxGroup({ className, ...props }: ComboboxGroupProps) {\n return (\n <ComboboxPrimitive.Group\n className={cn('[&+&]:mt-1', className)}\n {...props}\n />\n )\n}\n\nComboboxGroup.displayName = 'Combobox.Group'\n\n/* ─── GroupLabel ─── */\n\nexport type ComboboxGroupLabelProps = ComboboxPrimitive.GroupLabel.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxGroupLabel({\n className,\n ...props\n}: ComboboxGroupLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n className={cn(\n 'px-2 py-1.5 text-xs font-medium text-subtle select-none',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxGroupLabel.displayName = 'Combobox.GroupLabel'\n\n/* ─── Empty ─── */\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxEmpty({ className, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n className={cn(\n 'text-center text-sm text-subtle empty:hidden [&:not(:empty)]:px-3 [&:not(:empty)]:py-4',\n className\n )}\n {...props}\n />\n )\n}\n\nComboboxEmpty.displayName = 'Combobox.Empty'\n\n/* ─── Status ─── */\n\nexport type ComboboxStatusProps = ComboboxPrimitive.Status.Props &\n RefAttributes<HTMLDivElement>\n\nexport function ComboboxStatus({ className, ...props }: ComboboxStatusProps) {\n return (\n <ComboboxPrimitive.Status className={cn('sr-only', className)} {...props} />\n )\n}\n\nComboboxStatus.displayName = 'Combobox.Status'\n\n/* ─── Compound export ─── */\n\nCombobox.Label = ComboboxLabel\nCombobox.InputGroup = ComboboxInputGroup\nCombobox.Input = ComboboxInput\nCombobox.Trigger = ComboboxTrigger\nCombobox.Clear = ComboboxClear\nCombobox.Portal = ComboboxPortal\nCombobox.Positioner = ComboboxPositioner\nCombobox.Popup = ComboboxPopup\nCombobox.List = ComboboxList\nCombobox.Item = ComboboxItem\nCombobox.Collection = ComboboxCollection\nCombobox.ItemIndicator = ComboboxItemIndicator\nCombobox.Group = ComboboxGroup\nCombobox.GroupLabel = ComboboxGroupLabel\nCombobox.Empty = ComboboxEmpty\nCombobox.Status = ComboboxStatus\n"],"mappings":"6WAiBA,MAAa,EAAYA,EAAkB,UAK9B,EAA6B,EACxC,uDACA,CACE,SAAU,CACR,OAAQ,EACR,SAAU,CACR,OACE,kEACF,OACE,6EACH,CACD,KAAM,CACJ,GAAI,uBACJ,GAAI,sBACJ,GAAI,sBACL,CACF,CACD,gBAAiB,CACf,SAAU,SACV,KAAM,KACP,CACF,CACF,CAWD,SAAgB,EAAS,EAAsB,CAC7C,OAAO,EAACA,EAAkB,KAAnB,CAAwB,GAAI,EAAS,CAAA,CAG9C,EAAS,YAAc,WAOvB,SAAgB,EAAc,CAAE,YAAW,GAAG,GAA6B,CACzE,OACE,EAACA,EAAkB,MAAnB,CACE,UAAW,EAAG,kCAAmC,EAAU,CAC3D,GAAI,EACJ,CAAA,CAIN,EAAc,YAAc,iBAQ5B,SAAgB,EAAmB,CACjC,YACA,SACA,WACA,OACA,GAAG,GACuB,CAC1B,IAAM,EAAe,GAAiB,CAChC,EAAU,CAAC,CAAC,EAAa,QAE/B,OACE,EAACA,EAAkB,WAAnB,CACE,UAAW,EACT,EAA2B,CAAE,SAAQ,WAAU,OAAM,YAAW,CAAC,CAClE,CACD,eAAe,GAAW,EAAa,SAAY,IAAA,GACnD,GAAI,EACJ,CAAA,CAIN,EAAmB,YAAc,sBAOjC,SAAgB,EAAc,CAAE,YAAW,GAAG,GAA6B,CACzE,IAAM,EAAe,GAAiB,CAChC,EAAU,CAAC,CAAC,EAAa,QAE/B,OACE,EAACA,EAAkB,MAAnB,CACE,UAAW,EACT,qEACA,EACD,CACD,GAAK,GAAW,CACd,GAAI,EAAa,QACjB,eAAgB,EAAa,SAAW,IAAA,GACxC,gBAAiB,EAAa,UAAY,IAAA,GAC1C,mBAAoB,EAAa,QAC7B,EAAa,aAAe,IAAA,GAC5B,EAAa,cAAgB,IAAA,GAClC,CACD,G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orTextId: string;
|
|
16
16
|
}
|
|
17
17
|
declare function useFieldContext(): FieldContextValue;
|
|
18
|
-
interface
|
|
18
|
+
interface FieldProps extends ComponentProps<'div'> {
|
|
19
19
|
invalid?: boolean;
|
|
20
20
|
required?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
}
|
|
23
|
-
declare function
|
|
23
|
+
declare function Field({
|
|
24
24
|
className,
|
|
25
25
|
invalid,
|
|
26
26
|
required,
|
|
27
27
|
disabled,
|
|
28
28
|
...props
|
|
29
|
-
}:
|
|
30
|
-
declare namespace
|
|
29
|
+
}: FieldProps): _$react_jsx_runtime0.JSX.Element;
|
|
30
|
+
declare namespace Field {
|
|
31
31
|
var displayName: string;
|
|
32
|
+
var Label: typeof FieldLabel;
|
|
33
|
+
var Input: typeof FieldInput;
|
|
34
|
+
var Textarea: typeof FieldTextarea;
|
|
35
|
+
var HelperText: typeof FieldHelperText;
|
|
36
|
+
var ErrorText: typeof FieldErrorText;
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
type FieldLabelProps = LabelProps & {
|
|
34
39
|
showIndicator?: boolean;
|
|
35
|
-
}
|
|
40
|
+
};
|
|
36
41
|
declare function FieldLabel({
|
|
37
42
|
htmlFor,
|
|
38
43
|
showIndicator,
|
|
@@ -57,7 +62,7 @@ declare function FieldTextarea(props: TextareaProps): _$react_jsx_runtime0.JSX.E
|
|
|
57
62
|
declare namespace FieldTextarea {
|
|
58
63
|
var displayName: string;
|
|
59
64
|
}
|
|
60
|
-
|
|
65
|
+
type FieldHelperTextProps = ComponentProps<'p'>;
|
|
61
66
|
declare function FieldHelperText({
|
|
62
67
|
id,
|
|
63
68
|
className,
|
|
@@ -66,7 +71,7 @@ declare function FieldHelperText({
|
|
|
66
71
|
declare namespace FieldHelperText {
|
|
67
72
|
var displayName: string;
|
|
68
73
|
}
|
|
69
|
-
|
|
74
|
+
type FieldErrorTextProps = ComponentProps<'p'>;
|
|
70
75
|
declare function FieldErrorText({
|
|
71
76
|
id,
|
|
72
77
|
className,
|
|
@@ -75,14 +80,6 @@ declare function FieldErrorText({
|
|
|
75
80
|
declare namespace FieldErrorText {
|
|
76
81
|
var displayName: string;
|
|
77
82
|
}
|
|
78
|
-
declare const Field: typeof FieldRoot & {
|
|
79
|
-
Label: typeof FieldLabel;
|
|
80
|
-
Input: typeof FieldInput;
|
|
81
|
-
Textarea: typeof FieldTextarea;
|
|
82
|
-
HelperText: typeof FieldHelperText;
|
|
83
|
-
ErrorText: typeof FieldErrorText;
|
|
84
|
-
};
|
|
85
|
-
type FieldProps = FieldRootProps;
|
|
86
83
|
//#endregion
|
|
87
|
-
export { Field, FieldErrorTextProps, FieldHelperTextProps, FieldLabelProps, FieldProps,
|
|
84
|
+
export { Field, FieldErrorText, FieldErrorTextProps, FieldHelperText, FieldHelperTextProps, FieldInput, FieldLabel, FieldLabelProps, FieldProps, FieldTextarea, useFieldContext, useFieldInputProps };
|
|
88
85
|
//# sourceMappingURL=Field.d.ts.map
|
package/dist/Field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","names":[],"sources":["../src/components/Field/index.tsx"],"mappings":";;;;;;;UAcU,iBAAA;EACR,OAAA;EACA,QAAA;EACA,QAAA;EACA,OAAA;EACA,OAAA;EACA,YAAA;EACA,WAAA;AAAA;AAAA,iBAUc,eAAA,CAAA,GAAe,iBAAA;AAAA,UAMd,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","names":[],"sources":["../src/components/Field/index.tsx"],"mappings":";;;;;;;UAcU,iBAAA;EACR,OAAA;EACA,QAAA;EACA,QAAA;EACA,OAAA;EACA,OAAA;EACA,YAAA;EACA,WAAA;AAAA;AAAA,iBAUc,eAAA,CAAA,GAAe,iBAAA;AAAA,UAMd,UAAA,SAAmB,cAAA;EAClC,OAAA;EACA,QAAA;EACA,QAAA;AAAA;AAAA,iBAGc,KAAA,CAAA;EACd,SAAA;EACA,OAAA;EACA,QAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,UAAA,GAAU,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBANG,KAAA;EAAA;;;;;;;KAkCJ,eAAA,GAAkB,UAAA;EAC5B,aAAA;AAAA;AAAA,iBAGc,UAAA,CAAA;EACd,OAAA;EACA,aAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,eAAA,GAAe,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBALF,UAAA;EAAA,IAAU,WAAA;AAAA;AAAA,iBAkCV,kBAAA,CAAA;;;;;;;iBAeA,UAAA,CAAW,KAAA,EAAO,UAAA,GAAU,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA5B,UAAA;EAAA,IAAU,WAAA;AAAA;AAAA,iBASV,aAAA,CAAc,KAAA,EAAO,aAAA,GAAa,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAlC,aAAA;EAAA,IAAa,WAAA;AAAA;AAAA,KASjB,oBAAA,GAAuB,cAAA;AAAA,iBAEnB,eAAA,CAAA;EACd,EAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,oBAAA,GAAoB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAJP,eAAA;EAAA,IAAe,WAAA;AAAA;AAAA,KAmBnB,mBAAA,GAAsB,cAAA;AAAA,iBAElB,cAAA,CAAA;EACd,EAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAmB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAJN,cAAA;EAAA,IAAc,WAAA;AAAA"}
|
package/dist/Field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{OptionalIndicator as e,RequiredIndicator as t}from"./Indicator.js";import{Label as n}from"./Label.js";import{Input as r}from"./Input.js";import{Textarea as i}from"./Textarea.js";import{cn as a}from"@oztix/roadie-core/utils";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{createContext as l,use as u,useId as d}from"react";const f=l({fieldId:``,labelId:``,helperTextId:``,errorTextId:``});function p(){return u(f)}function m({className:e,invalid:t,required:n,disabled:r,...i}){let o=`field-${d()}`;return s(f,{value:{invalid:t,required:n,disabled:r,fieldId:o,labelId:`${o}-label`,helperTextId:`${o}-helper`,errorTextId:`${o}-error`},children:s(`div`,{className:a(`grid gap-1.5`,e),...i})})}m.displayName=`Field`;function h({htmlFor:r,showIndicator:i,children:a,...l}){let{fieldId:d,labelId:p,required:m}=u(f);return c(n,{id:p||void 0,htmlFor:r??(d||void 0),...l,children:[a,i&&(m?c(o,{children:[` `,s(t,{})]}):c(o,{children:[` `,s(e,{})]}))]})}h.displayName=`Field.Label`;function g(){let{invalid:e,required:t,disabled:n,fieldId:r,helperTextId:i,errorTextId:a}=u(f),o=e?a:i;return{id:r||void 0,disabled:n||void 0,"aria-invalid":e||void 0,"aria-required":t||void 0,"aria-describedby":o||void 0}}function _(e){return s(r,{...g(),...e})}_.displayName=`Field.Input`;function v(e){return s(i,{...g(),...e})}v.displayName=`Field.Textarea`;function y({id:e,className:t,...n}){let{helperTextId:r}=u(f);return s(`p`,{id:e??(r||void 0),className:a(`text-sm text-subtle`,t),...n})}y.displayName=`Field.HelperText`;function b({id:e,className:t,...n}){let{invalid:r,errorTextId:i}=u(f);return r?s(`p`,{id:e??(i||void 0),role:`alert`,className:a(`text-sm text-subtle intent-danger`,t),...n}):null}b.displayName=`Field.ErrorText
|
|
1
|
+
"use client";import{OptionalIndicator as e,RequiredIndicator as t}from"./Indicator.js";import{Label as n}from"./Label.js";import{Input as r}from"./Input.js";import{Textarea as i}from"./Textarea.js";import{cn as a}from"@oztix/roadie-core/utils";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{createContext as l,use as u,useId as d}from"react";const f=l({fieldId:``,labelId:``,helperTextId:``,errorTextId:``});function p(){return u(f)}function m({className:e,invalid:t,required:n,disabled:r,...i}){let o=`field-${d()}`;return s(f,{value:{invalid:t,required:n,disabled:r,fieldId:o,labelId:`${o}-label`,helperTextId:`${o}-helper`,errorTextId:`${o}-error`},children:s(`div`,{className:a(`grid gap-1.5`,e),...i})})}m.displayName=`Field`;function h({htmlFor:r,showIndicator:i,children:a,...l}){let{fieldId:d,labelId:p,required:m}=u(f);return c(n,{id:p||void 0,htmlFor:r??(d||void 0),...l,children:[a,i&&(m?c(o,{children:[` `,s(t,{})]}):c(o,{children:[` `,s(e,{})]}))]})}h.displayName=`Field.Label`;function g(){let{invalid:e,required:t,disabled:n,fieldId:r,helperTextId:i,errorTextId:a}=u(f),o=e?a:i;return{id:r||void 0,disabled:n||void 0,"aria-invalid":e||void 0,"aria-required":t||void 0,"aria-describedby":o||void 0}}function _(e){return s(r,{...g(),...e})}_.displayName=`Field.Input`;function v(e){return s(i,{...g(),...e})}v.displayName=`Field.Textarea`;function y({id:e,className:t,...n}){let{helperTextId:r}=u(f);return s(`p`,{id:e??(r||void 0),className:a(`text-sm text-subtle`,t),...n})}y.displayName=`Field.HelperText`;function b({id:e,className:t,...n}){let{invalid:r,errorTextId:i}=u(f);return r?s(`p`,{id:e??(i||void 0),role:`alert`,className:a(`text-sm text-subtle intent-danger`,t),...n}):null}b.displayName=`Field.ErrorText`,m.Label=h,m.Input=_,m.Textarea=v,m.HelperText=y,m.ErrorText=b;export{m as Field,b as FieldErrorText,y as FieldHelperText,_ as FieldInput,h as FieldLabel,v as FieldTextarea,p as useFieldContext,g as useFieldInputProps};
|
|
2
2
|
//# sourceMappingURL=Field.js.map
|
package/dist/Field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","names":[],"sources":["../src/components/Field/index.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, createContext, use, useId } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { OptionalIndicator } from '../Indicator'\nimport { RequiredIndicator } from '../Indicator'\nimport { Input, type InputProps } from '../Input'\nimport { Label, type LabelProps } from '../Label'\nimport { Textarea, type TextareaProps } from '../Textarea'\n\n/* ─── Context ─── */\n\ninterface FieldContextValue {\n invalid?: boolean\n required?: boolean\n disabled?: boolean\n fieldId: string\n labelId: string\n helperTextId: string\n errorTextId: string\n}\n\nconst FieldContext = createContext<FieldContextValue>({\n fieldId: '',\n labelId: '',\n helperTextId: '',\n errorTextId: ''\n})\n\nexport function useFieldContext() {\n return use(FieldContext)\n}\n\n/* ─── Root ─── */\n\nexport interface
|
|
1
|
+
{"version":3,"file":"Field.js","names":[],"sources":["../src/components/Field/index.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, createContext, use, useId } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { OptionalIndicator } from '../Indicator'\nimport { RequiredIndicator } from '../Indicator'\nimport { Input, type InputProps } from '../Input'\nimport { Label, type LabelProps } from '../Label'\nimport { Textarea, type TextareaProps } from '../Textarea'\n\n/* ─── Context ─── */\n\ninterface FieldContextValue {\n invalid?: boolean\n required?: boolean\n disabled?: boolean\n fieldId: string\n labelId: string\n helperTextId: string\n errorTextId: string\n}\n\nconst FieldContext = createContext<FieldContextValue>({\n fieldId: '',\n labelId: '',\n helperTextId: '',\n errorTextId: ''\n})\n\nexport function useFieldContext() {\n return use(FieldContext)\n}\n\n/* ─── Root ─── */\n\nexport interface FieldProps extends ComponentProps<'div'> {\n invalid?: boolean\n required?: boolean\n disabled?: boolean\n}\n\nexport function Field({\n className,\n invalid,\n required,\n disabled,\n ...props\n}: FieldProps) {\n const id = useId()\n const fieldId = `field-${id}`\n const labelId = `${fieldId}-label`\n const helperTextId = `${fieldId}-helper`\n const errorTextId = `${fieldId}-error`\n\n return (\n <FieldContext\n value={{\n invalid,\n required,\n disabled,\n fieldId,\n labelId,\n helperTextId,\n errorTextId\n }}\n >\n <div className={cn('grid gap-1.5', className)} {...props} />\n </FieldContext>\n )\n}\n\nField.displayName = 'Field'\n\n/* ─── Label ─── */\n\nexport type FieldLabelProps = LabelProps & {\n showIndicator?: boolean\n}\n\nexport function FieldLabel({\n htmlFor,\n showIndicator,\n children,\n ...props\n}: FieldLabelProps) {\n const { fieldId, labelId, required } = use(FieldContext)\n return (\n <Label\n id={labelId || undefined}\n htmlFor={htmlFor ?? (fieldId || undefined)}\n {...props}\n >\n {children}\n {showIndicator &&\n (required ? (\n <>\n {' '}\n <RequiredIndicator />\n </>\n ) : (\n <>\n {' '}\n <OptionalIndicator />\n </>\n ))}\n </Label>\n )\n}\n\nFieldLabel.displayName = 'Field.Label'\n\n/* ─── aria helper ─── */\n\nexport function useFieldInputProps() {\n const { invalid, required, disabled, fieldId, helperTextId, errorTextId } =\n use(FieldContext)\n const describedBy = invalid ? errorTextId : helperTextId\n return {\n id: fieldId || undefined,\n disabled: disabled || undefined,\n 'aria-invalid': invalid || undefined,\n 'aria-required': required || undefined,\n 'aria-describedby': describedBy || undefined\n }\n}\n\n/* ─── Input ─── */\n\nexport function FieldInput(props: InputProps) {\n const fieldProps = useFieldInputProps()\n return <Input {...fieldProps} {...props} />\n}\n\nFieldInput.displayName = 'Field.Input'\n\n/* ─── Textarea ─── */\n\nexport function FieldTextarea(props: TextareaProps) {\n const fieldProps = useFieldInputProps()\n return <Textarea {...fieldProps} {...props} />\n}\n\nFieldTextarea.displayName = 'Field.Textarea'\n\n/* ─── Helper text ─── */\n\nexport type FieldHelperTextProps = ComponentProps<'p'>\n\nexport function FieldHelperText({\n id,\n className,\n ...props\n}: FieldHelperTextProps) {\n const { helperTextId } = use(FieldContext)\n return (\n <p\n id={id ?? (helperTextId || undefined)}\n className={cn('text-sm text-subtle', className)}\n {...props}\n />\n )\n}\n\nFieldHelperText.displayName = 'Field.HelperText'\n\n/* ─── Error text ─── */\n\nexport type FieldErrorTextProps = ComponentProps<'p'>\n\nexport function FieldErrorText({\n id,\n className,\n ...props\n}: FieldErrorTextProps) {\n const { invalid, errorTextId } = use(FieldContext)\n if (!invalid) return null\n return (\n <p\n id={id ?? (errorTextId || undefined)}\n role='alert'\n className={cn('text-sm text-subtle intent-danger', className)}\n {...props}\n />\n )\n}\n\nFieldErrorText.displayName = 'Field.ErrorText'\n\n/* ─── Compound export ─── */\n\nField.Label = FieldLabel\nField.Input = FieldInput\nField.Textarea = FieldTextarea\nField.HelperText = FieldHelperText\nField.ErrorText = FieldErrorText\n"],"mappings":"8WAwBA,MAAM,EAAe,EAAiC,CACpD,QAAS,GACT,QAAS,GACT,aAAc,GACd,YAAa,GACd,CAAC,CAEF,SAAgB,GAAkB,CAChC,OAAO,EAAI,EAAa,CAW1B,SAAgB,EAAM,CACpB,YACA,UACA,WACA,WACA,GAAG,GACU,CAEb,IAAM,EAAU,SADL,GAAO,GAMlB,OACE,EAAC,EAAD,CACE,MAAO,CACL,UACA,WACA,WACA,UACA,QAXU,GAAG,EAAQ,QAYrB,aAXe,GAAG,EAAQ,SAY1B,YAXc,GAAG,EAAQ,QAY1B,UAED,EAAC,MAAD,CAAK,UAAW,EAAG,eAAgB,EAAU,CAAE,GAAI,EAAS,CAAA,CAC/C,CAAA,CAInB,EAAM,YAAc,QAQpB,SAAgB,EAAW,CACzB,UACA,gBACA,WACA,GAAG,GACe,CAClB,GAAM,CAAE,UAAS,UAAS,YAAa,EAAI,EAAa,CACxD,OACE,EAAC,EAAD,CACE,GAAI,GAAW,IAAA,GACf,QAAS,IAAY,GAAW,IAAA,IAChC,GAAI,WAHN,CAKG,EACA,IACE,EACC,EAAA,EAAA,CAAA,SAAA,CACG,IACD,EAAC,EAAD,EAAqB,CAAA,CACpB,CAAA,CAAA,CAEH,EAAA,EAAA,CAAA,SAAA,CACG,IACD,EAAC,EAAD,EAAqB,CAAA,CACpB,CAAA,CAAA,EAED,GAIZ,EAAW,YAAc,cAIzB,SAAgB,GAAqB,CACnC,GAAM,CAAE,UAAS,WAAU,WAAU,UAAS,eAAc,eAC1D,EAAI,EAAa,CACb,EAAc,EAAU,EAAc,EAC5C,MAAO,CACL,GAAI,GAAW,IAAA,GACf,SAAU,GAAY,IAAA,GACtB,eAAgB,GAAW,IAAA,GAC3B,gBAAiB,GAAY,IAAA,GAC7B,mBAAoB,GAAe,IAAA,GACpC,CAKH,SAAgB,EAAW,EAAmB,CAE5C,OAAO,EAAC,EAAD,CAAO,GADK,GAAoB,CACT,GAAI,EAAS,CAAA,CAG7C,EAAW,YAAc,cAIzB,SAAgB,EAAc,EAAsB,CAElD,OAAO,EAAC,EAAD,CAAU,GADE,GAAoB,CACN,GAAI,EAAS,CAAA,CAGhD,EAAc,YAAc,iBAM5B,SAAgB,EAAgB,CAC9B,KACA,YACA,GAAG,GACoB,CACvB,GAAM,CAAE,gBAAiB,EAAI,EAAa,CAC1C,OACE,EAAC,IAAD,CACE,GAAI,IAAO,GAAgB,IAAA,IAC3B,UAAW,EAAG,sBAAuB,EAAU,CAC/C,GAAI,EACJ,CAAA,CAIN,EAAgB,YAAc,mBAM9B,SAAgB,EAAe,CAC7B,KACA,YACA,GAAG,GACmB,CACtB,GAAM,CAAE,UAAS,eAAgB,EAAI,EAAa,CAElD,OADK,EAEH,EAAC,IAAD,CACE,GAAI,IAAO,GAAe,IAAA,IAC1B,KAAK,QACL,UAAW,EAAG,oCAAqC,EAAU,CAC7D,GAAI,EACJ,CAAA,CAPiB,KAWvB,EAAe,YAAc,kBAI7B,EAAM,MAAQ,EACd,EAAM,MAAQ,EACd,EAAM,SAAW,EACjB,EAAM,WAAa,EACnB,EAAM,UAAY"}
|
package/dist/Fieldset.d.ts
CHANGED
|
@@ -2,18 +2,21 @@ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Fieldset/index.d.ts
|
|
5
|
-
interface
|
|
5
|
+
interface FieldsetProps extends ComponentProps<'fieldset'> {
|
|
6
6
|
invalid?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function
|
|
8
|
+
declare function Fieldset({
|
|
9
9
|
className,
|
|
10
10
|
invalid,
|
|
11
11
|
...props
|
|
12
|
-
}:
|
|
13
|
-
declare namespace
|
|
12
|
+
}: FieldsetProps): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
declare namespace Fieldset {
|
|
14
14
|
var displayName: string;
|
|
15
|
+
var Legend: typeof FieldsetLegend;
|
|
16
|
+
var HelperText: typeof FieldsetHelperText;
|
|
17
|
+
var ErrorText: typeof FieldsetErrorText;
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
type FieldsetLegendProps = ComponentProps<'legend'>;
|
|
17
20
|
declare function FieldsetLegend({
|
|
18
21
|
className,
|
|
19
22
|
...props
|
|
@@ -21,7 +24,7 @@ declare function FieldsetLegend({
|
|
|
21
24
|
declare namespace FieldsetLegend {
|
|
22
25
|
var displayName: string;
|
|
23
26
|
}
|
|
24
|
-
|
|
27
|
+
type FieldsetHelperTextProps = ComponentProps<'p'>;
|
|
25
28
|
declare function FieldsetHelperText({
|
|
26
29
|
className,
|
|
27
30
|
...props
|
|
@@ -29,7 +32,7 @@ declare function FieldsetHelperText({
|
|
|
29
32
|
declare namespace FieldsetHelperText {
|
|
30
33
|
var displayName: string;
|
|
31
34
|
}
|
|
32
|
-
|
|
35
|
+
type FieldsetErrorTextProps = ComponentProps<'p'>;
|
|
33
36
|
declare function FieldsetErrorText({
|
|
34
37
|
className,
|
|
35
38
|
...props
|
|
@@ -37,12 +40,6 @@ declare function FieldsetErrorText({
|
|
|
37
40
|
declare namespace FieldsetErrorText {
|
|
38
41
|
var displayName: string;
|
|
39
42
|
}
|
|
40
|
-
declare const Fieldset: typeof FieldsetRoot & {
|
|
41
|
-
Legend: typeof FieldsetLegend;
|
|
42
|
-
HelperText: typeof FieldsetHelperText;
|
|
43
|
-
ErrorText: typeof FieldsetErrorText;
|
|
44
|
-
};
|
|
45
|
-
type FieldsetProps = FieldsetRootProps;
|
|
46
43
|
//#endregion
|
|
47
|
-
export { Fieldset, FieldsetErrorTextProps, FieldsetHelperTextProps, FieldsetLegendProps, FieldsetProps
|
|
44
|
+
export { Fieldset, FieldsetErrorText, FieldsetErrorTextProps, FieldsetHelperText, FieldsetHelperTextProps, FieldsetLegend, FieldsetLegendProps, FieldsetProps };
|
|
48
45
|
//# sourceMappingURL=Fieldset.d.ts.map
|
package/dist/Fieldset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.d.ts","names":[],"sources":["../src/components/Fieldset/index.tsx"],"mappings":";;;;UAgBiB,
|
|
1
|
+
{"version":3,"file":"Fieldset.d.ts","names":[],"sources":["../src/components/Fieldset/index.tsx"],"mappings":";;;;UAgBiB,aAAA,SAAsB,cAAA;EACrC,OAAA;AAAA;AAAA,iBAGc,QAAA,CAAA;EAAW,SAAA;EAAW,OAAA;EAAA,GAAY;AAAA,GAAS,aAAA,GAAa,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAxD,QAAA;EAAA;;;;;KAeJ,mBAAA,GAAsB,cAAA;AAAA,iBAElB,cAAA,CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,mBAAA,GAAmB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA3D,cAAA;EAAA,IAAc,WAAA;AAAA;AAAA,KAalB,uBAAA,GAA0B,cAAA;AAAA,iBAEtB,kBAAA,CAAA;EACd,SAAA;EAAA,GACG;AAAA,GACF,uBAAA,GAAuB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAHV,kBAAA;EAAA,IAAkB,WAAA;AAAA;AAAA,KAWtB,sBAAA,GAAyB,cAAA;AAAA,iBAErB,iBAAA,CAAA;EACd,SAAA;EAAA,GACG;AAAA,GACF,sBAAA,GAAsB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAHT,iBAAA;EAAA,IAAiB,WAAA;AAAA"}
|
package/dist/Fieldset.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{cn as e}from"@oztix/roadie-core/utils";import{jsx as t}from"react/jsx-runtime";import{createContext as n,use as r}from"react";const i=n({});function a({className:n,invalid:r,...a}){return t(i,{value:{invalid:r},children:t(`fieldset`,{className:e(`m-0 border-none p-0 [&>*+*]:mt-6`,n),...a})})}a.displayName=`Fieldset`;function o({className:n,...r}){return t(`legend`,{className:e(`text-lg font-semibold text-strong`,n),...r})}o.displayName=`Fieldset.Legend`;function s({className:n,...r}){return t(`p`,{className:e(`text-sm text-subtle`,n),...r})}s.displayName=`Fieldset.HelperText`;function c({className:n,...a}){let{invalid:o}=r(i);return o?t(`p`,{role:`alert`,className:e(`text-sm text-subtle intent-danger`,n),...a}):null}c.displayName=`Fieldset.ErrorText
|
|
1
|
+
"use client";import{cn as e}from"@oztix/roadie-core/utils";import{jsx as t}from"react/jsx-runtime";import{createContext as n,use as r}from"react";const i=n({});function a({className:n,invalid:r,...a}){return t(i,{value:{invalid:r},children:t(`fieldset`,{className:e(`m-0 border-none p-0 [&>*+*]:mt-6`,n),...a})})}a.displayName=`Fieldset`;function o({className:n,...r}){return t(`legend`,{className:e(`text-lg font-semibold text-strong`,n),...r})}o.displayName=`Fieldset.Legend`;function s({className:n,...r}){return t(`p`,{className:e(`text-sm text-subtle`,n),...r})}s.displayName=`Fieldset.HelperText`;function c({className:n,...a}){let{invalid:o}=r(i);return o?t(`p`,{role:`alert`,className:e(`text-sm text-subtle intent-danger`,n),...a}):null}c.displayName=`Fieldset.ErrorText`,a.Legend=o,a.HelperText=s,a.ErrorText=c;export{a as Fieldset,c as FieldsetErrorText,s as FieldsetHelperText,o as FieldsetLegend};
|
|
2
2
|
//# sourceMappingURL=Fieldset.js.map
|
package/dist/Fieldset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.js","names":[],"sources":["../src/components/Fieldset/index.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, createContext, use } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\n/* ─── Context ─── */\n\ninterface FieldsetContextValue {\n invalid?: boolean\n}\n\nconst FieldsetContext = createContext<FieldsetContextValue>({})\n\n/* ─── Root ─── */\n\nexport interface
|
|
1
|
+
{"version":3,"file":"Fieldset.js","names":[],"sources":["../src/components/Fieldset/index.tsx"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, createContext, use } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\n/* ─── Context ─── */\n\ninterface FieldsetContextValue {\n invalid?: boolean\n}\n\nconst FieldsetContext = createContext<FieldsetContextValue>({})\n\n/* ─── Root ─── */\n\nexport interface FieldsetProps extends ComponentProps<'fieldset'> {\n invalid?: boolean\n}\n\nexport function Fieldset({ className, invalid, ...props }: FieldsetProps) {\n return (\n <FieldsetContext value={{ invalid }}>\n <fieldset\n className={cn('m-0 border-none p-0 [&>*+*]:mt-6', className)}\n {...props}\n />\n </FieldsetContext>\n )\n}\n\nFieldset.displayName = 'Fieldset'\n\n/* ─── Legend ─── */\n\nexport type FieldsetLegendProps = ComponentProps<'legend'>\n\nexport function FieldsetLegend({ className, ...props }: FieldsetLegendProps) {\n return (\n <legend\n className={cn('text-lg font-semibold text-strong', className)}\n {...props}\n />\n )\n}\n\nFieldsetLegend.displayName = 'Fieldset.Legend'\n\n/* ─── Helper text ─── */\n\nexport type FieldsetHelperTextProps = ComponentProps<'p'>\n\nexport function FieldsetHelperText({\n className,\n ...props\n}: FieldsetHelperTextProps) {\n return <p className={cn('text-sm text-subtle', className)} {...props} />\n}\n\nFieldsetHelperText.displayName = 'Fieldset.HelperText'\n\n/* ─── Error text ─── */\n\nexport type FieldsetErrorTextProps = ComponentProps<'p'>\n\nexport function FieldsetErrorText({\n className,\n ...props\n}: FieldsetErrorTextProps) {\n const { invalid } = use(FieldsetContext)\n if (!invalid) return null\n return (\n <p\n role='alert'\n className={cn('text-sm text-subtle intent-danger', className)}\n {...props}\n />\n )\n}\n\nFieldsetErrorText.displayName = 'Fieldset.ErrorText'\n\n/* ─── Compound export ─── */\n\nFieldset.Legend = FieldsetLegend\nFieldset.HelperText = FieldsetHelperText\nFieldset.ErrorText = FieldsetErrorText\n"],"mappings":"kJAYA,MAAM,EAAkB,EAAoC,EAAE,CAAC,CAQ/D,SAAgB,EAAS,CAAE,YAAW,UAAS,GAAG,GAAwB,CACxE,OACE,EAAC,EAAD,CAAiB,MAAO,CAAE,UAAS,UACjC,EAAC,WAAD,CACE,UAAW,EAAG,mCAAoC,EAAU,CAC5D,GAAI,EACJ,CAAA,CACc,CAAA,CAItB,EAAS,YAAc,WAMvB,SAAgB,EAAe,CAAE,YAAW,GAAG,GAA8B,CAC3E,OACE,EAAC,SAAD,CACE,UAAW,EAAG,oCAAqC,EAAU,CAC7D,GAAI,EACJ,CAAA,CAIN,EAAe,YAAc,kBAM7B,SAAgB,EAAmB,CACjC,YACA,GAAG,GACuB,CAC1B,OAAO,EAAC,IAAD,CAAG,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,EAAS,CAAA,CAG1E,EAAmB,YAAc,sBAMjC,SAAgB,EAAkB,CAChC,YACA,GAAG,GACsB,CACzB,GAAM,CAAE,WAAY,EAAI,EAAgB,CAExC,OADK,EAEH,EAAC,IAAD,CACE,KAAK,QACL,UAAW,EAAG,oCAAqC,EAAU,CAC7D,GAAI,EACJ,CAAA,CANiB,KAUvB,EAAkB,YAAc,qBAIhC,EAAS,OAAS,EAClB,EAAS,WAAa,EACtB,EAAS,UAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{t as e}from"./Button-CDQ6ik0P.js";import{jsx as t}from"react/jsx-runtime";function n({size:n=`icon-md`,...r}){return t(e,{size:n,...r})}n.displayName=`IconButton`;export{n as t};
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=IconButton-0UdUDm0O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton-0UdUDm0O.js","names":[],"sources":["../src/components/Button/IconButton.tsx"],"sourcesContent":["'use client'\n\nimport { Button, type ButtonProps } from './Button'\n\nexport type IconButtonProps = Omit<ButtonProps, 'aria-label'> & {\n 'aria-label': string\n}\n\nexport function IconButton({ size = 'icon-md', ...props }: IconButtonProps) {\n return <Button size={size} {...props} />\n}\n\nIconButton.displayName = 'IconButton'\n"],"mappings":"iFAQA,SAAgB,EAAW,CAAE,OAAO,UAAW,GAAG,GAA0B,CAC1E,OAAO,EAAC,EAAD,CAAc,OAAM,GAAI,EAAS,CAAA,CAG1C,EAAW,YAAc"}
|
|
@@ -7,7 +7,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
7
7
|
//#region src/components/Button/Button.d.ts
|
|
8
8
|
declare const buttonVariants: (props?: ({
|
|
9
9
|
intent?: "neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null | undefined;
|
|
10
|
-
emphasis?: "normal" | "
|
|
10
|
+
emphasis?: "normal" | "subtle" | "subtler" | "strong" | null | undefined;
|
|
11
11
|
size?: "sm" | "md" | "lg" | "xs" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
12
12
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
type ButtonProps = Button.Props & RefAttributes<HTMLElement> & VariantProps<typeof buttonVariants>;
|
|
@@ -22,5 +22,17 @@ declare namespace Button$1 {
|
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
//#region src/components/Button/IconButton.d.ts
|
|
26
|
+
type IconButtonProps = Omit<ButtonProps, 'aria-label'> & {
|
|
27
|
+
'aria-label': string;
|
|
28
|
+
};
|
|
29
|
+
declare function IconButton({
|
|
30
|
+
size,
|
|
31
|
+
...props
|
|
32
|
+
}: IconButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
declare namespace IconButton {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { buttonVariants as a, ButtonProps as i, IconButtonProps as n, Button$1 as r, IconButton as t };
|
|
38
|
+
//# sourceMappingURL=IconButton-BajbaUJ_.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton-BajbaUJ_.d.ts","names":[],"sources":["../src/components/Button/Button.tsx","../src/components/Button/IconButton.tsx"],"mappings":";;;;;;;cAWa,cAAA,GAAc,KAAA;;;;IAwBzB,iCAAA,CAAA,SAAA;AAAA,KAEU,WAAA,GAAc,MAAA,CAAgB,KAAA,GACxC,aAAA,CAAc,WAAA,IACd,YAAA,QAAoB,cAAA;AAAA,iBAEN,QAAA,CAAA;EACd,SAAA;EACA,MAAA;EACA,QAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,WAAA,GAAW,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBANE,QAAA;EAAA,IAAM,WAAA;AAAA;;;KCrCV,eAAA,GAAkB,IAAA,CAAK,WAAA;EACjC,YAAA;AAAA;AAAA,iBAGc,UAAA,CAAA;EAAa,IAAA;EAAA,GAAqB;AAAA,GAAS,eAAA,GAAe,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA1D,UAAA;EAAA,IAAU,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton-9nnOzX_0.js","names":[],"sources":["../src/components/LinkButton/LinkButton.tsx","../src/components/LinkButton/LinkIconButton.tsx"],"sourcesContent":["import type { ComponentProps, ElementType } from 'react'\n\nimport
|
|
1
|
+
{"version":3,"file":"LinkButton-9nnOzX_0.js","names":[],"sources":["../src/components/LinkButton/LinkButton.tsx","../src/components/LinkButton/LinkIconButton.tsx"],"sourcesContent":["import type { ComponentProps, ElementType } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { buttonVariants } from '../Button/Button'\n\nexport type LinkButtonIntent =\n | 'neutral'\n | 'brand'\n | 'brand-secondary'\n | 'accent'\n | 'danger'\n | 'success'\n | 'warning'\n | 'info'\n\nexport type LinkButtonEmphasis = 'strong' | 'normal' | 'subtle' | 'subtler'\n\nexport type LinkButtonSize = 'xs' | 'sm' | 'md' | 'lg'\n\nexport type LinkButtonProps<T extends ElementType = 'a'> = {\n as?: T\n /**\n * @default 'neutral'\n */\n intent?: LinkButtonIntent\n /**\n * @default 'normal'\n */\n emphasis?: LinkButtonEmphasis\n /**\n * @default 'md'\n */\n size?: LinkButtonSize\n className?: string\n} & Omit<ComponentProps<T>, 'as' | 'intent' | 'emphasis' | 'size' | 'className'>\n\nexport function LinkButton<T extends ElementType = 'a'>({\n as,\n className,\n intent,\n emphasis,\n size,\n ...props\n}: LinkButtonProps<T>) {\n const Component = as || 'a'\n return (\n <Component\n className={cn(buttonVariants({ intent, emphasis, size, className }))}\n {...props}\n />\n )\n}\n\nLinkButton.displayName = 'LinkButton'\n","import type { ComponentProps, ElementType } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { buttonVariants } from '../Button/Button'\nimport type { LinkButtonEmphasis, LinkButtonIntent } from './LinkButton'\n\nexport type LinkIconButtonSize = 'icon-xs' | 'icon-sm' | 'icon-md' | 'icon-lg'\n\nexport type LinkIconButtonProps<T extends ElementType = 'a'> = {\n as?: T\n 'aria-label': string\n /**\n * @default 'neutral'\n */\n intent?: LinkButtonIntent\n /**\n * @default 'normal'\n */\n emphasis?: LinkButtonEmphasis\n /**\n * @default 'icon-md'\n */\n size?: LinkIconButtonSize\n className?: string\n} & Omit<\n ComponentProps<T>,\n 'as' | 'aria-label' | 'intent' | 'emphasis' | 'size' | 'className'\n>\n\nexport function LinkIconButton<T extends ElementType = 'a'>({\n as,\n className,\n intent,\n emphasis,\n size = 'icon-md',\n ...props\n}: LinkIconButtonProps<T>) {\n const Component = as || 'a'\n return (\n <Component\n className={cn(buttonVariants({ intent, emphasis, size, className }))}\n {...props}\n />\n )\n}\n\nLinkIconButton.displayName = 'LinkIconButton'\n"],"mappings":"+HAqCA,SAAgB,EAAwC,CACtD,KACA,YACA,SACA,WACA,OACA,GAAG,GACkB,CAErB,OACE,EAFgB,GAAM,IAEtB,CACE,UAAW,EAAG,EAAe,CAAE,SAAQ,WAAU,OAAM,YAAW,CAAC,CAAC,CACpE,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc,aCxBzB,SAAgB,EAA4C,CAC1D,KACA,YACA,SACA,WACA,OAAO,UACP,GAAG,GACsB,CAEzB,OACE,EAFgB,GAAM,IAEtB,CACE,UAAW,EAAG,EAAe,CAAE,SAAQ,WAAU,OAAM,YAAW,CAAC,CAAC,CACpE,GAAI,EACJ,CAAA,CAIN,EAAe,YAAc"}
|
package/dist/LinkButton.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as LinkButtonProps, n as LinkIconButtonProps, r as LinkButton, t as LinkIconButton } from "./index-
|
|
1
|
+
import { i as LinkButtonProps, n as LinkIconButtonProps, r as LinkButton, t as LinkIconButton } from "./index-4M9XZOF1.js";
|
|
2
2
|
export { LinkButton, LinkButtonProps, LinkIconButton, LinkIconButtonProps };
|
package/dist/RadioGroup.d.ts
CHANGED
|
@@ -8,26 +8,30 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
8
8
|
//#region src/components/RadioGroup/index.d.ts
|
|
9
9
|
type RadioGroupEmphasis = 'subtler' | 'normal';
|
|
10
10
|
declare const radioGroupVariants: (props?: ({
|
|
11
|
-
direction?: "
|
|
11
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
12
12
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
declare const radioGroupItemVariants: (props?: ({
|
|
14
14
|
emphasis?: "normal" | "subtler" | null | undefined;
|
|
15
15
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
16
|
-
type
|
|
16
|
+
type RadioGroupProps = RadioGroup$1.Props & RefAttributes<HTMLDivElement> & VariantProps<typeof radioGroupVariants> & {
|
|
17
17
|
emphasis?: RadioGroupEmphasis;
|
|
18
18
|
invalid?: boolean;
|
|
19
19
|
required?: boolean;
|
|
20
20
|
};
|
|
21
|
-
declare function
|
|
21
|
+
declare function RadioGroup({
|
|
22
22
|
className,
|
|
23
23
|
direction,
|
|
24
24
|
emphasis,
|
|
25
25
|
invalid,
|
|
26
26
|
required,
|
|
27
27
|
...props
|
|
28
|
-
}:
|
|
29
|
-
declare namespace
|
|
28
|
+
}: RadioGroupProps): _$react_jsx_runtime0.JSX.Element;
|
|
29
|
+
declare namespace RadioGroup {
|
|
30
30
|
var displayName: string;
|
|
31
|
+
var Item: typeof RadioGroupItem;
|
|
32
|
+
var Label: typeof RadioGroupLabel;
|
|
33
|
+
var HelperText: typeof RadioGroupHelperText;
|
|
34
|
+
var ErrorText: typeof RadioGroupErrorText;
|
|
31
35
|
}
|
|
32
36
|
type RadioGroupItemProps = Radio.Root.Props & RefAttributes<HTMLButtonElement> & {
|
|
33
37
|
label?: string;
|
|
@@ -43,9 +47,9 @@ declare function RadioGroupItem({
|
|
|
43
47
|
declare namespace RadioGroupItem {
|
|
44
48
|
var displayName: string;
|
|
45
49
|
}
|
|
46
|
-
|
|
50
|
+
type RadioGroupLabelProps = ComponentProps<'label'> & {
|
|
47
51
|
showIndicator?: boolean;
|
|
48
|
-
}
|
|
52
|
+
};
|
|
49
53
|
declare function RadioGroupLabel({
|
|
50
54
|
className,
|
|
51
55
|
showIndicator,
|
|
@@ -55,7 +59,7 @@ declare function RadioGroupLabel({
|
|
|
55
59
|
declare namespace RadioGroupLabel {
|
|
56
60
|
var displayName: string;
|
|
57
61
|
}
|
|
58
|
-
|
|
62
|
+
type RadioGroupHelperTextProps = ComponentProps<'p'>;
|
|
59
63
|
declare function RadioGroupHelperText({
|
|
60
64
|
className,
|
|
61
65
|
...props
|
|
@@ -63,7 +67,7 @@ declare function RadioGroupHelperText({
|
|
|
63
67
|
declare namespace RadioGroupHelperText {
|
|
64
68
|
var displayName: string;
|
|
65
69
|
}
|
|
66
|
-
|
|
70
|
+
type RadioGroupErrorTextProps = ComponentProps<'p'>;
|
|
67
71
|
declare function RadioGroupErrorText({
|
|
68
72
|
className,
|
|
69
73
|
...props
|
|
@@ -71,13 +75,6 @@ declare function RadioGroupErrorText({
|
|
|
71
75
|
declare namespace RadioGroupErrorText {
|
|
72
76
|
var displayName: string;
|
|
73
77
|
}
|
|
74
|
-
declare const RadioGroup: typeof RadioGroupRoot & {
|
|
75
|
-
Item: typeof RadioGroupItem;
|
|
76
|
-
Label: typeof RadioGroupLabel;
|
|
77
|
-
HelperText: typeof RadioGroupHelperText;
|
|
78
|
-
ErrorText: typeof RadioGroupErrorText;
|
|
79
|
-
};
|
|
80
|
-
type RadioGroupProps = RadioGroupRootProps;
|
|
81
78
|
//#endregion
|
|
82
|
-
export { RadioGroup, RadioGroupErrorTextProps, RadioGroupHelperTextProps, RadioGroupItemProps, RadioGroupLabelProps, RadioGroupProps,
|
|
79
|
+
export { RadioGroup, RadioGroupErrorText, RadioGroupErrorTextProps, RadioGroupHelperText, RadioGroupHelperTextProps, RadioGroupItem, RadioGroupItemProps, RadioGroupLabel, RadioGroupLabelProps, RadioGroupProps, radioGroupItemVariants, radioGroupVariants };
|
|
83
80
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
package/dist/RadioGroup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","names":[],"sources":["../src/components/RadioGroup/index.tsx"],"mappings":";;;;;;;;KAqBK,kBAAA;AAAA,cAoBQ,kBAAA,GAAkB,KAAA;;IAU7B,iCAAA,CAAA,SAAA;AAAA,cAIW,sBAAA,GAAsB,KAAA;;IAclC,iCAAA,CAAA,SAAA;AAAA,KAIW,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","names":[],"sources":["../src/components/RadioGroup/index.tsx"],"mappings":";;;;;;;;KAqBK,kBAAA;AAAA,cAoBQ,kBAAA,GAAkB,KAAA;;IAU7B,iCAAA,CAAA,SAAA;AAAA,cAIW,sBAAA,GAAsB,KAAA;;IAclC,iCAAA,CAAA,SAAA;AAAA,KAIW,eA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 @@
|
|
|
1
|
-
"use client";import{OptionalIndicator as e,RequiredIndicator as t}from"./Indicator.js";import{useFieldContext as n}from"./Field.js";import{cva as r}from"class-variance-authority";import{cn as i}from"@oztix/roadie-core/utils";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";import{createContext as c,use as l}from"react";import{Radio as u}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";const f=c({emphasis:`subtler`,direction:`vertical`}),p=r(`flex flex-wrap`,{variants:{direction:{vertical:`flex-col gap-2`,horizontal:`flex-row gap-4`}},defaultVariants:{direction:`vertical`}}),m=r(`flex cursor-pointer select-none items-center`,{variants:{emphasis:{subtler:`gap-2 rounded-lg px-1.5 py-1 emphasis-subtler is-interactive`,normal:`justify-between gap-3 rounded-xl p-4 emphasis-normal is-interactive has-[:checked]:bg-[var(--color-accent-2)] has-[:checked]:border-[var(--color-accent-9)] has-[:focus-visible]:outline has-[:focus-visible]:outline-[length:var(--focus-ring-width)] has-[:focus-visible]:outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] has-[:focus-visible]:outline-offset-0`}},defaultVariants:{emphasis:`subtler`}});function h({className:e,direction:t=`vertical`,emphasis:r=`subtler`,invalid:a,required:s,...c}){let l=n(),u=a??l.invalid,m=s??l.required,h=!!l.fieldId;return o(f,{value:{emphasis:r,direction:t??`vertical`,invalid:u,required:m},children:o(d,{className:i(p({direction:t,className:e})),...h&&{"aria-labelledby":l.labelId||void 0,"aria-describedby":u?l.errorTextId||void 0:l.helperTextId||void 0},...c})})}h.displayName=`RadioGroup`;function g({className:e,label:t,description:n,children:r,...c}){let{emphasis:d,direction:p}=l(f),h=o(u.Root,{className:i(`duration-moderate flex size-6 shrink-0 items-center justify-center rounded-full border border-subtle emphasis-sunken outline-0 outline-offset-0 outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] transition-[background-color,border-color,outline-width,outline-color] data-[checked]:border-[var(--color-accent-9)] data-[checked]:bg-[var(--color-accent-3)]`,d!==`normal`&&`focus-visible:outline-[length:var(--focus-ring-width)]`),...c,children:o(u.Indicator,{className:`size-2.5 rounded-full bg-[var(--color-accent-9)]`})});return o(`label`,{className:i(m({emphasis:d,className:e}),p===`horizontal`&&d===`normal`&&`flex-1`),children:d===`normal`?s(a,{children:[s(`div`,{className:`grid gap-0.5`,children:[s(`span`,{className:`flex items-center gap-2`,children:[r,t&&o(`span`,{className:`text-base font-medium text-normal`,children:t})]}),n&&o(`span`,{className:`text-sm text-subtle`,children:n})]}),h]}):s(a,{children:[h,r,t&&o(`span`,{className:`text-sm text-normal`,children:t})]})})}g.displayName=`RadioGroup.Item`;function _({className:n,showIndicator:r,children:c,...u}){let{required:d}=l(f);return s(`label`,{className:i(`flex w-full items-center gap-1 text-sm font-medium text-normal`,n),...u,children:[c,r&&(d?s(a,{children:[` `,o(t,{})]}):s(a,{children:[` `,o(e,{})]}))]})}_.displayName=`RadioGroup.Label`;function v({className:e,...t}){return o(`p`,{className:i(`w-full text-sm text-subtle`,e),...t})}v.displayName=`RadioGroup.HelperText`;function y({className:e,...t}){let{invalid:n}=l(f);return n?o(`p`,{role:`alert`,className:i(`w-full text-sm text-subtle intent-danger`,e),...t}):null}y.displayName=`RadioGroup.ErrorText
|
|
1
|
+
"use client";import{OptionalIndicator as e,RequiredIndicator as t}from"./Indicator.js";import{useFieldContext as n}from"./Field.js";import{cva as r}from"class-variance-authority";import{cn as i}from"@oztix/roadie-core/utils";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";import{createContext as c,use as l}from"react";import{Radio as u}from"@base-ui/react/radio";import{RadioGroup as d}from"@base-ui/react/radio-group";const f=c({emphasis:`subtler`,direction:`vertical`}),p=r(`flex flex-wrap`,{variants:{direction:{vertical:`flex-col gap-2`,horizontal:`flex-row gap-4`}},defaultVariants:{direction:`vertical`}}),m=r(`flex cursor-pointer select-none items-center`,{variants:{emphasis:{subtler:`gap-2 rounded-lg px-1.5 py-1 emphasis-subtler is-interactive`,normal:`justify-between gap-3 rounded-xl p-4 emphasis-normal is-interactive has-[:checked]:bg-[var(--color-accent-2)] has-[:checked]:border-[var(--color-accent-9)] has-[:focus-visible]:outline has-[:focus-visible]:outline-[length:var(--focus-ring-width)] has-[:focus-visible]:outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] has-[:focus-visible]:outline-offset-0`}},defaultVariants:{emphasis:`subtler`}});function h({className:e,direction:t=`vertical`,emphasis:r=`subtler`,invalid:a,required:s,...c}){let l=n(),u=a??l.invalid,m=s??l.required,h=!!l.fieldId;return o(f,{value:{emphasis:r,direction:t??`vertical`,invalid:u,required:m},children:o(d,{className:i(p({direction:t,className:e})),...h&&{"aria-labelledby":l.labelId||void 0,"aria-describedby":u?l.errorTextId||void 0:l.helperTextId||void 0},...c})})}h.displayName=`RadioGroup`;function g({className:e,label:t,description:n,children:r,...c}){let{emphasis:d,direction:p}=l(f),h=o(u.Root,{className:i(`duration-moderate flex size-6 shrink-0 items-center justify-center rounded-full border border-subtle emphasis-sunken outline-0 outline-offset-0 outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] transition-[background-color,border-color,outline-width,outline-color] data-[checked]:border-[var(--color-accent-9)] data-[checked]:bg-[var(--color-accent-3)]`,d!==`normal`&&`focus-visible:outline-[length:var(--focus-ring-width)]`),...c,children:o(u.Indicator,{className:`size-2.5 rounded-full bg-[var(--color-accent-9)]`})});return o(`label`,{className:i(m({emphasis:d,className:e}),p===`horizontal`&&d===`normal`&&`flex-1`),children:d===`normal`?s(a,{children:[s(`div`,{className:`grid gap-0.5`,children:[s(`span`,{className:`flex items-center gap-2`,children:[r,t&&o(`span`,{className:`text-base font-medium text-normal`,children:t})]}),n&&o(`span`,{className:`text-sm text-subtle`,children:n})]}),h]}):s(a,{children:[h,r,t&&o(`span`,{className:`text-sm text-normal`,children:t})]})})}g.displayName=`RadioGroup.Item`;function _({className:n,showIndicator:r,children:c,...u}){let{required:d}=l(f);return s(`label`,{className:i(`flex w-full items-center gap-1 text-sm font-medium text-normal`,n),...u,children:[c,r&&(d?s(a,{children:[` `,o(t,{})]}):s(a,{children:[` `,o(e,{})]}))]})}_.displayName=`RadioGroup.Label`;function v({className:e,...t}){return o(`p`,{className:i(`w-full text-sm text-subtle`,e),...t})}v.displayName=`RadioGroup.HelperText`;function y({className:e,...t}){let{invalid:n}=l(f);return n?o(`p`,{role:`alert`,className:i(`w-full text-sm text-subtle intent-danger`,e),...t}):null}y.displayName=`RadioGroup.ErrorText`,h.Item=g,h.Label=_,h.HelperText=v,h.ErrorText=y;export{h as RadioGroup,y as RadioGroupErrorText,v as RadioGroupHelperText,g as RadioGroupItem,_ as RadioGroupLabel,m as radioGroupItemVariants,p as radioGroupVariants};
|
|
2
2
|
//# sourceMappingURL=RadioGroup.js.map
|
package/dist/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["RadioGroupPrimitive"],"sources":["../src/components/RadioGroup/index.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentProps,\n type RefAttributes,\n createContext,\n use\n} from 'react'\n\nimport { Radio } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { useFieldContext } from '../Field'\nimport { OptionalIndicator } from '../Indicator'\nimport { RequiredIndicator } from '../Indicator'\n\n/* ─── Types ─── */\n\ntype RadioGroupEmphasis = 'subtler' | 'normal'\n\n/* ─── Context ─── */\n\ntype RadioGroupDirection = 'vertical' | 'horizontal'\n\ninterface RadioGroupContextValue {\n emphasis: RadioGroupEmphasis\n direction: RadioGroupDirection\n invalid?: boolean\n required?: boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue>({\n emphasis: 'subtler',\n direction: 'vertical'\n})\n\n/* ─── Root variants ─── */\n\nexport const radioGroupVariants = cva('flex flex-wrap', {\n variants: {\n direction: {\n vertical: 'flex-col gap-2',\n horizontal: 'flex-row gap-4'\n }\n },\n defaultVariants: {\n direction: 'vertical'\n }\n})\n\n/* ─── Item variants ─── */\n\nexport const radioGroupItemVariants = cva(\n 'flex cursor-pointer select-none items-center',\n {\n variants: {\n emphasis: {\n subtler: 'gap-2 rounded-lg px-1.5 py-1 emphasis-subtler is-interactive',\n normal:\n 'justify-between gap-3 rounded-xl p-4 emphasis-normal is-interactive has-[:checked]:bg-[var(--color-accent-2)] has-[:checked]:border-[var(--color-accent-9)] has-[:focus-visible]:outline has-[:focus-visible]:outline-[length:var(--focus-ring-width)] has-[:focus-visible]:outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] has-[:focus-visible]:outline-offset-0'\n }\n },\n defaultVariants: {\n emphasis: 'subtler'\n }\n }\n)\n\n/* ─── Root ─── */\n\nexport type
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["RadioGroupPrimitive"],"sources":["../src/components/RadioGroup/index.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ComponentProps,\n type RefAttributes,\n createContext,\n use\n} from 'react'\n\nimport { Radio } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { useFieldContext } from '../Field'\nimport { OptionalIndicator } from '../Indicator'\nimport { RequiredIndicator } from '../Indicator'\n\n/* ─── Types ─── */\n\ntype RadioGroupEmphasis = 'subtler' | 'normal'\n\n/* ─── Context ─── */\n\ntype RadioGroupDirection = 'vertical' | 'horizontal'\n\ninterface RadioGroupContextValue {\n emphasis: RadioGroupEmphasis\n direction: RadioGroupDirection\n invalid?: boolean\n required?: boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue>({\n emphasis: 'subtler',\n direction: 'vertical'\n})\n\n/* ─── Root variants ─── */\n\nexport const radioGroupVariants = cva('flex flex-wrap', {\n variants: {\n direction: {\n vertical: 'flex-col gap-2',\n horizontal: 'flex-row gap-4'\n }\n },\n defaultVariants: {\n direction: 'vertical'\n }\n})\n\n/* ─── Item variants ─── */\n\nexport const radioGroupItemVariants = cva(\n 'flex cursor-pointer select-none items-center',\n {\n variants: {\n emphasis: {\n subtler: 'gap-2 rounded-lg px-1.5 py-1 emphasis-subtler is-interactive',\n normal:\n 'justify-between gap-3 rounded-xl p-4 emphasis-normal is-interactive has-[:checked]:bg-[var(--color-accent-2)] has-[:checked]:border-[var(--color-accent-9)] has-[:focus-visible]:outline has-[:focus-visible]:outline-[length:var(--focus-ring-width)] has-[:focus-visible]:outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] has-[:focus-visible]:outline-offset-0'\n }\n },\n defaultVariants: {\n emphasis: 'subtler'\n }\n }\n)\n\n/* ─── Root ─── */\n\nexport type RadioGroupProps = RadioGroupPrimitive.Props &\n RefAttributes<HTMLDivElement> &\n VariantProps<typeof radioGroupVariants> & {\n emphasis?: RadioGroupEmphasis\n invalid?: boolean\n required?: boolean\n }\n\nexport function RadioGroup({\n className,\n direction = 'vertical',\n emphasis = 'subtler',\n invalid,\n required,\n ...props\n}: RadioGroupProps) {\n const fieldContext = useFieldContext()\n const resolvedInvalid = invalid ?? fieldContext.invalid\n const resolvedRequired = required ?? fieldContext.required\n const inField = !!fieldContext.fieldId\n\n return (\n <RadioGroupContext\n value={{\n emphasis,\n direction: direction ?? 'vertical',\n invalid: resolvedInvalid,\n required: resolvedRequired\n }}\n >\n <RadioGroupPrimitive\n className={cn(radioGroupVariants({ direction, className }))}\n {...(inField && {\n 'aria-labelledby': fieldContext.labelId || undefined,\n 'aria-describedby': resolvedInvalid\n ? fieldContext.errorTextId || undefined\n : fieldContext.helperTextId || undefined\n })}\n {...props}\n />\n </RadioGroupContext>\n )\n}\n\nRadioGroup.displayName = 'RadioGroup'\n\n/* ─── Item ─── */\n\nexport type RadioGroupItemProps = Radio.Root.Props &\n RefAttributes<HTMLButtonElement> & {\n label?: string\n description?: string\n }\n\nexport function RadioGroupItem({\n className,\n label,\n description,\n children,\n ...props\n}: RadioGroupItemProps) {\n const { emphasis, direction } = use(RadioGroupContext)\n\n const radio = (\n <Radio.Root\n className={cn(\n 'duration-moderate flex size-6 shrink-0 items-center justify-center rounded-full border border-subtle emphasis-sunken outline-0 outline-offset-0 outline-[color-mix(in_oklch,var(--color-accent-9)_var(--focus-ring-opacity),transparent)] transition-[background-color,border-color,outline-width,outline-color] data-[checked]:border-[var(--color-accent-9)] data-[checked]:bg-[var(--color-accent-3)]',\n emphasis !== 'normal' &&\n 'focus-visible:outline-[length:var(--focus-ring-width)]'\n )}\n {...props}\n >\n <Radio.Indicator className='size-2.5 rounded-full bg-[var(--color-accent-9)]' />\n </Radio.Root>\n )\n\n return (\n <label\n className={cn(\n radioGroupItemVariants({ emphasis, className }),\n direction === 'horizontal' && emphasis === 'normal' && 'flex-1'\n )}\n >\n {emphasis === 'normal' ? (\n <>\n <div className='grid gap-0.5'>\n <span className='flex items-center gap-2'>\n {children}\n {label && (\n <span className='text-base font-medium text-normal'>\n {label}\n </span>\n )}\n </span>\n {description && (\n <span className='text-sm text-subtle'>{description}</span>\n )}\n </div>\n {radio}\n </>\n ) : (\n <>\n {radio}\n {children}\n {label && <span className='text-sm text-normal'>{label}</span>}\n </>\n )}\n </label>\n )\n}\n\nRadioGroupItem.displayName = 'RadioGroup.Item'\n\n/* ─── Label ─── */\n\nexport type RadioGroupLabelProps = ComponentProps<'label'> & {\n showIndicator?: boolean\n}\n\nexport function RadioGroupLabel({\n className,\n showIndicator,\n children,\n ...props\n}: RadioGroupLabelProps) {\n const { required } = use(RadioGroupContext)\n return (\n <label\n className={cn(\n 'flex w-full items-center gap-1 text-sm font-medium text-normal',\n className\n )}\n {...props}\n >\n {children}\n {showIndicator &&\n (required ? (\n <>\n {' '}\n <RequiredIndicator />\n </>\n ) : (\n <>\n {' '}\n <OptionalIndicator />\n </>\n ))}\n </label>\n )\n}\n\nRadioGroupLabel.displayName = 'RadioGroup.Label'\n\n/* ─── Helper text ─── */\n\nexport type RadioGroupHelperTextProps = ComponentProps<'p'>\n\nexport function RadioGroupHelperText({\n className,\n ...props\n}: RadioGroupHelperTextProps) {\n return (\n <p className={cn('w-full text-sm text-subtle', className)} {...props} />\n )\n}\n\nRadioGroupHelperText.displayName = 'RadioGroup.HelperText'\n\n/* ─── Error text ─── */\n\nexport type RadioGroupErrorTextProps = ComponentProps<'p'>\n\nexport function RadioGroupErrorText({\n className,\n ...props\n}: RadioGroupErrorTextProps) {\n const { invalid } = use(RadioGroupContext)\n if (!invalid) return null\n return (\n <p\n role='alert'\n className={cn('w-full text-sm text-subtle intent-danger', className)}\n {...props}\n />\n )\n}\n\nRadioGroupErrorText.displayName = 'RadioGroup.ErrorText'\n\n/* ─── Compound export ─── */\n\nRadioGroup.Item = RadioGroupItem\nRadioGroup.Label = RadioGroupLabel\nRadioGroup.HelperText = RadioGroupHelperText\nRadioGroup.ErrorText = RadioGroupErrorText\n"],"mappings":"qbAkCA,MAAM,EAAoB,EAAsC,CAC9D,SAAU,UACV,UAAW,WACZ,CAAC,CAIW,EAAqB,EAAI,iBAAkB,CACtD,SAAU,CACR,UAAW,CACT,SAAU,iBACV,WAAY,iBACb,CACF,CACD,gBAAiB,CACf,UAAW,WACZ,CACF,CAAC,CAIW,EAAyB,EACpC,+CACA,CACE,SAAU,CACR,SAAU,CACR,QAAS,+DACT,OACE,8YACH,CACF,CACD,gBAAiB,CACf,SAAU,UACX,CACF,CACF,CAYD,SAAgB,EAAW,CACzB,YACA,YAAY,WACZ,WAAW,UACX,UACA,WACA,GAAG,GACe,CAClB,IAAM,EAAe,GAAiB,CAChC,EAAkB,GAAW,EAAa,QAC1C,EAAmB,GAAY,EAAa,SAC5C,EAAU,CAAC,CAAC,EAAa,QAE/B,OACE,EAAC,EAAD,CACE,MAAO,CACL,WACA,UAAW,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