@spark-ui/components
Version:
Spark (Leboncoin design system) components.
1 lines • 21.9 kB
Source Map (JSON)
{"version":3,"sources":["../../src/checkbox/Checkbox.tsx","../../src/checkbox/CheckboxGroupContext.tsx","../../src/checkbox/CheckboxInput.tsx","../../src/checkbox/CheckboxIndicator.tsx","../../src/checkbox/CheckboxInput.styles.ts","../../src/checkbox/CheckboxLabel.styles.ts","../../src/checkbox/CheckboxLabel.tsx","../../src/checkbox/CheckboxGroup.tsx","../../src/checkbox/CheckboxGroup.styles.ts"],"sourcesContent":["/* eslint-disable complexity */\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { cx } from 'class-variance-authority'\nimport { Ref, useId, useMemo, useRef } from 'react'\n\nimport { CheckboxGroupContextState, useCheckboxGroup } from './CheckboxGroupContext'\nimport { CheckboxInput, CheckboxInputProps } from './CheckboxInput'\nimport { CheckboxLabel } from './CheckboxLabel'\n\nexport type CheckboxProps = CheckboxInputProps &\n Pick<CheckboxGroupContextState, 'reverse'> & {\n ref?: Ref<HTMLButtonElement>\n }\n\nconst ID_PREFIX = ':checkbox'\n\nexport const Checkbox = ({\n id: idProp,\n className,\n intent: intentProp,\n checked: checkedProp,\n value,\n disabled,\n reverse = false,\n onCheckedChange,\n children,\n ref: forwardedRef,\n ...others\n}: CheckboxProps) => {\n const checkboxId = `${ID_PREFIX}-${useId()}`\n const innerId = idProp || checkboxId\n\n const innerLabelId = `${ID_PREFIX}-${useId()}`\n\n const field = useFormFieldControl()\n const group = useCheckboxGroup()\n\n const rootRef = useRef<HTMLButtonElement | undefined>(null)\n const ref = useMergeRefs(forwardedRef, rootRef)\n\n const getCheckboxAttributes = ({\n fieldState,\n groupState,\n checkboxIntent,\n }: {\n fieldState: ReturnType<typeof useFormFieldControl>\n groupState: ReturnType<typeof useCheckboxGroup>\n checkboxIntent: CheckboxInputProps['intent']\n }) => {\n const name = fieldState.name ?? groupState.name\n const isRequired = fieldState.isRequired ?? groupState.isRequired\n const state = fieldState.state ?? groupState.state\n const isInvalid = fieldState.isInvalid ?? groupState.isInvalid\n\n const isFieldEnclosed = fieldState.id !== groupState.id\n const id = isFieldEnclosed ? fieldState.id : undefined\n const description = isFieldEnclosed ? fieldState.description : undefined\n\n const intent = state ?? checkboxIntent ?? groupState.intent\n\n return { name, isRequired, isInvalid, id, description, intent }\n }\n\n const checked = value ? group.value?.includes(value) : checkedProp\n\n const handleCheckedChange = (isChecked: boolean) => {\n onCheckedChange?.(isChecked)\n\n const rootRefValue = rootRef.current?.value\n if (rootRefValue && group.onCheckedChange) {\n group.onCheckedChange(isChecked, rootRefValue)\n }\n }\n\n const {\n id,\n name,\n isInvalid,\n description,\n intent,\n isRequired: isRequiredAttr,\n } = getCheckboxAttributes({\n fieldState: field,\n groupState: group,\n checkboxIntent: intentProp,\n })\n\n const isRequired = useMemo(() => {\n if (!group) return isRequiredAttr\n\n return isRequiredAttr ? !group.value?.length : false\n }, [group, isRequiredAttr])\n\n const checkboxLabel = children && (\n <CheckboxLabel disabled={disabled} htmlFor={id || innerId} id={innerLabelId}>\n {children}\n </CheckboxLabel>\n )\n\n const checkboxInput = (\n <CheckboxInput\n ref={ref}\n id={id || innerId}\n name={name}\n value={value}\n intent={intent}\n checked={checked}\n disabled={disabled}\n required={isRequired}\n aria-describedby={description}\n aria-invalid={isInvalid}\n onCheckedChange={handleCheckedChange}\n aria-labelledby={children ? innerLabelId : field.labelId}\n {...others}\n />\n )\n\n const content =\n group.reverse || reverse ? (\n <>\n {checkboxLabel}\n {checkboxInput}\n </>\n ) : (\n <>\n {checkboxInput}\n {checkboxLabel}\n </>\n )\n\n return (\n <div\n data-spark-component=\"checkbox\"\n className={cx('gap-md text-body-1 relative flex items-start', className)}\n >\n {content}\n </div>\n )\n}\n\nCheckbox.displayName = 'Checkbox'\n","import { createContext, useContext } from 'react'\n\nimport { CheckboxInputStylesProps } from './CheckboxInput.styles'\n\nexport interface CheckboxGroupContextState extends Pick<CheckboxInputStylesProps, 'intent'> {\n /**\n * The id of the checkbox group.\n */\n id: string\n /**\n * The name of the group. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * The value of the checkbox group.\n */\n value?: string[]\n /**\n * A set of ids separated by a space used to describe the input component given by a set of messages.\n */\n description?: string\n /**\n * The validation state of the checkbox group.\n */\n state?: 'error' | 'success' | 'alert'\n /**\n * If true, the checkbox group will be invalid.\n */\n isInvalid?: boolean\n /**\n * If true, the checkbox group will be required.\n */\n isRequired?: boolean\n /**\n * Callback used to update or notify the value of the checkbox group.\n */\n onCheckedChange?: (checked: boolean, changed: string) => void\n /**\n * When true, the label will be placed on the left side of the Checkbox\n */\n reverse?: boolean\n}\n\nexport const CheckboxGroupContext = createContext<Partial<CheckboxGroupContextState>>({})\n\nexport const useCheckboxGroup = () => {\n const context = useContext(CheckboxGroupContext)\n\n return context\n}\n","import { Check } from '@spark-ui/icons/Check'\nimport { Minus } from '@spark-ui/icons/Minus'\nimport { Checkbox } from 'radix-ui'\nimport { ComponentPropsWithoutRef, ReactNode, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { CheckboxIndicator } from './CheckboxIndicator'\nimport { checkboxInputStyles, type CheckboxInputStylesProps } from './CheckboxInput.styles'\n\ntype CheckedStatus = boolean | 'indeterminate'\n\nconst CheckboxPrimitive = Checkbox.Checkbox\n\nexport interface CheckboxInputProps\n extends CheckboxInputStylesProps,\n Omit<ComponentPropsWithoutRef<'button'>, 'onChange' | 'value' | 'checked' | 'defaultChecked'> {\n /**\n * The checked icon to use.\n */\n icon?: ReactNode\n /**\n * The indeterminate icon to use.\n */\n indeterminateIcon?: ReactNode\n /**\n * The checked state of the checkbox when it is initially rendered. Use when you do not need to control its checked state.\n */\n defaultChecked?: boolean\n /**\n * The controlled checked state of the checkbox. Must be used in conjunction with onCheckedChange.\n */\n checked?: CheckedStatus\n /**\n * When true, prevents the user from interacting with the checkbox.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the checkbox before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The name of the checkbox. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * The value given as data when submitted with a name.\n */\n value?: string\n /**\n * Event handler called when the checked state of the checkbox changes.\n */\n onCheckedChange?: (checked: boolean) => void\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const CheckboxInput = ({\n className,\n icon = <Check />,\n indeterminateIcon = <Minus />,\n intent,\n checked,\n ref,\n ...others\n}: CheckboxInputProps) => (\n <CheckboxPrimitive\n ref={ref}\n className={checkboxInputStyles({ intent, className })}\n checked={checked}\n {...others}\n >\n <CheckboxIndicator>\n <Icon size=\"sm\">{checked === 'indeterminate' ? indeterminateIcon : icon}</Icon>\n </CheckboxIndicator>\n </CheckboxPrimitive>\n)\n\nCheckboxInput.displayName = 'CheckboxInput'\n","import { Checkbox } from 'radix-ui'\nimport { Ref } from 'react'\n\nconst CheckboxIndicatorPrimitive = Checkbox.CheckboxIndicator\n\nexport type CheckboxIndicatorProps = Checkbox.CheckboxIndicatorProps & {\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const CheckboxIndicator = (props: CheckboxIndicatorProps) => (\n <CheckboxIndicatorPrimitive className=\"flex size-full items-center justify-center\" {...props} />\n)\n\nCheckboxIndicator.displayName = 'CheckboxIndicator'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const checkboxInputStyles = cva(\n [\n 'size-sz-24 shrink-0 items-center justify-center rounded-sm border-md bg-transparent',\n 'disabled:cursor-not-allowed disabled:opacity-dim-3 disabled:hover:ring-0',\n 'focus-visible:u-outline',\n 'hover:ring-4 hover:cursor-pointer',\n 'u-shadow-border-transition',\n ],\n {\n variants: {\n /**\n * Color scheme of the checkbox.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: [\n 'text-on-main',\n 'hover:ring-main-container',\n // data-[ok=cool]:bg-main\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-main data-[state=indeterminate]:bg-main',\n 'data-[state=checked]:border-main data-[state=checked]:bg-main',\n ],\n support: [\n 'text-on-support',\n 'hover:ring-support-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-support data-[state=indeterminate]:bg-support',\n 'data-[state=checked]:border-support data-[state=checked]:bg-support',\n ],\n accent: [\n 'text-on-accent',\n 'hover:ring-accent-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-accent data-[state=indeterminate]:bg-accent',\n 'data-[state=checked]:border-accent data-[state=checked]:bg-accent',\n ],\n basic: [\n 'text-on-basic',\n 'hover:ring-basic-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-basic data-[state=indeterminate]:bg-basic',\n 'data-[state=checked]:border-basic data-[state=checked]:bg-basic',\n ],\n success: [\n 'text-on-success',\n 'hover:ring-success-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-success data-[state=indeterminate]:bg-success',\n 'data-[state=checked]:border-success data-[state=checked]:bg-success',\n ],\n alert: [\n 'text-on-alert',\n 'hover:ring-alert-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-alert data-[state=indeterminate]:bg-alert',\n 'data-[state=checked]:border-alert data-[state=checked]:bg-alert',\n ],\n error: [\n 'text-on-error',\n 'hover:ring-error-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-error data-[state=indeterminate]:bg-error',\n 'data-[state=checked]:border-error data-[state=checked]:bg-error',\n ],\n info: [\n 'text-on-info',\n 'hover:ring-info-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-info data-[state=indeterminate]:bg-info',\n 'data-[state=checked]:border-info data-[state=checked]:bg-info',\n ],\n neutral: [\n 'text-on-neutral',\n 'hover:ring-neutral-container',\n 'data-[state=unchecked]:border-outline',\n 'data-[state=indeterminate]:border-neutral data-[state=indeterminate]:bg-neutral',\n 'data-[state=checked]:border-neutral data-[state=checked]:bg-neutral',\n ],\n }),\n },\n defaultVariants: {\n intent: 'basic',\n },\n }\n)\n\nexport type CheckboxInputStylesProps = VariantProps<typeof checkboxInputStyles>\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const labelStyles = cva('grow', {\n variants: {\n disabled: {\n true: ['text-neutral/dim-2', 'cursor-not-allowed'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n disabled: false,\n },\n})\n\nexport type LabelStylesProps = VariantProps<typeof labelStyles>\n","import { Label, LabelProps } from '../label'\nimport { labelStyles, type LabelStylesProps } from './CheckboxLabel.styles'\n\nexport interface CheckboxLabelProps extends LabelProps, LabelStylesProps {\n /**\n * When true, prevents the user from interacting with the checkbox item.\n */\n disabled?: boolean\n}\n\nexport const CheckboxLabel = ({ disabled, ...others }: CheckboxLabelProps) => (\n <Label className={labelStyles({ disabled })} {...others} />\n)\n\nCheckboxLabel.displayName = 'CheckboxLabel'\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { useCombinedState } from '@spark-ui/hooks/use-combined-state'\nimport { ComponentPropsWithoutRef, Ref, useEffect, useMemo, useRef } from 'react'\n\nimport { checkboxGroupStyles, CheckboxGroupStylesProps } from './CheckboxGroup.styles'\nimport { CheckboxGroupContext, CheckboxGroupContextState } from './CheckboxGroupContext'\n\nexport interface CheckboxGroupProps\n extends Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'defaultValue' | 'onChange'>,\n CheckboxGroupStylesProps,\n Pick<CheckboxGroupContextState, 'intent' | 'name' | 'value' | 'reverse'> {\n /**\n * The initial value of the checkbox group\n */\n defaultValue?: string[]\n /**\n * The callback fired when any children Checkbox is checked or unchecked\n */\n onCheckedChange?: (value: string[]) => void\n ref?: Ref<HTMLDivElement>\n}\n\nexport const CheckboxGroup = ({\n name: nameProp,\n value: valueProp,\n defaultValue,\n className,\n intent,\n orientation = 'vertical',\n onCheckedChange: onCheckedChangeProp,\n reverse = false,\n children,\n ref,\n ...others\n}: CheckboxGroupProps) => {\n const [value, setValue] = useCombinedState(valueProp, defaultValue)\n const field = useFormFieldControl()\n const onCheckedChangeRef = useRef(onCheckedChangeProp)\n\n const { id, labelId, description, state, isInvalid, isRequired } = field\n const name = nameProp ?? field.name\n\n const current = useMemo(() => {\n const handleCheckedChange = (checked: boolean, changed: string) => {\n const values = value || []\n const modified = checked ? [...values, changed] : values.filter(val => val !== changed)\n\n setValue(modified)\n\n if (onCheckedChangeRef.current) {\n onCheckedChangeRef.current(modified)\n }\n }\n\n return {\n id,\n name,\n value,\n intent,\n state,\n isInvalid,\n description,\n isRequired,\n reverse,\n onCheckedChange: handleCheckedChange,\n }\n }, [id, name, value, intent, state, isInvalid, description, isRequired, setValue, reverse])\n\n useEffect(() => {\n onCheckedChangeRef.current = onCheckedChangeProp\n }, [onCheckedChangeProp])\n\n return (\n <CheckboxGroupContext.Provider value={current}>\n <div\n ref={ref}\n className={checkboxGroupStyles({ className, orientation })}\n role=\"group\"\n aria-labelledby={labelId}\n aria-describedby={description}\n {...others}\n >\n {children}\n </div>\n </CheckboxGroupContext.Provider>\n )\n}\n\nCheckboxGroup.displayName = 'CheckboxGroup'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const checkboxGroupStyles = cva(['flex'], {\n variants: {\n /**\n * Prop to set the orientation of the checkbox group which could be `vertical` or `horizontal`.\n */\n orientation: {\n vertical: ['flex-col', 'gap-lg'],\n horizontal: ['gap-xl'],\n },\n },\n})\n\nexport type CheckboxGroupStylesProps = VariantProps<typeof checkboxGroupStyles>\n"],"mappings":";;;;;;;;;;AACA,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAc,OAAO,SAAS,cAAc;;;ACJ5C,SAAS,eAAe,kBAAkB;AA2CnC,IAAM,uBAAuB,cAAkD,CAAC,CAAC;AAEjF,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;A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EACV;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA0B;AACxB,QAAM,CAAC,OAAO,QAAQ,IAAI,iBAAiB,WAAW,YAAY;AAClE,QAAM,QAAQC,qBAAoB;AAClC,QAAM,qBAAqBC,QAAO,mBAAmB;AAErD,QAAM,EAAE,IAAI,SAAS,aAAa,OAAO,WAAW,WAAW,IAAI;AACnE,QAAM,OAAO,YAAY,MAAM;AAE/B,QAAM,UAAUC,SAAQ,MAAM;AAC5B,UAAM,sBAAsB,CAAC,SAAkB,YAAoB;AACjE,YAAM,SAAS,SAAS,CAAC;AACzB,YAAM,WAAW,UAAU,CAAC,GAAG,QAAQ,OAAO,IAAI,OAAO,OAAO,SAAO,QAAQ,OAAO;AAEtF,eAAS,QAAQ;AAEjB,UAAI,mBAAmB,SAAS;AAC9B,2BAAmB,QAAQ,QAAQ;AAAA,MACrC;AAAA,IACF;AAEA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,IAAI,MAAM,OAAO,QAAQ,OAAO,WAAW,aAAa,YAAY,UAAU,OAAO,CAAC;AAE1F,YAAU,MAAM;AACd,uBAAmB,UAAU;AAAA,EAC/B,GAAG,CAAC,mBAAmB,CAAC;AAExB,SACE,gBAAAH,KAAC,qBAAqB,UAArB,EAA8B,OAAO,SACpC,0BAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,oBAAoB,EAAE,WAAW,YAAY,CAAC;AAAA,MACzD,MAAK;AAAA,MACL,mBAAiB;AAAA,MACjB,oBAAkB;AAAA,MACjB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,cAAc,cAAc;","names":["Checkbox","jsx","Checkbox","cva","jsx","jsx","Checkbox","name","isRequired","isInvalid","id","description","intent","useFormFieldControl","useMemo","useRef","cva","jsx","useFormFieldControl","useRef","useMemo"]}