@spark-ui/components 11.1.0 → 11.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.
Files changed (143) hide show
  1. package/dist/DialogTrigger-woU7vsJi.d.ts +142 -0
  2. package/dist/Input-N8AWWSmt.d.ts +41 -0
  3. package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
  4. package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
  5. package/dist/accordion/index.d.ts +73 -0
  6. package/dist/accordion/index.js +325 -0
  7. package/dist/accordion/index.js.map +1 -0
  8. package/dist/alert-dialog/index.d.ts +119 -0
  9. package/dist/alert-dialog/index.js +1554 -0
  10. package/dist/alert-dialog/index.js.map +1 -0
  11. package/dist/avatar/index.d.ts +66 -0
  12. package/dist/avatar/index.js +1303 -0
  13. package/dist/avatar/index.js.map +1 -0
  14. package/dist/badge/index.d.ts +47 -0
  15. package/dist/badge/index.js +122 -0
  16. package/dist/badge/index.js.map +1 -0
  17. package/dist/breadcrumb/index.d.ts +64 -0
  18. package/dist/breadcrumb/index.js +327 -0
  19. package/dist/breadcrumb/index.js.map +1 -0
  20. package/dist/button/index.d.ts +41 -0
  21. package/dist/button/index.js +935 -0
  22. package/dist/button/index.js.map +1 -0
  23. package/dist/card/index.d.ts +61 -0
  24. package/dist/card/index.js +502 -0
  25. package/dist/card/index.js.map +1 -0
  26. package/dist/carousel/index.d.ts +261 -0
  27. package/dist/carousel/index.js +1801 -0
  28. package/dist/carousel/index.js.map +1 -0
  29. package/dist/checkbox/index.d.ts +120 -0
  30. package/dist/checkbox/index.js +511 -0
  31. package/dist/checkbox/index.js.map +1 -0
  32. package/dist/chip/index.d.ts +97 -0
  33. package/dist/chip/index.js +908 -0
  34. package/dist/chip/index.js.map +1 -0
  35. package/dist/collapsible/index.d.ts +43 -0
  36. package/dist/collapsible/index.js +109 -0
  37. package/dist/collapsible/index.js.map +1 -0
  38. package/dist/combobox/index.d.ts +287 -0
  39. package/dist/combobox/index.js +2588 -0
  40. package/dist/combobox/index.js.map +1 -0
  41. package/dist/dialog/index.d.ts +33 -0
  42. package/dist/dialog/index.js +1389 -0
  43. package/dist/dialog/index.js.map +1 -0
  44. package/dist/divider/index.d.ts +61 -0
  45. package/dist/divider/index.js +224 -0
  46. package/dist/divider/index.js.map +1 -0
  47. package/dist/drawer/index.d.ts +152 -0
  48. package/dist/drawer/index.js +1400 -0
  49. package/dist/drawer/index.js.map +1 -0
  50. package/dist/dropdown/index.d.ts +233 -0
  51. package/dist/dropdown/index.js +2051 -0
  52. package/dist/dropdown/index.js.map +1 -0
  53. package/dist/form-field/index.d.ts +186 -0
  54. package/dist/form-field/index.js +553 -0
  55. package/dist/form-field/index.js.map +1 -0
  56. package/dist/icon/index.d.ts +28 -0
  57. package/dist/icon/index.js +127 -0
  58. package/dist/icon/index.js.map +1 -0
  59. package/dist/icon-button/index.d.ts +16 -0
  60. package/dist/icon-button/index.js +980 -0
  61. package/dist/icon-button/index.js.map +1 -0
  62. package/dist/input/index.d.ts +78 -0
  63. package/dist/input/index.js +724 -0
  64. package/dist/input/index.js.map +1 -0
  65. package/dist/kbd/index.d.ts +9 -0
  66. package/dist/kbd/index.js +47 -0
  67. package/dist/kbd/index.js.map +1 -0
  68. package/dist/label/index.d.ts +11 -0
  69. package/dist/label/index.js +78 -0
  70. package/dist/label/index.js.map +1 -0
  71. package/dist/link-box/index.d.ts +34 -0
  72. package/dist/link-box/index.js +92 -0
  73. package/dist/link-box/index.js.map +1 -0
  74. package/dist/pagination/index.d.ts +143 -0
  75. package/dist/pagination/index.js +1353 -0
  76. package/dist/pagination/index.js.map +1 -0
  77. package/dist/popover/index.d.ts +93 -0
  78. package/dist/popover/index.js +1339 -0
  79. package/dist/popover/index.js.map +1 -0
  80. package/dist/portal/index.d.ts +13 -0
  81. package/dist/portal/index.js +37 -0
  82. package/dist/portal/index.js.map +1 -0
  83. package/dist/progress/index.d.ts +48 -0
  84. package/dist/progress/index.js +223 -0
  85. package/dist/progress/index.js.map +1 -0
  86. package/dist/progress-tracker/index.d.ts +80 -0
  87. package/dist/progress-tracker/index.js +571 -0
  88. package/dist/progress-tracker/index.js.map +1 -0
  89. package/dist/radio-group/index.d.ts +100 -0
  90. package/dist/radio-group/index.js +318 -0
  91. package/dist/radio-group/index.js.map +1 -0
  92. package/dist/rating/index.d.ts +78 -0
  93. package/dist/rating/index.js +363 -0
  94. package/dist/rating/index.js.map +1 -0
  95. package/dist/scrolling-list/index.d.ts +118 -0
  96. package/dist/scrolling-list/index.js +1426 -0
  97. package/dist/scrolling-list/index.js.map +1 -0
  98. package/dist/segmented-gauge/index.d.ts +100 -0
  99. package/dist/segmented-gauge/index.js +277 -0
  100. package/dist/segmented-gauge/index.js.map +1 -0
  101. package/dist/select/index.d.ts +167 -0
  102. package/dist/select/index.js +581 -0
  103. package/dist/select/index.js.map +1 -0
  104. package/dist/skeleton/index.d.ts +67 -0
  105. package/dist/skeleton/index.js +206 -0
  106. package/dist/skeleton/index.js.map +1 -0
  107. package/dist/slider/index.d.ts +97 -0
  108. package/dist/slider/index.js +220 -0
  109. package/dist/slider/index.js.map +1 -0
  110. package/dist/slot/index.d.ts +16 -0
  111. package/dist/slot/index.js +51 -0
  112. package/dist/slot/index.js.map +1 -0
  113. package/dist/snackbar/index.d.ts +158 -0
  114. package/dist/snackbar/index.js +1756 -0
  115. package/dist/snackbar/index.js.map +1 -0
  116. package/dist/spinner/index.d.ts +21 -0
  117. package/dist/spinner/index.js +139 -0
  118. package/dist/spinner/index.js.map +1 -0
  119. package/dist/stepper/index.d.ts +81 -0
  120. package/dist/stepper/index.js +1847 -0
  121. package/dist/stepper/index.js.map +1 -0
  122. package/dist/switch/index.d.ts +64 -0
  123. package/dist/switch/index.js +327 -0
  124. package/dist/switch/index.js.map +1 -0
  125. package/dist/tabs/index.d.ts +103 -0
  126. package/dist/tabs/index.js +1376 -0
  127. package/dist/tabs/index.js.map +1 -0
  128. package/dist/tag/index.d.ts +29 -0
  129. package/dist/tag/index.js +283 -0
  130. package/dist/tag/index.js.map +1 -0
  131. package/dist/text-link/index.d.ts +20 -0
  132. package/dist/text-link/index.js +100 -0
  133. package/dist/text-link/index.js.map +1 -0
  134. package/dist/textarea/index.d.ts +57 -0
  135. package/dist/textarea/index.js +797 -0
  136. package/dist/textarea/index.js.map +1 -0
  137. package/dist/toast/index.d.ts +56 -0
  138. package/dist/toast/index.js +1412 -0
  139. package/dist/toast/index.js.map +1 -0
  140. package/dist/visually-hidden/index.d.ts +16 -0
  141. package/dist/visually-hidden/index.js +67 -0
  142. package/dist/visually-hidden/index.js.map +1 -0
  143. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/input/index.ts","../../src/input/InputClearButton.tsx","../../src/icon/Icon.tsx","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/input/InputGroupContext.ts","../../src/input/InputGroup.tsx","../../src/input/InputGroup.styles.ts","../../src/input/InputLeadingAddon.tsx","../../src/input/InputAddon.tsx","../../src/input/InputAddon.styles.ts","../../src/input/InputLeadingIcon.tsx","../../src/input/InputIcon.tsx","../../src/input/InputTrailingAddon.tsx","../../src/input/InputTrailingIcon.tsx","../../src/input/Input.tsx","../../src/input/Input.styles.ts"],"sourcesContent":["import { InputClearButton } from './InputClearButton'\nimport { InputGroup as Root } from './InputGroup'\nimport { InputLeadingAddon } from './InputLeadingAddon'\nimport { InputLeadingIcon } from './InputLeadingIcon'\nimport { InputTrailingAddon } from './InputTrailingAddon'\nimport { InputTrailingIcon } from './InputTrailingIcon'\n\nexport * from './Input'\n\nexport const InputGroup: typeof Root & {\n LeadingAddon: typeof InputLeadingAddon\n TrailingAddon: typeof InputTrailingAddon\n LeadingIcon: typeof InputLeadingIcon\n TrailingIcon: typeof InputTrailingIcon\n ClearButton: typeof InputClearButton\n} = Object.assign(Root, {\n LeadingAddon: InputLeadingAddon,\n TrailingAddon: InputTrailingAddon,\n LeadingIcon: InputLeadingIcon,\n TrailingIcon: InputTrailingIcon,\n ClearButton: InputClearButton,\n})\n\nInputGroup.displayName = 'InputGroup'\nInputLeadingAddon.displayName = 'InputGroup.LeadingAddon'\nInputTrailingAddon.displayName = 'InputGroup.TrailingAddon'\nInputLeadingIcon.displayName = 'InputGroup.LeadingIcon'\nInputTrailingIcon.displayName = 'InputGroup.TrailingIcon'\nInputClearButton.displayName = 'InputGroup.ClearButton'\n\nexport { useInputGroup } from './InputGroupContext'\nexport { type InputGroupProps } from './InputGroup'\nexport { type InputLeadingIconProps } from './InputLeadingIcon'\nexport { type InputTrailingIconProps } from './InputTrailingIcon'\nexport { type InputLeadingAddonProps } from './InputLeadingAddon'\nexport { type InputTrailingAddonProps } from './InputTrailingAddon'\nexport { type InputClearButtonProps } from './InputClearButton'\n","import { DeleteOutline } from '@spark-ui/icons/DeleteOutline'\nimport { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, MouseEventHandler, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { useInputGroup } from './InputGroupContext'\n\nexport interface InputClearButtonProps extends ComponentPropsWithoutRef<'button'> {\n 'aria-label': string\n inline?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nconst Root = ({\n className,\n tabIndex = -1,\n onClick,\n inline = false,\n ref,\n ...others\n}: InputClearButtonProps) => {\n const { onClear, hasTrailingIcon } = useInputGroup()\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = event => {\n if (onClick) {\n onClick(event)\n }\n\n if (onClear) {\n onClear()\n }\n }\n\n return (\n <button\n ref={ref}\n data-spark-component=\"input-clear-button\"\n className={cx(\n className,\n 'pointer-events-auto absolute',\n inline ? 'h-sz-44 top-0 -translate-y-0' : 'top-1/2 -translate-y-1/2',\n 'inline-flex h-full items-center justify-center outline-hidden',\n 'text-neutral hover:text-neutral-hovered',\n hasTrailingIcon ? 'right-3xl px-sz-12' : 'pl-md pr-lg right-0'\n )}\n tabIndex={tabIndex}\n onClick={handleClick}\n type=\"button\"\n {...others}\n >\n <Icon size=\"sm\">\n <DeleteOutline />\n </Icon>\n </button>\n )\n}\n\nexport const InputClearButton = Object.assign(Root, {\n id: 'ClearButton',\n})\n\nRoot.displayName = 'InputGroup.ClearButton'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { createContext, useContext } from 'react'\n\nexport interface InputGroupContextValue {\n disabled?: boolean\n readOnly?: boolean\n hasLeadingIcon: boolean\n hasTrailingIcon: boolean\n hasLeadingAddon: boolean\n hasTrailingAddon: boolean\n hasClearButton: boolean\n state: null | undefined | 'error' | 'alert' | 'success'\n isStandalone?: boolean\n onClear: () => void\n}\n\nexport const InputGroupContext = createContext<Partial<InputGroupContextValue> | null>(null)\n\nexport const useInputGroup = () => {\n const context = useContext(InputGroupContext)\n\n return context || { isStandalone: true }\n}\n","/* eslint-disable max-lines-per-function */\n\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useCombinedState } from '@spark-ui/hooks/use-combined-state'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport {\n ChangeEventHandler,\n Children,\n cloneElement,\n ComponentPropsWithoutRef,\n DetailedReactHTMLElement,\n FC,\n isValidElement,\n PropsWithChildren,\n ReactElement,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react'\n\nimport { InputProps } from './Input'\nimport { inputGroupStyles, InputGroupStylesProps } from './InputGroup.styles'\nimport { InputGroupContext } from './InputGroupContext'\n\nexport interface InputGroupProps extends ComponentPropsWithoutRef<'div'>, InputGroupStylesProps {\n /**\n * Use `state` prop to assign a specific state to the group, choosing from: `error`, `alert` and `success`. By doing so, the outline styles will be updated.\n */\n state?: 'error' | 'alert' | 'success'\n /**\n * Function handler to be executed after the input has been cleared.\n */\n onClear?: () => void\n ref?: Ref<HTMLDivElement>\n}\n\nexport const InputGroup = ({\n className,\n children: childrenProp,\n state: stateProp,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n onClear,\n ref: forwardedRef,\n ...others\n}: PropsWithChildren<InputGroupProps>) => {\n const getElementId = (element?: ReactElement) => {\n return element ? (element.type as FC & { id?: string }).id : ''\n }\n\n const findElement = (...values: string[]) => {\n return children.find(child => values.includes(getElementId(child) || ''))\n }\n\n const children = Children.toArray(childrenProp).filter(isValidElement)\n const input = findElement('Input') as\n | DetailedReactHTMLElement<InputProps, HTMLInputElement>\n | undefined\n const props = input?.props || {}\n\n const inputRef = useRef<HTMLInputElement>(null!)\n const onClearRef = useRef(onClear)\n const ref = useMergeRefs<HTMLInputElement>(input?.ref, inputRef)\n const [value, onChange] = useCombinedState(\n props.value as string,\n props.defaultValue as string,\n props.onValueChange\n )\n\n // Data derivated from FormField context\n const field = useFormFieldControl()\n const state = field.state ?? stateProp\n const disabled = field.disabled || !!disabledProp\n const readOnly = field.readOnly || !!readOnlyProp\n\n // InputGroup elements (in visual order)\n const leadingAddon = findElement('LeadingAddon')\n const leadingIcon = findElement('LeadingIcon')\n const clearButton = findElement('ClearButton')\n const trailingIcon = findElement('TrailingIcon')\n const trailingAddon = findElement('TrailingAddon')\n\n // Acknowledge which subComponents are used in the compound context\n const hasLeadingAddon = !!leadingAddon\n const hasTrailingAddon = !!trailingAddon\n const hasLeadingIcon = !!leadingIcon\n const hasTrailingIcon = !!trailingIcon\n const hasClearButton = !!value && !!clearButton && !disabled && !readOnly\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = event => {\n if (props.onChange) {\n props.onChange(event)\n }\n\n onChange(event.target.value)\n }\n\n const handleClear = useCallback(() => {\n if (onClearRef.current) {\n onClearRef.current()\n }\n\n onChange('')\n\n inputRef.current.focus()\n }, [onChange])\n\n const current = useMemo(() => {\n return {\n state,\n disabled,\n readOnly,\n hasLeadingIcon,\n hasTrailingIcon,\n hasLeadingAddon,\n hasTrailingAddon,\n hasClearButton,\n onClear: handleClear,\n }\n }, [\n state,\n disabled,\n readOnly,\n hasLeadingIcon,\n hasTrailingIcon,\n hasLeadingAddon,\n hasTrailingAddon,\n hasClearButton,\n handleClear,\n ])\n\n useEffect(() => {\n onClearRef.current = onClear\n }, [onClear])\n\n // Preserve the input value when cloning. Some libraries like React Hook Form\n // only expose a ref (via `register`) without direct value access, so we need\n // to manually retrieve the value from the ref to avoid losing it.\n const inputRefValue = inputRef.current?.value\n\n return (\n <InputGroupContext.Provider value={current}>\n <div\n data-spark-component=\"input-group\"\n ref={forwardedRef}\n className={inputGroupStyles({ disabled, readOnly, className })}\n {...others}\n >\n {hasLeadingAddon && leadingAddon}\n\n <div className=\"relative inline-flex w-full\">\n {input &&\n cloneElement(input, {\n value: value ?? inputRefValue ?? '',\n ref,\n defaultValue: undefined,\n onChange: handleChange,\n })}\n\n {leadingIcon}\n\n {hasClearButton && clearButton}\n\n {trailingIcon}\n </div>\n\n {hasTrailingAddon && trailingAddon}\n </div>\n </InputGroupContext.Provider>\n )\n}\n\nInputGroup.displayName = 'InputGroup'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const inputGroupStyles = cva(['relative inline-flex w-full'], {\n variants: {\n /**\n * When `true`, prevents the user from interacting.\n */\n disabled: {\n true: [\n 'cursor-not-allowed',\n 'relative',\n 'after:absolute',\n 'after:top-0',\n 'after:h-full',\n 'after:w-full',\n 'after:border-sm after:border-outline',\n 'after:rounded-lg',\n ],\n false: 'after:hidden',\n },\n /**\n * Sets the component as interactive or not.\n */\n readOnly: {\n true: [\n 'relative',\n 'after:absolute',\n 'after:top-0',\n 'after:h-full',\n 'after:w-full',\n 'after:border-sm after:border-outline',\n 'after:rounded-lg',\n ],\n false: 'after:hidden',\n },\n },\n})\n\nexport type InputGroupStylesProps = VariantProps<typeof inputGroupStyles>\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { InputAddon, InputAddonProps } from './InputAddon'\nimport { useInputGroup } from './InputGroupContext'\n\nexport type InputLeadingAddonProps = InputAddonProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nconst Root = ({ className, ref, ...others }: InputLeadingAddonProps) => {\n const { disabled, readOnly } = useInputGroup()\n const isInactive = disabled || readOnly\n\n return (\n <div className={cx('rounded-l-lg', isInactive ? 'bg-on-surface/dim-5' : null)}>\n <InputAddon\n ref={ref}\n className={cx(className, 'rounded-r-0! mr-[-1px] rounded-l-lg')}\n {...others}\n />\n </div>\n )\n}\n\nexport const InputLeadingAddon = Object.assign(Root, {\n id: 'LeadingAddon',\n})\n\nRoot.displayName = 'InputGroup.LeadingAddon'\n","import { Children, type ComponentPropsWithoutRef, type PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { inputAddonStyles, type InputAddonStylesProps } from './InputAddon.styles'\nimport { useInputGroup } from './InputGroupContext'\n\nexport interface InputAddonProps\n extends ComponentPropsWithoutRef<'div'>,\n Omit<InputAddonStylesProps, 'intent' | 'disabled'> {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const InputAddon = ({\n asChild: asChildProp,\n className,\n children,\n ref,\n ...others\n}: PropsWithChildren<InputAddonProps>) => {\n const { state, disabled, readOnly } = useInputGroup()\n\n const isRawText = typeof children === 'string'\n const asChild = !!(isRawText ? false : asChildProp)\n const child = isRawText ? children : Children.only(children)\n const Component = asChild && !isRawText ? Slot : 'div'\n\n const getDesign = (): InputAddonStylesProps['design'] => {\n if (isRawText) return 'text'\n\n return asChild ? 'solid' : 'inline'\n }\n\n const design = getDesign()\n\n return (\n <Component\n ref={ref}\n data-spark-component=\"input-addon\"\n className={inputAddonStyles({\n className,\n intent: state,\n disabled,\n readOnly,\n asChild,\n design,\n })}\n {...(disabled && { tabIndex: -1 })}\n {...others}\n >\n {child}\n </Component>\n )\n}\n\nInputAddon.displayName = 'InputGroup.Addon'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const inputAddonStyles = cva(\n [\n 'overflow-hidden',\n 'border-sm',\n 'shrink-0',\n 'h-full',\n 'focus-visible:relative focus-visible:z-raised',\n 'mx-0',\n ],\n {\n variants: {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild: { false: ['flex', 'items-center', 'px-lg'] },\n intent: {\n neutral: 'border-outline',\n error: 'border-error',\n alert: 'border-alert',\n success: 'border-success',\n },\n /**\n * Disable the input addon, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['pointer-events-none border-outline!'],\n },\n /**\n * Changes input addon styles based on the read only status from the input.\n */\n readOnly: {\n true: ['pointer-events-none'],\n },\n /**\n * Main style of the input addon.\n */\n design: {\n text: '',\n solid: '',\n inline: '',\n },\n },\n compoundVariants: [\n {\n disabled: false,\n readOnly: false,\n design: 'text',\n class: ['bg-surface', 'text-on-surface'],\n },\n {\n disabled: true,\n design: 'text',\n class: ['text-on-surface/dim-3'],\n },\n {\n disabled: true,\n design: ['solid', 'inline'],\n class: ['opacity-dim-3'],\n },\n ],\n defaultVariants: {\n intent: 'neutral',\n },\n }\n)\n\nexport type InputAddonStylesProps = VariantProps<typeof inputAddonStyles>\n","import { cx } from 'class-variance-authority'\n\nimport { InputIcon, InputIconProps } from './InputIcon'\n\nexport type InputLeadingIconProps = InputIconProps\n\nexport const InputLeadingIcon = ({ className, ...others }: InputLeadingIconProps) => (\n <InputIcon className={cx(className, 'left-lg text-body-1')} {...others} />\n)\n\nInputLeadingIcon.id = 'LeadingIcon'\nInputLeadingIcon.displayName = 'InputGroup.LeadingIcon'\n","import { cx } from 'class-variance-authority'\n\nimport { Icon, type IconProps } from '../icon'\nimport { useInputGroup } from './InputGroupContext'\n\nexport type InputIconProps = IconProps\n\nexport const InputIcon = ({ className, intent, children, ...others }: InputIconProps) => {\n const { disabled, readOnly } = useInputGroup()\n const isInactive = disabled || readOnly\n\n return (\n <Icon\n data-spark-component=\"input-icon\"\n intent={intent}\n className={cx(\n className,\n 'pointer-events-none absolute top-[calc(var(--spacing-sz-44)/2)] -translate-y-1/2',\n intent ? undefined : 'text-neutral peer-focus:text-outline-high',\n isInactive ? 'opacity-dim-3' : undefined\n )}\n {...others}\n >\n {children}\n </Icon>\n )\n}\n\nInputIcon.displayName = 'InputGroup.Icon'\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { InputAddon, InputAddonProps } from './InputAddon'\nimport { useInputGroup } from './InputGroupContext'\n\nexport type InputTrailingAddonProps = InputAddonProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nconst Root = ({ className, ref, ...others }: InputTrailingAddonProps) => {\n const { disabled, readOnly } = useInputGroup()\n const isInactive = disabled || readOnly\n\n return (\n <div className={cx('rounded-r-lg', isInactive ? 'bg-on-surface/dim-5' : null)}>\n <InputAddon\n ref={ref}\n className={cx(className, 'rounded-l-0! ml-[-1px] rounded-r-lg')}\n {...others}\n />\n </div>\n )\n}\n\nexport const InputTrailingAddon = Object.assign(Root, {\n id: 'TrailingAddon',\n})\n\nRoot.displayName = 'InputGroup.TrailingAddon'\n","import { cx } from 'class-variance-authority'\n\nimport { InputIcon, InputIconProps } from './InputIcon'\n\nexport type InputTrailingIconProps = InputIconProps\n\nexport const InputTrailingIcon = ({ className, ...others }: InputTrailingIconProps) => (\n <InputIcon className={cx(className, 'right-lg text-body-1')} {...others} />\n)\n\nInputTrailingIcon.id = 'TrailingIcon'\nInputTrailingIcon.displayName = 'InputGroup.TrailingIcon'\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { ChangeEventHandler, ComponentPropsWithoutRef, KeyboardEventHandler, Ref } from 'react'\n\nimport { Slot } from '../slot'\nimport { inputStyles } from './Input.styles'\nimport { useInputGroup } from './InputGroupContext'\n\ntype InputPrimitiveProps = ComponentPropsWithoutRef<'input'>\n\nexport interface InputProps extends InputPrimitiveProps {\n asChild?: boolean\n onValueChange?: (value: string) => void\n ref?: Ref<HTMLInputElement>\n}\n\nconst Root = ({\n className,\n asChild = false,\n onValueChange,\n onChange,\n onKeyDown,\n disabled: disabledProp,\n readOnly: readOnlyProp,\n ref,\n ...others\n}: InputProps) => {\n const field = useFormFieldControl()\n const group = useInputGroup()\n\n const { id, name, isInvalid, isRequired, description } = field\n const {\n hasLeadingAddon,\n hasTrailingAddon,\n hasLeadingIcon,\n hasTrailingIcon,\n hasClearButton,\n onClear,\n } = group\n const Component = asChild ? Slot : 'input'\n const state = field.state || group.state\n const disabled = field.disabled || group.disabled || disabledProp\n const readOnly = field.readOnly || group.readOnly || readOnlyProp\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = event => {\n if (onChange) {\n onChange(event)\n }\n\n if (onValueChange) {\n onValueChange(event.target.value)\n }\n }\n\n const handleKeyDown: KeyboardEventHandler<HTMLInputElement> = event => {\n if (onKeyDown) {\n onKeyDown(event)\n }\n\n if (hasClearButton && onClear && event.key === 'Escape') {\n onClear()\n }\n }\n\n return (\n <Component\n data-spark-component=\"input\"\n ref={ref}\n id={id}\n name={name}\n className={inputStyles({\n asChild,\n className,\n intent: state,\n hasLeadingAddon: !!hasLeadingAddon,\n hasTrailingAddon: !!hasTrailingAddon,\n hasLeadingIcon: !!hasLeadingIcon,\n hasTrailingIcon: !!hasTrailingIcon,\n hasClearButton: !!hasClearButton,\n })}\n disabled={disabled}\n readOnly={readOnly}\n required={isRequired}\n aria-describedby={description}\n aria-invalid={isInvalid}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n {...others}\n />\n )\n}\n\nexport const Input = Object.assign(Root, {\n id: 'Input',\n})\n\nRoot.displayName = 'Input'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const inputStyles = cva(\n [\n 'relative',\n 'border-sm',\n 'peer',\n 'w-full',\n 'appearance-none outline-hidden',\n 'bg-surface',\n 'text-ellipsis text-body-1 text-on-surface',\n 'caret-neutral',\n '[&:-webkit-autofill]:[-webkit-text-fill-color:var(--color-on-surface)]',\n 'autofill:shadow-surface autofill:shadow-[inset_0_0_0px_1000px]',\n 'disabled:cursor-not-allowed disabled:border-outline disabled:bg-on-surface/dim-5 disabled:text-on-surface/dim-3',\n 'read-only:cursor-default read-only:pointer-events-none read-only:bg-on-surface/dim-5',\n 'focus:ring-1 focus:ring-inset focus:ring-focus focus:border-focus',\n ],\n {\n variants: {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild: {\n true: ['min-h-sz-44'],\n false: ['h-sz-44'],\n },\n /**\n * Color scheme of the button.\n */\n intent: {\n neutral: ['border-outline', 'default:hover:border-outline-high'],\n success: ['default:border-success'],\n alert: ['default:border-alert'],\n error: ['default:border-error'],\n },\n /**\n * Sets if there is an addon before the input text.\n */\n hasLeadingAddon: {\n true: ['rounded-l-0'],\n false: ['rounded-l-lg'],\n },\n /**\n * Sets if there is an addon after the input text.\n */\n hasTrailingAddon: {\n true: ['rounded-r-0'],\n false: ['rounded-r-lg'],\n },\n /**\n * Sets if there is an icon before the input text.\n */\n hasLeadingIcon: {\n true: ['pl-3xl'],\n false: ['pl-lg'],\n },\n /**\n * Sets if there is an icon after the input text.\n */\n hasTrailingIcon: { true: '' },\n /**\n * Sets if there is a button to clear the input text.\n */\n hasClearButton: { true: '' },\n },\n compoundVariants: [\n {\n hasTrailingIcon: false,\n hasClearButton: false,\n class: 'pr-lg',\n },\n {\n hasTrailingIcon: true,\n hasClearButton: false,\n class: 'pr-3xl',\n },\n {\n hasTrailingIcon: false,\n hasClearButton: true,\n class: 'pr-3xl',\n },\n {\n hasTrailingIcon: true,\n hasClearButton: true,\n class: 'pr-[calc(var(--spacing-3xl)*2)]',\n },\n ],\n defaultVariants: {\n intent: 'neutral',\n },\n }\n)\n\nexport type InputStylesProps = VariantProps<typeof inputStyles>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACAA,2BAA8B;AAC9B,IAAAC,mCAAmB;;;ACDnB,IAAAC,gBAA0F;;;ACA1F,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;;;ACFI,IAAAC,sBAAA;AAJG,IAAM,iBAAiB,CAAC,EAAE,UAAU,OAAO,KAAK,GAAG,MAAM,MAA2B;AACzF,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAA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W,MAAM,QAAQ,UAAU;AACvD,cAAQ;AAAA,IACV;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,YAAY;AAAA,QACrB;AAAA,QACA;AAAA,QACA,QAAQ;AAAA,QACR,iBAAiB,CAAC,CAAC;AAAA,QACnB,kBAAkB,CAAC,CAAC;AAAA,QACpB,gBAAgB,CAAC,CAAC;AAAA,QAClB,iBAAiB,CAAC,CAAC;AAAA,QACnB,gBAAgB,CAAC,CAAC;AAAA,MACpB,CAAC;AAAA,MACD;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,oBAAkB;AAAA,MAClB,gBAAc;AAAA,MACd,UAAU;AAAA,MACV,WAAW;AAAA,MACV,GAAG;AAAA;AAAA,EACN;AAEJ;AAEO,IAAM,QAAQ,OAAO,OAAOA,OAAM;AAAA,EACvC,IAAI;AACN,CAAC;AAEDA,MAAK,cAAc;;;AhBtFZ,IAAMC,cAMT,OAAO,OAAO,YAAM;AAAA,EACtB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,aAAa;AACf,CAAC;AAEDA,YAAW,cAAc;AACzB,kBAAkB,cAAc;AAChC,mBAAmB,cAAc;AACjC,iBAAiB,cAAc;AAC/B,kBAAkB,cAAc;AAChC,iBAAiB,cAAc;","names":["InputGroup","import_class_variance_authority","import_react","RadixSlot","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","Root","import_class_variance_authority","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","Root","import_class_variance_authority","import_jsx_runtime","import_form_field","import_class_variance_authority","import_jsx_runtime","Root","InputGroup"]}
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PropsWithChildren, ComponentPropsWithoutRef, Ref } from 'react';
3
+
4
+ type KbdProps = ComponentPropsWithoutRef<'div'> & {
5
+ ref?: Ref<HTMLElement>;
6
+ };
7
+ declare const Kbd: ({ className, ref, ...props }: PropsWithChildren<KbdProps>) => react_jsx_runtime.JSX.Element;
8
+
9
+ export { Kbd };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/kbd/index.ts
21
+ var kbd_exports = {};
22
+ __export(kbd_exports, {
23
+ Kbd: () => Kbd
24
+ });
25
+ module.exports = __toCommonJS(kbd_exports);
26
+
27
+ // src/kbd/Kbd.tsx
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ var Kbd = ({ className, ref, ...props }) => {
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
31
+ "kbd",
32
+ {
33
+ "data-spark-component": "kbd",
34
+ ref,
35
+ className: [
36
+ "border-sm border-b-md border-outline bg-neutral-container pe-md ps-md text-caption rounded-sm font-mono leading-4 font-bold whitespace-nowrap",
37
+ className
38
+ ].join(" "),
39
+ ...props
40
+ }
41
+ );
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ Kbd
46
+ });
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/kbd/index.ts","../../src/kbd/Kbd.tsx"],"sourcesContent":["export { Kbd } from './Kbd'\n","import { ComponentPropsWithoutRef, PropsWithChildren, Ref } from 'react'\n\nexport type KbdProps = ComponentPropsWithoutRef<'div'> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Kbd = ({ className, ref, ...props }: PropsWithChildren<KbdProps>) => {\n return (\n <kbd\n data-spark-component=\"kbd\"\n ref={ref}\n className={[\n 'border-sm border-b-md border-outline bg-neutral-container pe-md ps-md text-caption rounded-sm font-mono leading-4 font-bold whitespace-nowrap',\n className,\n ].join(' ')}\n {...props}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQI;AAFG,IAAM,MAAM,CAAC,EAAE,WAAW,KAAK,GAAG,MAAM,MAAmC;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACrB;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF,EAAE,KAAK,GAAG;AAAA,MACT,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -0,0 +1,11 @@
1
+ import { L as Label$1, a as LabelRequiredIndicator } from '../LabelRequiredIndicator-DRnCzHMU.js';
2
+ export { b as LabelProps, c as LabelRequiredIndicatorProps } from '../LabelRequiredIndicator-DRnCzHMU.js';
3
+ import 'react/jsx-runtime';
4
+ import 'radix-ui';
5
+ import 'react';
6
+
7
+ declare const Label: typeof Label$1 & {
8
+ RequiredIndicator: typeof LabelRequiredIndicator;
9
+ };
10
+
11
+ export { Label };
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/label/index.ts
21
+ var label_exports = {};
22
+ __export(label_exports, {
23
+ Label: () => Label2
24
+ });
25
+ module.exports = __toCommonJS(label_exports);
26
+
27
+ // src/label/Label.tsx
28
+ var import_class_variance_authority = require("class-variance-authority");
29
+ var import_radix_ui = require("radix-ui");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ var Label = ({ className, ref, ...others }) => {
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
33
+ import_radix_ui.Label.Label,
34
+ {
35
+ ref,
36
+ "data-spark-component": "label",
37
+ className: (0, import_class_variance_authority.cx)("text-body-1", className),
38
+ ...others
39
+ }
40
+ );
41
+ };
42
+ Label.displayName = "Label";
43
+
44
+ // src/label/LabelRequiredIndicator.tsx
45
+ var import_class_variance_authority2 = require("class-variance-authority");
46
+ var import_jsx_runtime2 = require("react/jsx-runtime");
47
+ var LabelRequiredIndicator = ({
48
+ className,
49
+ children = "*",
50
+ ref,
51
+ ...others
52
+ }) => {
53
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
54
+ "span",
55
+ {
56
+ ref,
57
+ "data-spark-component": "label-required-indicator",
58
+ role: "presentation",
59
+ "aria-hidden": "true",
60
+ className: (0, import_class_variance_authority2.cx)(className, "text-caption text-on-surface/dim-1"),
61
+ ...others,
62
+ children
63
+ }
64
+ );
65
+ };
66
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
67
+
68
+ // src/label/index.ts
69
+ var Label2 = Object.assign(Label, {
70
+ RequiredIndicator: LabelRequiredIndicator
71
+ });
72
+ Label2.displayName = "Label";
73
+ LabelRequiredIndicator.displayName = "Label.RequiredIndicator";
74
+ // Annotate the CommonJS export names for ESM import in node:
75
+ 0 && (module.exports = {
76
+ Label
77
+ });
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/label/index.ts","../../src/label/Label.tsx","../../src/label/LabelRequiredIndicator.tsx"],"sourcesContent":["import { Label as Root } from './Label'\nimport { LabelRequiredIndicator } from './LabelRequiredIndicator'\n\nexport const Label: typeof Root & {\n RequiredIndicator: typeof LabelRequiredIndicator\n} = Object.assign(Root, {\n RequiredIndicator: LabelRequiredIndicator,\n})\n\nLabel.displayName = 'Label'\nLabelRequiredIndicator.displayName = 'Label.RequiredIndicator'\n\nexport type { LabelProps } from './Label'\nexport type { LabelRequiredIndicatorProps } from './LabelRequiredIndicator'\n","import { cx } from 'class-variance-authority'\nimport { Label as RadixLabel } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type LabelProps = RadixLabel.LabelProps & {\n ref?: Ref<HTMLLabelElement>\n}\n\nexport const Label = ({ className, ref, ...others }: LabelProps) => {\n return (\n <RadixLabel.Label\n ref={ref}\n data-spark-component=\"label\"\n className={cx('text-body-1', className)}\n {...others}\n />\n )\n}\n\nLabel.displayName = 'Label'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithRef } from 'react'\n\nexport type LabelRequiredIndicatorProps = ComponentPropsWithRef<'span'>\n\nexport const LabelRequiredIndicator = ({\n className,\n children = '*',\n ref,\n ...others\n}: LabelRequiredIndicatorProps) => {\n return (\n <span\n ref={ref}\n data-spark-component=\"label-required-indicator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cx(className, 'text-caption text-on-surface/dim-1')}\n {...others}\n >\n {children}\n </span>\n )\n}\n\nLabelRequiredIndicator.displayName = 'Label.RequiredIndicator'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,sBAAoC;AAShC;AAFG,IAAM,QAAQ,CAAC,EAAE,WAAW,KAAK,GAAG,OAAO,MAAkB;AAClE,SACE;AAAA,IAAC,gBAAAC,MAAW;AAAA,IAAX;AAAA,MACC;AAAA,MACA,wBAAqB;AAAA,MACrB,eAAW,oCAAG,eAAe,SAAS;AAAA,MACrC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,cAAc;;;ACnBpB,IAAAC,mCAAmB;AAYf,IAAAC,sBAAA;AAPG,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,GAAG;AACL,MAAmC;AACjC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,wBAAqB;AAAA,MACrB,MAAK;AAAA,MACL,eAAY;AAAA,MACZ,eAAW,qCAAG,WAAW,oCAAoC;AAAA,MAC5D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,uBAAuB,cAAc;;;AFtB9B,IAAMC,SAET,OAAO,OAAO,OAAM;AAAA,EACtB,mBAAmB;AACrB,CAAC;AAEDA,OAAM,cAAc;AACpB,uBAAuB,cAAc;","names":["Label","RadixLabel","import_class_variance_authority","import_jsx_runtime","Label"]}
@@ -0,0 +1,34 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentPropsWithRef, ReactNode } from 'react';
3
+
4
+ interface LinkBoxProps extends ComponentPropsWithRef<'div'> {
5
+ asChild?: boolean;
6
+ }
7
+ declare const LinkBox$1: {
8
+ ({ className, asChild, ref, ...props }: LinkBoxProps): react_jsx_runtime.JSX.Element;
9
+ displayName: string;
10
+ };
11
+
12
+ interface LinkBoxLinkProps extends ComponentPropsWithRef<'a'> {
13
+ asChild?: boolean;
14
+ }
15
+ declare const LinkBoxLink: {
16
+ ({ className, asChild, ref, ...props }: LinkBoxLinkProps): react_jsx_runtime.JSX.Element;
17
+ displayName: string;
18
+ };
19
+
20
+ interface LinkBoxRaisedProps {
21
+ className?: string;
22
+ children: ReactNode;
23
+ }
24
+ declare const LinkBoxRaised: {
25
+ ({ className, ...props }: LinkBoxRaisedProps): react_jsx_runtime.JSX.Element;
26
+ displayName: string;
27
+ };
28
+
29
+ declare const LinkBox: typeof LinkBox$1 & {
30
+ Link: typeof LinkBoxLink;
31
+ Raised: typeof LinkBoxRaised;
32
+ };
33
+
34
+ export { LinkBox, type LinkBoxLinkProps, type LinkBoxProps };
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/link-box/index.ts
21
+ var link_box_exports = {};
22
+ __export(link_box_exports, {
23
+ LinkBox: () => LinkBox2
24
+ });
25
+ module.exports = __toCommonJS(link_box_exports);
26
+
27
+ // src/link-box/LinkBox.tsx
28
+ var import_class_variance_authority = require("class-variance-authority");
29
+
30
+ // src/slot/Slot.tsx
31
+ var import_radix_ui = require("radix-ui");
32
+ var import_react = require("react");
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var Slottable = import_radix_ui.Slot.Slottable;
35
+ var Slot = ({ ref, ...props }) => {
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
37
+ };
38
+
39
+ // src/link-box/LinkBox.tsx
40
+ var import_jsx_runtime2 = require("react/jsx-runtime");
41
+ var LinkBox = ({ className, asChild, ref, ...props }) => {
42
+ const Component = asChild ? Slot : "div";
43
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
44
+ Component,
45
+ {
46
+ ref,
47
+ "data-spark-component": "link-box",
48
+ className: (0, import_class_variance_authority.cx)("default:relative", className),
49
+ ...props
50
+ }
51
+ );
52
+ };
53
+ LinkBox.displayName = "LinkBox";
54
+
55
+ // src/link-box/LinkBoxLink.tsx
56
+ var import_class_variance_authority2 = require("class-variance-authority");
57
+ var import_jsx_runtime3 = require("react/jsx-runtime");
58
+ var LinkBoxLink = ({ className, asChild, ref, ...props }) => {
59
+ const Component = asChild ? Slot : "a";
60
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
61
+ Component,
62
+ {
63
+ ref,
64
+ "data-spark-component": "link-box-link",
65
+ className: (0, import_class_variance_authority2.cx)(
66
+ "before:z-base static before:absolute before:top-0 before:left-0 before:block before:size-full before:content-['']",
67
+ className
68
+ ),
69
+ ...props
70
+ }
71
+ );
72
+ };
73
+ LinkBoxLink.displayName = "LinkBox.Link";
74
+
75
+ // src/link-box/LinkBoxRaised.tsx
76
+ var import_class_variance_authority3 = require("class-variance-authority");
77
+ var import_jsx_runtime4 = require("react/jsx-runtime");
78
+ var LinkBoxRaised = ({ className, ...props }) => {
79
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { className: (0, import_class_variance_authority3.cx)("default:z-raised default:relative", className), ...props });
80
+ };
81
+ LinkBoxRaised.displayName = "LinkBox.Raised";
82
+
83
+ // src/link-box/index.ts
84
+ var LinkBox2 = Object.assign(LinkBox, { Link: LinkBoxLink, Raised: LinkBoxRaised });
85
+ LinkBox2.displayName = "LinkBox";
86
+ LinkBox2.Link.displayName = "LinkBox.Link";
87
+ LinkBox2.Raised.displayName = "LinkBox.Raised";
88
+ // Annotate the CommonJS export names for ESM import in node:
89
+ 0 && (module.exports = {
90
+ LinkBox
91
+ });
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/link-box/index.ts","../../src/link-box/LinkBox.tsx","../../src/slot/Slot.tsx","../../src/link-box/LinkBoxLink.tsx","../../src/link-box/LinkBoxRaised.tsx"],"sourcesContent":["import { LinkBox as Root } from './LinkBox'\nimport { LinkBoxLink } from './LinkBoxLink'\nimport { LinkBoxRaised } from './LinkBoxRaised'\n\nexport const LinkBox: typeof Root & {\n Link: typeof LinkBoxLink\n Raised: typeof LinkBoxRaised\n} = Object.assign(Root, { Link: LinkBoxLink, Raised: LinkBoxRaised })\n\nLinkBox.displayName = 'LinkBox'\nLinkBox.Link.displayName = 'LinkBox.Link'\nLinkBox.Raised.displayName = 'LinkBox.Raised'\n\nexport { type LinkBoxProps } from './LinkBox'\nexport { type LinkBoxLinkProps } from './LinkBoxLink'\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nexport interface LinkBoxProps extends ComponentPropsWithRef<'div'> {\n asChild?: boolean\n}\n\nexport const LinkBox = ({ className, asChild, ref, ...props }: LinkBoxProps) => {\n const Component = asChild ? Slot : 'div'\n\n return (\n <Component\n ref={ref}\n data-spark-component=\"link-box\"\n className={cx('default:relative', className)}\n {...props}\n />\n )\n}\n\nLinkBox.displayName = 'LinkBox'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithRef } from 'react'\n\nimport { Slot } from '../slot'\n\nexport interface LinkBoxLinkProps extends ComponentPropsWithRef<'a'> {\n asChild?: boolean\n}\n\nexport const LinkBoxLink = ({ className, asChild, ref, ...props }: LinkBoxLinkProps) => {\n const Component = asChild ? Slot : 'a'\n\n return (\n <Component\n ref={ref}\n data-spark-component=\"link-box-link\"\n className={cx(\n \"before:z-base static before:absolute before:top-0 before:left-0 before:block before:size-full before:content-['']\",\n className\n )}\n {...props}\n />\n )\n}\n\nLinkBoxLink.displayName = 'LinkBox.Link'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode } from 'react'\n\nimport { Slot } from '../slot'\n\nexport interface LinkBoxRaisedProps {\n className?: string\n children: ReactNode\n}\n\nexport const LinkBoxRaised = ({ className, ...props }: LinkBoxRaisedProps) => {\n return <Slot className={cx('default:z-raised default:relative', className)} {...props} />\n}\n\nLinkBoxRaised.displayName = 'LinkBox.Raised'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iBAAAA;AAAA;AAAA;;;ACAA,sCAAmB;;;ACAnB,sBAAkC;AAClC,mBAOO;AASE;AAPF,IAAM,YAAwC,gBAAAC,KAAU;AAMxD,IAAM,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,MAAiB;AACpD,SAAO,4CAAC,gBAAAA,KAAU,MAAV,EAAe,KAAW,GAAG,OAAO;AAC9C;;;ADLI,IAAAC,sBAAA;AAJG,IAAM,UAAU,CAAC,EAAE,WAAW,SAAS,KAAK,GAAG,MAAM,MAAoB;AAC9E,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,wBAAqB;AAAA,MACrB,eAAW,oCAAG,oBAAoB,SAAS;AAAA,MAC1C,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,QAAQ,cAAc;;;AEtBtB,IAAAC,mCAAmB;AAaf,IAAAC,sBAAA;AAJG,IAAM,cAAc,CAAC,EAAE,WAAW,SAAS,KAAK,GAAG,MAAM,MAAwB;AACtF,QAAM,YAAY,UAAU,OAAO;AAEnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,wBAAqB;AAAA,MACrB,eAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,YAAY,cAAc;;;ACzB1B,IAAAC,mCAAmB;AAWV,IAAAC,sBAAA;AADF,IAAM,gBAAgB,CAAC,EAAE,WAAW,GAAG,MAAM,MAA0B;AAC5E,SAAO,6CAAC,QAAK,eAAW,qCAAG,qCAAqC,SAAS,GAAI,GAAG,OAAO;AACzF;AAEA,cAAc,cAAc;;;AJVrB,IAAMC,WAGT,OAAO,OAAO,SAAM,EAAE,MAAM,aAAa,QAAQ,cAAc,CAAC;AAEpEA,SAAQ,cAAc;AACtBA,SAAQ,KAAK,cAAc;AAC3BA,SAAQ,OAAO,cAAc;","names":["LinkBox","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","LinkBox"]}
@@ -0,0 +1,143 @@
1
+ import { ReactNode, ComponentPropsWithRef, ComponentPropsWithoutRef, Ref, FC } from 'react';
2
+ import * as pagination from '@zag-js/pagination';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ interface PaginationProviderProps {
6
+ children: ReactNode;
7
+ /**
8
+ * Total number of data items available across all pages.
9
+ */
10
+ count: number;
11
+ /**
12
+ * Maximum amount of items displayed on a single page.
13
+ */
14
+ pageSize: number;
15
+ /**
16
+ * Number of visible pages (or ellipsis) between previous and next page triggers.
17
+ */
18
+ visiblePageItems?: number;
19
+ /**
20
+ * The current page (active page)
21
+ */
22
+ page?: pagination.Props['page'];
23
+ /**
24
+ * If your pagination contains buttons instead of links, set `type` to `button`, extra attributes will be applied on page items for a11y.
25
+ */
26
+ type?: pagination.Props['type'];
27
+ onPageChange?: pagination.Props['onPageChange'];
28
+ noEllipsis?: boolean;
29
+ }
30
+
31
+ type PaginationProps = PaginationProviderProps & {
32
+ className?: string;
33
+ };
34
+
35
+ interface EllipsisProps extends ComponentPropsWithRef<'span'> {
36
+ index: number;
37
+ }
38
+ declare const Ellipsis: {
39
+ ({ children, index, className, ref, ...rest }: EllipsisProps): react_jsx_runtime.JSX.Element;
40
+ displayName: string;
41
+ };
42
+
43
+ interface AnchorProps$4 extends ComponentPropsWithoutRef<'a'> {
44
+ href: string;
45
+ }
46
+ interface ButtonProps$4 extends ComponentPropsWithoutRef<'button'> {
47
+ href?: undefined;
48
+ }
49
+ type FirstPageTriggerProps = Omit<AnchorProps$4 | ButtonProps$4, 'aria-label'> & {
50
+ 'aria-label': string;
51
+ ref?: Ref<HTMLButtonElement>;
52
+ };
53
+ declare const FirstPageTrigger: {
54
+ ({ children, className, href, ref, ...props }: FirstPageTriggerProps): react_jsx_runtime.JSX.Element;
55
+ displayName: string;
56
+ };
57
+
58
+ interface AnchorProps$3 extends ComponentPropsWithoutRef<'a'> {
59
+ href: string;
60
+ }
61
+ interface ButtonProps$3 extends ComponentPropsWithoutRef<'button'> {
62
+ href?: undefined;
63
+ }
64
+ type ItemProps = Omit<AnchorProps$3 | ButtonProps$3, 'aria-label'> & {
65
+ 'aria-label': string;
66
+ value: number;
67
+ ref?: Ref<HTMLButtonElement>;
68
+ };
69
+ declare const Item: {
70
+ ({ children, value, className, href, ref, ...props }: ItemProps): react_jsx_runtime.JSX.Element;
71
+ displayName: string;
72
+ };
73
+
74
+ interface AnchorProps$2 extends ComponentPropsWithoutRef<'a'> {
75
+ href: string;
76
+ }
77
+ interface ButtonProps$2 extends ComponentPropsWithoutRef<'button'> {
78
+ href?: undefined;
79
+ }
80
+ type LastPageTriggerProps = Omit<AnchorProps$2 | ButtonProps$2, 'aria-label'> & {
81
+ 'aria-label': string;
82
+ ref?: Ref<HTMLButtonElement>;
83
+ };
84
+ declare const LastPageTrigger: {
85
+ ({ children, className, href, ref, ...props }: LastPageTriggerProps): react_jsx_runtime.JSX.Element;
86
+ displayName: string;
87
+ };
88
+
89
+ interface AnchorProps$1 extends ComponentPropsWithoutRef<'a'> {
90
+ href: string;
91
+ }
92
+ interface ButtonProps$1 extends ComponentPropsWithoutRef<'button'> {
93
+ href?: undefined;
94
+ }
95
+ type NextTriggerProps = Omit<AnchorProps$1 | ButtonProps$1, 'aria-label'> & {
96
+ 'aria-label': string;
97
+ ref?: Ref<HTMLButtonElement>;
98
+ };
99
+ declare const NextTrigger: {
100
+ ({ children, className, href, ref, ...props }: NextTriggerProps): react_jsx_runtime.JSX.Element;
101
+ displayName: string;
102
+ };
103
+
104
+ type PageItem = Extract<pagination.Api['pages'][number], {
105
+ type: 'page';
106
+ }>;
107
+ type TweakedPaginationApi<T extends 'noEllipsis' | ''> = Omit<pagination.Api, 'pages'> & {
108
+ pages: T extends 'noEllipsis' ? PageItem[] : pagination.Api['pages'];
109
+ };
110
+ interface PagesProps<T extends 'noEllipsis' | ''> {
111
+ children: (pagination: TweakedPaginationApi<T>) => ReactNode;
112
+ }
113
+ declare const Pages: {
114
+ <T extends "noEllipsis" | "" = "">({ children }: PagesProps<T>): ReactNode;
115
+ displayName: string;
116
+ };
117
+
118
+ interface AnchorProps extends ComponentPropsWithoutRef<'a'> {
119
+ href: string;
120
+ }
121
+ interface ButtonProps extends ComponentPropsWithoutRef<'button'> {
122
+ href?: undefined;
123
+ }
124
+ type PrevTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {
125
+ 'aria-label': string;
126
+ ref?: Ref<HTMLButtonElement>;
127
+ };
128
+ declare const PrevTrigger: {
129
+ ({ children, className, href, ref, ...props }: PrevTriggerProps): react_jsx_runtime.JSX.Element;
130
+ displayName: string;
131
+ };
132
+
133
+ declare const Pagination: FC<PaginationProps> & {
134
+ PrevTrigger: typeof PrevTrigger;
135
+ NextTrigger: typeof NextTrigger;
136
+ Pages: typeof Pages;
137
+ Item: typeof Item;
138
+ Ellipsis: typeof Ellipsis;
139
+ FirstPageTrigger: typeof FirstPageTrigger;
140
+ LastPageTrigger: typeof LastPageTrigger;
141
+ };
142
+
143
+ export { Pagination };