@televet/kibble-ui 5.0.12 → 5.0.13-steve.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{avatarGroup.component-BMURlfFa.js → avatarGroup.component-BHchH_tF.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BMURlfFa.js.map → avatarGroup.component-BHchH_tF.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-h4xoHbW8.js → avatarGroup.component-WSh9t8AX.js} +2 -2
- package/dist/chunks/{avatarGroup.component-h4xoHbW8.js.map → avatarGroup.component-WSh9t8AX.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-CG_9edvt.js → buttonGroup.component-BXiKIlPf.js} +2 -2
- package/dist/chunks/{buttonGroup.component-CG_9edvt.js.map → buttonGroup.component-BXiKIlPf.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-2pDmPOps.js → buttonGroup.component-TsLHB-LO.js} +2 -2
- package/dist/chunks/{buttonGroup.component-2pDmPOps.js.map → buttonGroup.component-TsLHB-LO.js.map} +1 -1
- package/dist/chunks/{calendar.component-Dc08F2HJ.js → calendar.component-CiBkNtlB.js} +2 -2
- package/dist/chunks/{calendar.component-Dc08F2HJ.js.map → calendar.component-CiBkNtlB.js.map} +1 -1
- package/dist/chunks/{calendar.component-BrX5Jcu7.js → calendar.component-UFfX5orO.js} +2 -2
- package/dist/chunks/{calendar.component-BrX5Jcu7.js.map → calendar.component-UFfX5orO.js.map} +1 -1
- package/dist/chunks/checkbox.component-C0XdgZkr.js +271 -0
- package/dist/chunks/{checkbox.component-B19xJBOi.js.map → checkbox.component-C0XdgZkr.js.map} +1 -1
- package/dist/chunks/checkbox.component-DdOVYSSc.js +2 -0
- package/dist/chunks/{checkbox.component-C_Ytpxgh.js.map → checkbox.component-DdOVYSSc.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-ByawKeXH.js → checkboxGroup.component-CvHKP7gd.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-ByawKeXH.js.map → checkboxGroup.component-CvHKP7gd.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-BpPgob6o.js → checkboxGroup.component-lxNvlmd_.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-BpPgob6o.js.map → checkboxGroup.component-lxNvlmd_.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DHXX77Ye.js → conversationCard.component-0D3jmvOf.js} +2 -2
- package/dist/chunks/{conversationCard.component-DHXX77Ye.js.map → conversationCard.component-0D3jmvOf.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-D0vu3SMP.js → conversationCard.component-B_XSYd1p.js} +2 -2
- package/dist/chunks/{conversationCard.component-D0vu3SMP.js.map → conversationCard.component-B_XSYd1p.js.map} +1 -1
- package/dist/chunks/{datePicker.component-oxSyI0Oo.js → datePicker.component-BAaIqF1O.js} +2 -2
- package/dist/chunks/{datePicker.component-oxSyI0Oo.js.map → datePicker.component-BAaIqF1O.js.map} +1 -1
- package/dist/chunks/{datePicker.component-Bl11U0Fj.js → datePicker.component-mE9U6yIL.js} +2 -2
- package/dist/chunks/{datePicker.component-Bl11U0Fj.js.map → datePicker.component-mE9U6yIL.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-PdT2DDk_.js → datePicker.provider-DEN8clnz.js} +2 -2
- package/dist/chunks/{datePicker.provider-PdT2DDk_.js.map → datePicker.provider-DEN8clnz.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-CGwAC0Lf.js → datePicker.provider-J59sC_GD.js} +2 -2
- package/dist/chunks/{datePicker.provider-CGwAC0Lf.js.map → datePicker.provider-J59sC_GD.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-AxXtR998.js → dateTimePicker.component-CmpTclKA.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-AxXtR998.js.map → dateTimePicker.component-CmpTclKA.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-Bl0rjRi1.js → dateTimePicker.component-NOJdpYNs.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-Bl0rjRi1.js.map → dateTimePicker.component-NOJdpYNs.js.map} +1 -1
- package/dist/chunks/{menu.component-CnzGT_y3.js → menu.component-Cq9sPsTJ.js} +2 -2
- package/dist/chunks/{menu.component-CnzGT_y3.js.map → menu.component-Cq9sPsTJ.js.map} +1 -1
- package/dist/chunks/{menu.component-B5f6m2Z9.js → menu.component-DypBuCwv.js} +2 -2
- package/dist/chunks/{menu.component-B5f6m2Z9.js.map → menu.component-DypBuCwv.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-DjhmW46g.js → radioGroup.types-B--54AgI.js} +2 -2
- package/dist/chunks/{radioGroup.types-DjhmW46g.js.map → radioGroup.types-B--54AgI.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-0Zm45X5i.js → radioGroup.types-DxRSugsr.js} +2 -2
- package/dist/chunks/{radioGroup.types-0Zm45X5i.js.map → radioGroup.types-DxRSugsr.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-AV6xuUPp.js → tagBlock.component-BKYJDU4L.js} +2 -2
- package/dist/chunks/{tagBlock.component-AV6xuUPp.js.map → tagBlock.component-BKYJDU4L.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CAi-5XT3.js → tagBlock.component-BWXHnUPn.js} +2 -2
- package/dist/chunks/{tagBlock.component-CAi-5XT3.js.map → tagBlock.component-BWXHnUPn.js.map} +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/index.js +12 -12
- package/dist/esm/index.js +12 -12
- package/dist/types/components/Checkbox/checkbox.component.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/checkbox.component-B19xJBOi.js +0 -269
- package/dist/chunks/checkbox.component-C_Ytpxgh.js +0 -2
package/dist/chunks/{checkbox.component-B19xJBOi.js.map → checkbox.component-C0XdgZkr.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component-B19xJBOi.js","sources":["../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js","../../node_modules/@ark-ui/react/dist/utils/use-controllable-state.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root-provider.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkmark/checkmark.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkbox/checkbox.js","../../src/components/Checkbox/checkbox.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxProvider, useCheckboxContext] = createContext({\n name: \"CheckboxContext\",\n hookName: \"useCheckboxContext\",\n providerName: \"<CheckboxProvider />\"\n});\n\nexport { CheckboxProvider, useCheckboxContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxControl = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nCheckboxControl.displayName = \"CheckboxControl\";\n\nexport { CheckboxControl };\n","'use client';\nimport { useState, useCallback } from 'react';\n\nfunction useControllableState(props) {\n const { value, onChange, defaultValue } = props;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const controlled = value !== void 0;\n const currentValue = controlled ? value : uncontrolledValue;\n const setValue = useCallback(\n (value2) => {\n if (controlled) {\n return onChange?.(value2);\n }\n setUncontrolledValue(value2);\n return onChange?.(value2);\n },\n [controlled, onChange]\n );\n return [currentValue, setValue];\n}\n\nexport { useControllableState };\n","'use client';\nimport { useControllableState } from '../../utils/use-controllable-state.js';\nimport { useEvent } from '../../utils/use-event.js';\n\nfunction useCheckboxGroup(props = {}) {\n const { defaultValue, value: controlledValue, onValueChange, disabled, readOnly, name, invalid } = props;\n const interactive = !(disabled || readOnly);\n const onChangeProp = useEvent(onValueChange, { sync: true });\n const [value, setValue] = useControllableState({\n value: controlledValue,\n defaultValue: defaultValue || [],\n onChange: onChangeProp\n });\n const isChecked = (val) => {\n return value.some((v) => String(v) === String(val));\n };\n const toggleValue = (val) => {\n isChecked(val) ? removeValue(val) : addValue(val);\n };\n const addValue = (val) => {\n if (!interactive) return;\n if (isChecked(val)) return;\n setValue(value.concat(val));\n };\n const removeValue = (val) => {\n if (!interactive) return;\n setValue(value.filter((v) => String(v) !== String(val)));\n };\n const getItemProps = (props2) => {\n return {\n checked: props2.value != null ? isChecked(props2.value) : void 0,\n onCheckedChange() {\n if (props2.value != null) {\n toggleValue(props2.value);\n }\n },\n name,\n disabled,\n readOnly,\n invalid\n };\n };\n return {\n isChecked,\n value,\n name,\n disabled: !!disabled,\n readOnly: !!readOnly,\n invalid: !!invalid,\n setValue,\n addValue,\n toggleValue,\n getItemProps\n };\n}\n\nexport { useCheckboxGroup };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({\n name: \"CheckboxGroupContext\",\n hookName: \"useCheckboxGroupContext\",\n providerName: \"<CheckboxGroupProvider />\",\n strict: false\n});\n\nexport { CheckboxGroupContextProvider, useCheckboxGroupContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { checkboxAnatomy } from './checkbox.anatomy.js';\nimport { useCheckboxGroup } from './use-checkbox-group.js';\nimport { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';\n\nconst CheckboxGroup = forwardRef((props, ref) => {\n const [checkboxGroupProps, localProps] = createSplitProps()(props, [\n \"defaultValue\",\n \"value\",\n \"onValueChange\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"name\"\n ]);\n const checkboxGroup = useCheckboxGroup(checkboxGroupProps);\n return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: checkboxGroup, children: /* @__PURE__ */ jsx(ark.div, { ref, role: \"group\", ...localProps, ...checkboxAnatomy.build().group.attrs }) });\n});\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { CheckboxGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxHiddenInput = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nCheckboxHiddenInput.displayName = \"CheckboxHiddenInput\";\n\nexport { CheckboxHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxLabel = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nCheckboxLabel.displayName = \"CheckboxLabel\";\n\nexport { CheckboxLabel };\n","'use client';\nimport * as checkbox from '@zag-js/checkbox';\nimport { mergeProps, useMachine, normalizeProps } from '@zag-js/react';\nimport { useMemo, useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxGroupContext } from './use-checkbox-group-context.js';\n\nconst useCheckbox = (ownProps = {}) => {\n const checkboxGroup = useCheckboxGroupContext();\n const field = useFieldContext();\n const props = useMemo(() => {\n return mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});\n }, [ownProps, checkboxGroup]);\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(checkbox.machine, machineProps);\n return checkbox.connect(service, normalizeProps);\n};\n\nexport { useCheckbox };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useCheckbox } from './use-checkbox.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRoot = forwardRef((props, ref) => {\n const [useCheckboxProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const checkbox = useCheckbox(useCheckboxProps);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRoot.displayName = \"CheckboxRoot\";\n\nexport { CheckboxRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRootProvider = forwardRef((props, ref) => {\n const [{ value: checkbox }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRootProvider.displayName = \"CheckboxRootProvider\";\n\nexport { CheckboxRootProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { EMPTY_STYLES } from '../../styled-system/empty.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\n\nconst Checkmark = forwardRef(\n function Checkmark2(props, ref) {\n const recipe = useRecipe({ key: \"checkmark\", recipe: props.recipe });\n const [variantProps, restProps] = recipe.splitVariantProps(props);\n const { checked, indeterminate, disabled, unstyled, children, ...rest } = restProps;\n const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"3px\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"data-state\": indeterminate ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(disabled),\n css: [styles, props.css],\n ...rest,\n children: indeterminate ? /* @__PURE__ */ jsx(\"path\", { d: \"M5 12h14\" }) : checked ? /* @__PURE__ */ jsx(\"polyline\", { points: \"20 6 9 17 4 12\" }) : null\n }\n );\n }\n);\n\nexport { Checkmark };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { Checkmark } from '../checkmark/checkmark.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useCheckboxStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"checkbox\" });\nconst CheckboxRootProvider = withProvider(Checkbox.RootProvider, \"root\", { forwardAsChild: true });\nconst CheckboxRoot = withProvider(\n Checkbox.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst CheckboxPropsProvider = PropsProvider;\nconst CheckboxLabel = withContext(\n Checkbox.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst CheckboxIndicator = forwardRef(function CheckboxIndicator2(props, ref) {\n const { checked, indeterminate, ...rest } = props;\n const api = useCheckboxContext();\n const styles = useCheckboxStyles();\n if (checked && api.checked) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: checked\n }\n );\n }\n if (indeterminate && api.indeterminate) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: indeterminate\n }\n );\n }\n return /* @__PURE__ */ jsx(\n Checkmark,\n {\n ref,\n checked: api.checked,\n indeterminate: api.indeterminate,\n disabled: api.disabled,\n unstyled: true,\n ...rest,\n css: [styles.indicator, props.css]\n }\n );\n});\nconst CheckboxControl = withContext(\n Checkbox.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CheckboxIndicator, {}) }\n }\n);\nconst CheckboxGroup = chakra(\n Checkbox.Group,\n {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1.5\"\n }\n },\n { forwardAsChild: true }\n);\nconst CheckboxContext = Checkbox.Context;\nconst CheckboxHiddenInput = Checkbox.HiddenInput;\n\nexport { CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxPropsProvider, CheckboxRoot, CheckboxRootProvider, useCheckboxStyles };\n","import React from 'react';\nimport { Checkbox as CCheckbox } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Text } from 'components/Text/text.component';\nimport { CheckedChangeDetails, CheckedState } from './checkbox.types';\n\nexport interface CheckboxProps extends WithFormControlProps, Omit<CCheckbox.RootProps, 'onChange'> {\n /** Ref to the hidden input element. */\n checkboxRef?: React.Ref<HTMLInputElement | null>;\n /** Ref to the checkbox component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /** Size of the checkbox.\n * @default md\n */\n size?: FormControlSize;\n /**\n * If true, the checkbox will be wrapped in a Card component.\n * @default false\n */\n withCard?: boolean;\n /** Callback function when the checkbox value changes. */\n onCheckedChange?: (details: CheckedChangeDetails) => void;\n /** If true, the checkbox will be checked. Use `indeterminate` to show a checkbox with a dash in the middle. */\n checked?: CheckedState;\n /** Data test id for the checkbox.\n * @default kibble-checkbox\n */\n 'data-testid'?: string;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n checkboxRef,\n children,\n onContrast,\n rootRef,\n size = 'md',\n withCard = false,\n ['data-testid']: dataTestId = 'kibble-checkbox',\n ...rest\n },\n ref,\n ): React.ReactNode => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n return (\n <CCheckbox.Root\n className=\"Checkbox\"\n checked={rest.checked}\n data-testid={dataTestId}\n ref={rootRef}\n variant={_computedVariant}\n size={size}\n withCard={withCard}\n {...rest}\n >\n <CCheckbox.HiddenInput\n className=\"Checkbox__Input\"\n data-testid={`${dataTestId}-input`}\n ref={checkboxRef || ref}\n />\n <CCheckbox.Control className=\"Checkbox__Control\" data-testid={`${dataTestId}-control`}>\n <CCheckbox.Indicator className=\"Checkbox__Indicator\" data-testid={`${dataTestId}-indicator`} />\n </CCheckbox.Control>\n {!!children && (\n <CCheckbox.Label\n className=\"Checkbox__Label\"\n data-testid={`${dataTestId}-label`}\n {...(withCard && typeof children !== 'string' && { mt: '-4px' })}\n >\n {typeof children === 'string' ? (\n <Text size={size} lineHeight=\"unset\" variant={onContrast ? 'onContrast' : 'default'}>\n {children}\n </Text>\n ) : (\n children\n )}\n </CCheckbox.Label>\n )}\n </CCheckbox.Root>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\nconst WrappedCheckbox = withFormControl<CheckboxProps>(Checkbox);\n\nexport { WrappedCheckbox as Checkbox };\n"],"names":["CheckboxProvider","useCheckboxContext","createContext","CheckboxControl","forwardRef","props","ref","checkbox","mergedProps","mergeProps","jsx","ark","useControllableState","value","onChange","defaultValue","uncontrolledValue","setUncontrolledValue","useState","controlled","currentValue","setValue","useCallback","value2","useCheckboxGroup","controlledValue","onValueChange","disabled","readOnly","name","invalid","interactive","onChangeProp","useEvent","isChecked","val","toggleValue","removeValue","addValue","props2","CheckboxGroupContextProvider","useCheckboxGroupContext","CheckboxGroup","checkboxGroupProps","localProps","createSplitProps","checkboxGroup","checkboxAnatomy","CheckboxHiddenInput","field","useFieldContext","CheckboxLabel","useCheckbox","ownProps","useMemo","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","checkbox.machine","checkbox.connect","normalizeProps","CheckboxRoot","useCheckboxProps","CheckboxRootProvider","Checkmark","recipe","useRecipe","variantProps","restProps","checked","indeterminate","unstyled","children","rest","styles","EMPTY_STYLES","chakra","dataAttr","withProvider","withContext","useCheckboxStyles","createSlotRecipeContext","Checkbox.RootProvider","Checkbox.Root","Checkbox.Label","CheckboxIndicator","api","Checkbox.Control","Checkbox.Group","Checkbox.HiddenInput","Checkbox","React","checkboxRef","onContrast","rootRef","size","withCard","dataTestId","_computedVariant","jsxs","CCheckbox.Root","CCheckbox.HiddenInput","CCheckbox.Control","CCheckbox.Indicator","CCheckbox.Label","Text","WrappedCheckbox","withFormControl"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAkB,IAAIC,EAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAkBC,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAWN,EAAoB,GAC/BO,IAAcC,EAAWF,EAAS,gBAAe,GAAIF,CAAK;AAChE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,KAAK,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC7D,CAAC;AACDH,EAAgB,cAAc;ACT9B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cAC1B,KAAKL,KAAe5F;AAAA,YAAA;AAAA,UACtB;AAAA,UACAI,gBAAAA,MAACkG,IAAA,EAAkB,WAAU,qBAAoB,eAAa,GAAGL,CAAU,YACzE,gCAACM,GAAA,EAAoB,WAAU,uBAAsB,eAAa,GAAGN,CAAU,aAAc,CAAA,GAC/F;AAAA,UACC,CAAC,CAACzB,KACDpE,gBAAAA,EAAA;AAAA,YAACoG;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAa,GAAGP,CAAU;AAAA,cACzB,GAAID,KAAY,OAAOxB,KAAa,YAAY,EAAE,IAAI,OAAO;AAAA,cAE7D,UAAO,OAAAA,KAAa,WACnBpE,gBAAAA,EAAAA,IAACqG,GAAK,EAAA,MAAAV,GAAY,YAAW,SAAQ,SAASF,IAAa,eAAe,WACvE,UAAArB,GACH,IAEAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;AAEAkB,EAAS,cAAc;AACjB,MAAAgB,KAAkBC,EAA+BjB,CAAQ;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
|
|
1
|
+
{"version":3,"file":"checkbox.component-C0XdgZkr.js","sources":["../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js","../../node_modules/@ark-ui/react/dist/utils/use-controllable-state.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root-provider.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkmark/checkmark.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkbox/checkbox.js","../../src/components/Checkbox/checkbox.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxProvider, useCheckboxContext] = createContext({\n name: \"CheckboxContext\",\n hookName: \"useCheckboxContext\",\n providerName: \"<CheckboxProvider />\"\n});\n\nexport { CheckboxProvider, useCheckboxContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxControl = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nCheckboxControl.displayName = \"CheckboxControl\";\n\nexport { CheckboxControl };\n","'use client';\nimport { useState, useCallback } from 'react';\n\nfunction useControllableState(props) {\n const { value, onChange, defaultValue } = props;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const controlled = value !== void 0;\n const currentValue = controlled ? value : uncontrolledValue;\n const setValue = useCallback(\n (value2) => {\n if (controlled) {\n return onChange?.(value2);\n }\n setUncontrolledValue(value2);\n return onChange?.(value2);\n },\n [controlled, onChange]\n );\n return [currentValue, setValue];\n}\n\nexport { useControllableState };\n","'use client';\nimport { useControllableState } from '../../utils/use-controllable-state.js';\nimport { useEvent } from '../../utils/use-event.js';\n\nfunction useCheckboxGroup(props = {}) {\n const { defaultValue, value: controlledValue, onValueChange, disabled, readOnly, name, invalid } = props;\n const interactive = !(disabled || readOnly);\n const onChangeProp = useEvent(onValueChange, { sync: true });\n const [value, setValue] = useControllableState({\n value: controlledValue,\n defaultValue: defaultValue || [],\n onChange: onChangeProp\n });\n const isChecked = (val) => {\n return value.some((v) => String(v) === String(val));\n };\n const toggleValue = (val) => {\n isChecked(val) ? removeValue(val) : addValue(val);\n };\n const addValue = (val) => {\n if (!interactive) return;\n if (isChecked(val)) return;\n setValue(value.concat(val));\n };\n const removeValue = (val) => {\n if (!interactive) return;\n setValue(value.filter((v) => String(v) !== String(val)));\n };\n const getItemProps = (props2) => {\n return {\n checked: props2.value != null ? isChecked(props2.value) : void 0,\n onCheckedChange() {\n if (props2.value != null) {\n toggleValue(props2.value);\n }\n },\n name,\n disabled,\n readOnly,\n invalid\n };\n };\n return {\n isChecked,\n value,\n name,\n disabled: !!disabled,\n readOnly: !!readOnly,\n invalid: !!invalid,\n setValue,\n addValue,\n toggleValue,\n getItemProps\n };\n}\n\nexport { useCheckboxGroup };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({\n name: \"CheckboxGroupContext\",\n hookName: \"useCheckboxGroupContext\",\n providerName: \"<CheckboxGroupProvider />\",\n strict: false\n});\n\nexport { CheckboxGroupContextProvider, useCheckboxGroupContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { checkboxAnatomy } from './checkbox.anatomy.js';\nimport { useCheckboxGroup } from './use-checkbox-group.js';\nimport { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';\n\nconst CheckboxGroup = forwardRef((props, ref) => {\n const [checkboxGroupProps, localProps] = createSplitProps()(props, [\n \"defaultValue\",\n \"value\",\n \"onValueChange\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"name\"\n ]);\n const checkboxGroup = useCheckboxGroup(checkboxGroupProps);\n return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: checkboxGroup, children: /* @__PURE__ */ jsx(ark.div, { ref, role: \"group\", ...localProps, ...checkboxAnatomy.build().group.attrs }) });\n});\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { CheckboxGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxHiddenInput = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nCheckboxHiddenInput.displayName = \"CheckboxHiddenInput\";\n\nexport { CheckboxHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxLabel = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nCheckboxLabel.displayName = \"CheckboxLabel\";\n\nexport { CheckboxLabel };\n","'use client';\nimport * as checkbox from '@zag-js/checkbox';\nimport { mergeProps, useMachine, normalizeProps } from '@zag-js/react';\nimport { useMemo, useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxGroupContext } from './use-checkbox-group-context.js';\n\nconst useCheckbox = (ownProps = {}) => {\n const checkboxGroup = useCheckboxGroupContext();\n const field = useFieldContext();\n const props = useMemo(() => {\n return mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});\n }, [ownProps, checkboxGroup]);\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(checkbox.machine, machineProps);\n return checkbox.connect(service, normalizeProps);\n};\n\nexport { useCheckbox };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useCheckbox } from './use-checkbox.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRoot = forwardRef((props, ref) => {\n const [useCheckboxProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const checkbox = useCheckbox(useCheckboxProps);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRoot.displayName = \"CheckboxRoot\";\n\nexport { CheckboxRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRootProvider = forwardRef((props, ref) => {\n const [{ value: checkbox }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRootProvider.displayName = \"CheckboxRootProvider\";\n\nexport { CheckboxRootProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { EMPTY_STYLES } from '../../styled-system/empty.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\n\nconst Checkmark = forwardRef(\n function Checkmark2(props, ref) {\n const recipe = useRecipe({ key: \"checkmark\", recipe: props.recipe });\n const [variantProps, restProps] = recipe.splitVariantProps(props);\n const { checked, indeterminate, disabled, unstyled, children, ...rest } = restProps;\n const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"3px\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"data-state\": indeterminate ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(disabled),\n css: [styles, props.css],\n ...rest,\n children: indeterminate ? /* @__PURE__ */ jsx(\"path\", { d: \"M5 12h14\" }) : checked ? /* @__PURE__ */ jsx(\"polyline\", { points: \"20 6 9 17 4 12\" }) : null\n }\n );\n }\n);\n\nexport { Checkmark };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { Checkmark } from '../checkmark/checkmark.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useCheckboxStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"checkbox\" });\nconst CheckboxRootProvider = withProvider(Checkbox.RootProvider, \"root\", { forwardAsChild: true });\nconst CheckboxRoot = withProvider(\n Checkbox.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst CheckboxPropsProvider = PropsProvider;\nconst CheckboxLabel = withContext(\n Checkbox.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst CheckboxIndicator = forwardRef(function CheckboxIndicator2(props, ref) {\n const { checked, indeterminate, ...rest } = props;\n const api = useCheckboxContext();\n const styles = useCheckboxStyles();\n if (checked && api.checked) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: checked\n }\n );\n }\n if (indeterminate && api.indeterminate) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: indeterminate\n }\n );\n }\n return /* @__PURE__ */ jsx(\n Checkmark,\n {\n ref,\n checked: api.checked,\n indeterminate: api.indeterminate,\n disabled: api.disabled,\n unstyled: true,\n ...rest,\n css: [styles.indicator, props.css]\n }\n );\n});\nconst CheckboxControl = withContext(\n Checkbox.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CheckboxIndicator, {}) }\n }\n);\nconst CheckboxGroup = chakra(\n Checkbox.Group,\n {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1.5\"\n }\n },\n { forwardAsChild: true }\n);\nconst CheckboxContext = Checkbox.Context;\nconst CheckboxHiddenInput = Checkbox.HiddenInput;\n\nexport { CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxPropsProvider, CheckboxRoot, CheckboxRootProvider, useCheckboxStyles };\n","import React from 'react';\nimport { Checkbox as CCheckbox } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Text } from 'components/Text/text.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\nimport { CheckedChangeDetails, CheckedState } from './checkbox.types';\n\nexport interface CheckboxProps extends WithFormControlProps, Omit<CCheckbox.RootProps, 'onChange'> {\n /** Ref to the hidden input element. */\n checkboxRef?: React.Ref<HTMLInputElement | null>;\n /** Ref to the checkbox component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /** Size of the checkbox.\n * @default md\n */\n size?: FormControlSize;\n /**\n * If true, the checkbox will be wrapped in a Card component.\n * @default false\n */\n withCard?: boolean;\n /** Callback function when the checkbox value changes. */\n onCheckedChange?: (details: CheckedChangeDetails) => void;\n /** If true, the checkbox will be checked. Use `indeterminate` to show a checkbox with a dash in the middle. */\n checked?: CheckedState;\n /** Tooltip text to show when hovering over the checkbox input or label. */\n tooltipLabel?: string;\n /** Data test id for the checkbox.\n * @default kibble-checkbox\n */\n 'data-testid'?: string;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n checkboxRef,\n children,\n onContrast,\n rootRef,\n size = 'md',\n withCard = false,\n tooltipLabel,\n ['data-testid']: dataTestId = 'kibble-checkbox',\n ...rest\n },\n ref,\n ): React.ReactNode => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const checkboxContent = (\n <CCheckbox.Root\n className=\"Checkbox\"\n checked={rest.checked}\n data-testid={dataTestId}\n ref={rootRef}\n variant={_computedVariant}\n size={size}\n withCard={withCard}\n {...rest}\n >\n <CCheckbox.HiddenInput\n className=\"Checkbox__Input\"\n data-testid={`${dataTestId}-input`}\n ref={checkboxRef || ref}\n />\n <CCheckbox.Control className=\"Checkbox__Control\" data-testid={`${dataTestId}-control`}>\n <CCheckbox.Indicator className=\"Checkbox__Indicator\" data-testid={`${dataTestId}-indicator`} />\n </CCheckbox.Control>\n {!!children && (\n <CCheckbox.Label\n className=\"Checkbox__Label\"\n data-testid={`${dataTestId}-label`}\n {...(withCard && typeof children !== 'string' && { mt: '-4px' })}\n >\n {typeof children === 'string' ? (\n <Text size={size} lineHeight=\"unset\" variant={onContrast ? 'onContrast' : 'default'}>\n {children}\n </Text>\n ) : (\n children\n )}\n </CCheckbox.Label>\n )}\n </CCheckbox.Root>\n );\n\n if (tooltipLabel) {\n return (\n <Tooltip label={tooltipLabel} onContrast={onContrast} data-testid={`${dataTestId}-tooltip`}>\n {checkboxContent}\n </Tooltip>\n );\n }\n\n return checkboxContent;\n },\n);\n\nCheckbox.displayName = 'Checkbox';\nconst WrappedCheckbox = withFormControl<CheckboxProps>(Checkbox);\n\nexport { WrappedCheckbox as Checkbox };\n"],"names":["CheckboxProvider","useCheckboxContext","createContext","CheckboxControl","forwardRef","props","ref","checkbox","mergedProps","mergeProps","jsx","ark","useControllableState","value","onChange","defaultValue","uncontrolledValue","setUncontrolledValue","useState","controlled","currentValue","setValue","useCallback","value2","useCheckboxGroup","controlledValue","onValueChange","disabled","readOnly","name","invalid","interactive","onChangeProp","useEvent","isChecked","val","toggleValue","removeValue","addValue","props2","CheckboxGroupContextProvider","useCheckboxGroupContext","CheckboxGroup","checkboxGroupProps","localProps","createSplitProps","checkboxGroup","checkboxAnatomy","CheckboxHiddenInput","field","useFieldContext","CheckboxLabel","useCheckbox","ownProps","useMemo","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","checkbox.machine","checkbox.connect","normalizeProps","CheckboxRoot","useCheckboxProps","CheckboxRootProvider","Checkmark","recipe","useRecipe","variantProps","restProps","checked","indeterminate","unstyled","children","rest","styles","EMPTY_STYLES","chakra","dataAttr","withProvider","withContext","useCheckboxStyles","createSlotRecipeContext","Checkbox.RootProvider","Checkbox.Root","Checkbox.Label","CheckboxIndicator","api","Checkbox.Control","Checkbox.Group","Checkbox.HiddenInput","Checkbox","React","checkboxRef","onContrast","rootRef","size","withCard","tooltipLabel","dataTestId","_computedVariant","checkboxContent","jsxs","CCheckbox.Root","CCheckbox.HiddenInput","CCheckbox.Control","CCheckbox.Indicator","CCheckbox.Label","Text","Tooltip","WrappedCheckbox","withFormControl"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAkB,IAAIC,EAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAA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FormControl-BSlIlVY0.js"),O=require("./text.component-BDDz5KQP.js"),F=require("./tooltip.component-DBw-hAPU.js"),H=require("./create-slot-recipe-context-HXE1VazG.js"),m=require("./factory-a2SJjEvR.js"),M=require("./attr-BMs6szZx.js"),W=require("./empty-B5_AO6Pg.js"),D=require("./use-recipe-DaPWl_pL.js"),d=require("./use-locale-context-ym21RUxU.js"),R=require("./checkbox.anatomy-DM39E2Q9.js"),Y=require("./index-Ts8g8jZd.js"),b=require("./index-CQURjLlA.js"),P=require("./use-field-context-Cm29IQ7H.js"),B=o=>o&&o.__esModule?o:{default:o},U=B(l),[y,f]=d.createContext({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),E=l.forwardRef((o,t)=>{const e=f(),r=b.mergeProps(e.getControlProps(),o);return s.jsxRuntimeExports.jsx(d.ark.div,{...r,ref:t})});E.displayName="CheckboxControl";function z(o){const{value:t,onChange:e,defaultValue:r}=o,[n,i]=l.useState(r),c=t!==void 0,a=c?t:n,x=l.useCallback(h=>(c||i(h),e?.(h)),[c,e]);return[a,x]}function J(o={}){const{defaultValue:t,value:e,onValueChange:r,disabled:n,readOnly:i,name:c,invalid:a}=o,x=!(n||i),h=Y.useEvent(r,{sync:!0}),[k,p]=z({value:e,defaultValue:t||[],onChange:h}),C=u=>k.some(j=>String(j)===String(u)),v=u=>{C(u)?I(u):g(u)},g=u=>{x&&(C(u)||p(k.concat(u)))},I=u=>{x&&p(k.filter(j=>String(j)!==String(u)))};return{isChecked:C,value:k,name:c,disabled:!!n,readOnly:!!i,invalid:!!a,setValue:p,addValue:g,toggleValue:v,getItemProps:u=>({checked:u.value!=null?C(u.value):void 0,onCheckedChange(){u.value!=null&&v(u.value)},name:c,disabled:n,readOnly:i,invalid:a})}}const[K,Q]=d.createContext({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),q=l.forwardRef((o,t)=>{const[e,r]=d.createSplitProps()(o,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),n=J(e);return s.jsxRuntimeExports.jsx(K,{value:n,children:s.jsxRuntimeExports.jsx(d.ark.div,{ref:t,role:"group",...r,...R.checkboxAnatomy.build().group.attrs})})});q.displayName="CheckboxGroup";const _=l.forwardRef((o,t)=>{const e=f(),r=b.mergeProps(e.getHiddenInputProps(),o),n=P.useFieldContext();return s.jsxRuntimeExports.jsx(d.ark.input,{"aria-describedby":n?.ariaDescribedby,...r,ref:t})});_.displayName="CheckboxHiddenInput";const N=l.forwardRef((o,t)=>{const e=f(),r=b.mergeProps(e.getLabelProps(),o);return s.jsxRuntimeExports.jsx(d.ark.span,{...r,ref:t})});N.displayName="CheckboxLabel";const X=(o={})=>{const t=Q(),e=P.useFieldContext(),r=l.useMemo(()=>b.mergeProps(o,t?.getItemProps({value:o.value})??{}),[o,t]),n=l.useId(),{getRootNode:i}=d.useEnvironmentContext(),{dir:c}=d.useLocaleContext(),a={id:n,ids:{label:e?.ids.label,hiddenInput:e?.ids.control},dir:c,disabled:e?.disabled,readOnly:e?.readOnly,invalid:e?.invalid,required:e?.required,getRootNode:i,...r},x=d.useMachine(R.machine,a);return R.connect(x,d.normalizeProps)},V=l.forwardRef((o,t)=>{const[e,r]=d.createSplitProps()(o,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),n=X(e),i=b.mergeProps(n.getRootProps(),r);return s.jsxRuntimeExports.jsx(y,{value:n,children:s.jsxRuntimeExports.jsx(d.ark.label,{...i,ref:t})})});V.displayName="CheckboxRoot";const w=l.forwardRef((o,t)=>{const[{value:e},r]=d.createSplitProps()(o,["value"]),n=b.mergeProps(e.getRootProps(),r);return s.jsxRuntimeExports.jsx(y,{value:e,children:s.jsxRuntimeExports.jsx(d.ark.label,{...n,ref:t})})});w.displayName="CheckboxRootProvider";const Z=l.forwardRef(function(t,e){const r=D.useRecipe({key:"checkmark",recipe:t.recipe}),[n,i]=r.splitVariantProps(t),{checked:c,indeterminate:a,disabled:x,unstyled:h,children:k,...p}=i,C=h?W.EMPTY_STYLES:r(n);return s.jsxRuntimeExports.jsx(m.chakra.svg,{ref:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3px",strokeLinecap:"round",strokeLinejoin:"round","data-state":a?"indeterminate":c?"checked":"unchecked","data-disabled":M.dataAttr(x),css:[C,t.css],...p,children:a?s.jsxRuntimeExports.jsx("path",{d:"M5 12h14"}):c?s.jsxRuntimeExports.jsx("polyline",{points:"20 6 9 17 4 12"}):null})}),{withProvider:S,withContext:G,useStyles:T}=H.createSlotRecipeContext({key:"checkbox"});S(w,"root",{forwardAsChild:!0});const ee=S(V,"root",{forwardAsChild:!0}),te=G(N,"label",{forwardAsChild:!0}),$=l.forwardRef(function(t,e){const{checked:r,indeterminate:n,...i}=t,c=f(),a=T();return r&&c.checked?s.jsxRuntimeExports.jsx(m.chakra.svg,{ref:e,asChild:!0,...i,css:[a.indicator,t.css],children:r}):n&&c.indeterminate?s.jsxRuntimeExports.jsx(m.chakra.svg,{ref:e,asChild:!0,...i,css:[a.indicator,t.css],children:n}):s.jsxRuntimeExports.jsx(Z,{ref:e,checked:c.checked,indeterminate:c.indeterminate,disabled:c.disabled,unstyled:!0,...i,css:[a.indicator,t.css]})}),oe=G(E,"control",{forwardAsChild:!0,defaultProps:{children:s.jsxRuntimeExports.jsx($,{})}}),re=m.chakra(q,{base:{display:"flex",flexDirection:"column",gap:"1.5"}},{forwardAsChild:!0}),ne=_,L=U.default.forwardRef(({checkboxRef:o,children:t,onContrast:e,rootRef:r,size:n="md",withCard:i=!1,tooltipLabel:c,["data-testid"]:a="kibble-checkbox",...x},h)=>{const k=e?"onContrast":"default",p=s.jsxRuntimeExports.jsxs(ee,{className:"Checkbox",checked:x.checked,"data-testid":a,ref:r,variant:k,size:n,withCard:i,...x,children:[s.jsxRuntimeExports.jsx(ne,{className:"Checkbox__Input","data-testid":`${a}-input`,ref:o||h}),s.jsxRuntimeExports.jsx(oe,{className:"Checkbox__Control","data-testid":`${a}-control`,children:s.jsxRuntimeExports.jsx($,{className:"Checkbox__Indicator","data-testid":`${a}-indicator`})}),!!t&&s.jsxRuntimeExports.jsx(te,{className:"Checkbox__Label","data-testid":`${a}-label`,...i&&typeof t!="string"&&{mt:"-4px"},children:typeof t=="string"?s.jsxRuntimeExports.jsx(O.WrappedText,{size:n,lineHeight:"unset",variant:e?"onContrast":"default",children:t}):t})]});return c?s.jsxRuntimeExports.jsx(F.Tooltip,{label:c,onContrast:e,"data-testid":`${a}-tooltip`,children:p}):p});L.displayName="Checkbox";const se=A.withFormControl(L);exports.CheckboxGroup=re;exports.WrappedCheckbox=se;
|
|
2
|
+
//# sourceMappingURL=checkbox.component-DdOVYSSc.js.map
|
package/dist/chunks/{checkbox.component-C_Ytpxgh.js.map → checkbox.component-DdOVYSSc.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component-C_Ytpxgh.js","sources":["../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js","../../node_modules/@ark-ui/react/dist/utils/use-controllable-state.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root-provider.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkmark/checkmark.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkbox/checkbox.js","../../src/components/Checkbox/checkbox.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxProvider, useCheckboxContext] = createContext({\n name: \"CheckboxContext\",\n hookName: \"useCheckboxContext\",\n providerName: \"<CheckboxProvider />\"\n});\n\nexport { CheckboxProvider, useCheckboxContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxControl = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nCheckboxControl.displayName = \"CheckboxControl\";\n\nexport { CheckboxControl };\n","'use client';\nimport { useState, useCallback } from 'react';\n\nfunction useControllableState(props) {\n const { value, onChange, defaultValue } = props;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const controlled = value !== void 0;\n const currentValue = controlled ? value : uncontrolledValue;\n const setValue = useCallback(\n (value2) => {\n if (controlled) {\n return onChange?.(value2);\n }\n setUncontrolledValue(value2);\n return onChange?.(value2);\n },\n [controlled, onChange]\n );\n return [currentValue, setValue];\n}\n\nexport { useControllableState };\n","'use client';\nimport { useControllableState } from '../../utils/use-controllable-state.js';\nimport { useEvent } from '../../utils/use-event.js';\n\nfunction useCheckboxGroup(props = {}) {\n const { defaultValue, value: controlledValue, onValueChange, disabled, readOnly, name, invalid } = props;\n const interactive = !(disabled || readOnly);\n const onChangeProp = useEvent(onValueChange, { sync: true });\n const [value, setValue] = useControllableState({\n value: controlledValue,\n defaultValue: defaultValue || [],\n onChange: onChangeProp\n });\n const isChecked = (val) => {\n return value.some((v) => String(v) === String(val));\n };\n const toggleValue = (val) => {\n isChecked(val) ? removeValue(val) : addValue(val);\n };\n const addValue = (val) => {\n if (!interactive) return;\n if (isChecked(val)) return;\n setValue(value.concat(val));\n };\n const removeValue = (val) => {\n if (!interactive) return;\n setValue(value.filter((v) => String(v) !== String(val)));\n };\n const getItemProps = (props2) => {\n return {\n checked: props2.value != null ? isChecked(props2.value) : void 0,\n onCheckedChange() {\n if (props2.value != null) {\n toggleValue(props2.value);\n }\n },\n name,\n disabled,\n readOnly,\n invalid\n };\n };\n return {\n isChecked,\n value,\n name,\n disabled: !!disabled,\n readOnly: !!readOnly,\n invalid: !!invalid,\n setValue,\n addValue,\n toggleValue,\n getItemProps\n };\n}\n\nexport { useCheckboxGroup };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({\n name: \"CheckboxGroupContext\",\n hookName: \"useCheckboxGroupContext\",\n providerName: \"<CheckboxGroupProvider />\",\n strict: false\n});\n\nexport { CheckboxGroupContextProvider, useCheckboxGroupContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { checkboxAnatomy } from './checkbox.anatomy.js';\nimport { useCheckboxGroup } from './use-checkbox-group.js';\nimport { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';\n\nconst CheckboxGroup = forwardRef((props, ref) => {\n const [checkboxGroupProps, localProps] = createSplitProps()(props, [\n \"defaultValue\",\n \"value\",\n \"onValueChange\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"name\"\n ]);\n const checkboxGroup = useCheckboxGroup(checkboxGroupProps);\n return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: checkboxGroup, children: /* @__PURE__ */ jsx(ark.div, { ref, role: \"group\", ...localProps, ...checkboxAnatomy.build().group.attrs }) });\n});\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { CheckboxGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxHiddenInput = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nCheckboxHiddenInput.displayName = \"CheckboxHiddenInput\";\n\nexport { CheckboxHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxLabel = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nCheckboxLabel.displayName = \"CheckboxLabel\";\n\nexport { CheckboxLabel };\n","'use client';\nimport * as checkbox from '@zag-js/checkbox';\nimport { mergeProps, useMachine, normalizeProps } from '@zag-js/react';\nimport { useMemo, useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxGroupContext } from './use-checkbox-group-context.js';\n\nconst useCheckbox = (ownProps = {}) => {\n const checkboxGroup = useCheckboxGroupContext();\n const field = useFieldContext();\n const props = useMemo(() => {\n return mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});\n }, [ownProps, checkboxGroup]);\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(checkbox.machine, machineProps);\n return checkbox.connect(service, normalizeProps);\n};\n\nexport { useCheckbox };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useCheckbox } from './use-checkbox.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRoot = forwardRef((props, ref) => {\n const [useCheckboxProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const checkbox = useCheckbox(useCheckboxProps);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRoot.displayName = \"CheckboxRoot\";\n\nexport { CheckboxRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRootProvider = forwardRef((props, ref) => {\n const [{ value: checkbox }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRootProvider.displayName = \"CheckboxRootProvider\";\n\nexport { CheckboxRootProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { EMPTY_STYLES } from '../../styled-system/empty.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\n\nconst Checkmark = forwardRef(\n function Checkmark2(props, ref) {\n const recipe = useRecipe({ key: \"checkmark\", recipe: props.recipe });\n const [variantProps, restProps] = recipe.splitVariantProps(props);\n const { checked, indeterminate, disabled, unstyled, children, ...rest } = restProps;\n const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"3px\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"data-state\": indeterminate ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(disabled),\n css: [styles, props.css],\n ...rest,\n children: indeterminate ? /* @__PURE__ */ jsx(\"path\", { d: \"M5 12h14\" }) : checked ? /* @__PURE__ */ jsx(\"polyline\", { points: \"20 6 9 17 4 12\" }) : null\n }\n );\n }\n);\n\nexport { Checkmark };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { Checkmark } from '../checkmark/checkmark.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useCheckboxStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"checkbox\" });\nconst CheckboxRootProvider = withProvider(Checkbox.RootProvider, \"root\", { forwardAsChild: true });\nconst CheckboxRoot = withProvider(\n Checkbox.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst CheckboxPropsProvider = PropsProvider;\nconst CheckboxLabel = withContext(\n Checkbox.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst CheckboxIndicator = forwardRef(function CheckboxIndicator2(props, ref) {\n const { checked, indeterminate, ...rest } = props;\n const api = useCheckboxContext();\n const styles = useCheckboxStyles();\n if (checked && api.checked) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: checked\n }\n );\n }\n if (indeterminate && api.indeterminate) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: indeterminate\n }\n );\n }\n return /* @__PURE__ */ jsx(\n Checkmark,\n {\n ref,\n checked: api.checked,\n indeterminate: api.indeterminate,\n disabled: api.disabled,\n unstyled: true,\n ...rest,\n css: [styles.indicator, props.css]\n }\n );\n});\nconst CheckboxControl = withContext(\n Checkbox.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CheckboxIndicator, {}) }\n }\n);\nconst CheckboxGroup = chakra(\n Checkbox.Group,\n {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1.5\"\n }\n },\n { forwardAsChild: true }\n);\nconst CheckboxContext = Checkbox.Context;\nconst CheckboxHiddenInput = Checkbox.HiddenInput;\n\nexport { CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxPropsProvider, CheckboxRoot, CheckboxRootProvider, useCheckboxStyles };\n","import React from 'react';\nimport { Checkbox as CCheckbox } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Text } from 'components/Text/text.component';\nimport { CheckedChangeDetails, CheckedState } from './checkbox.types';\n\nexport interface CheckboxProps extends WithFormControlProps, Omit<CCheckbox.RootProps, 'onChange'> {\n /** Ref to the hidden input element. */\n checkboxRef?: React.Ref<HTMLInputElement | null>;\n /** Ref to the checkbox component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /** Size of the checkbox.\n * @default md\n */\n size?: FormControlSize;\n /**\n * If true, the checkbox will be wrapped in a Card component.\n * @default false\n */\n withCard?: boolean;\n /** Callback function when the checkbox value changes. */\n onCheckedChange?: (details: CheckedChangeDetails) => void;\n /** If true, the checkbox will be checked. Use `indeterminate` to show a checkbox with a dash in the middle. */\n checked?: CheckedState;\n /** Data test id for the checkbox.\n * @default kibble-checkbox\n */\n 'data-testid'?: string;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n checkboxRef,\n children,\n onContrast,\n rootRef,\n size = 'md',\n withCard = false,\n ['data-testid']: dataTestId = 'kibble-checkbox',\n ...rest\n },\n ref,\n ): React.ReactNode => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n return (\n <CCheckbox.Root\n className=\"Checkbox\"\n checked={rest.checked}\n data-testid={dataTestId}\n ref={rootRef}\n variant={_computedVariant}\n size={size}\n withCard={withCard}\n {...rest}\n >\n <CCheckbox.HiddenInput\n className=\"Checkbox__Input\"\n data-testid={`${dataTestId}-input`}\n ref={checkboxRef || ref}\n />\n <CCheckbox.Control className=\"Checkbox__Control\" data-testid={`${dataTestId}-control`}>\n <CCheckbox.Indicator className=\"Checkbox__Indicator\" data-testid={`${dataTestId}-indicator`} />\n </CCheckbox.Control>\n {!!children && (\n <CCheckbox.Label\n className=\"Checkbox__Label\"\n data-testid={`${dataTestId}-label`}\n {...(withCard && typeof children !== 'string' && { mt: '-4px' })}\n >\n {typeof children === 'string' ? (\n <Text size={size} lineHeight=\"unset\" variant={onContrast ? 'onContrast' : 'default'}>\n {children}\n </Text>\n ) : (\n children\n )}\n </CCheckbox.Label>\n )}\n </CCheckbox.Root>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\nconst WrappedCheckbox = withFormControl<CheckboxProps>(Checkbox);\n\nexport { WrappedCheckbox as Checkbox };\n"],"names":["CheckboxProvider","useCheckboxContext","createContext","CheckboxControl","forwardRef","props","ref","checkbox","mergedProps","mergeProps","jsx","ark","useControllableState","value","onChange","defaultValue","uncontrolledValue","setUncontrolledValue","useState","controlled","currentValue","setValue","useCallback","value2","useCheckboxGroup","controlledValue","onValueChange","disabled","readOnly","name","invalid","interactive","onChangeProp","useEvent","isChecked","val","v","toggleValue","removeValue","addValue","props2","CheckboxGroupContextProvider","useCheckboxGroupContext","CheckboxGroup","checkboxGroupProps","localProps","createSplitProps","checkboxGroup","checkboxAnatomy","CheckboxHiddenInput","field","useFieldContext","CheckboxLabel","useCheckbox","ownProps","useMemo","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","checkbox.machine","checkbox.connect","normalizeProps","CheckboxRoot","useCheckboxProps","CheckboxRootProvider","Checkmark","recipe","useRecipe","variantProps","restProps","checked","indeterminate","unstyled","children","rest","styles","EMPTY_STYLES","chakra","dataAttr","withProvider","withContext","useCheckboxStyles","createSlotRecipeContext","Checkbox.RootProvider","Checkbox.Root","Checkbox.Label","CheckboxIndicator","api","Checkbox.Control","Checkbox.Group","Checkbox.HiddenInput","Checkbox","React","checkboxRef","onContrast","rootRef","size","withCard","dataTestId","_computedVariant","jsxs","CCheckbox.Root","CCheckbox.HiddenInput","CCheckbox.Control","CCheckbox.Indicator","CCheckbox.Label","Text","WrappedCheckbox","withFormControl"],"mappings":"qlBAGM,CAACA,EAAkBC,CAAkB,EAAIC,gBAAc,CAC3D,KAAM,kBACN,SAAU,qBACV,aAAc,sBAChB,CAAC,ECAKC,EAAkBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACjD,MAAMC,EAAWN,EAAoB,EAC/BO,EAAcC,EAAU,WAACF,EAAS,gBAAe,EAAIF,CAAK,EAChE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,IAAK,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC7D,CAAC,EACDH,EAAgB,YAAc,kBCT9B,SAASS,EAAqBP,EAAO,CACnC,KAAM,CAAE,MAAAQ,EAAO,SAAAC,EAAU,aAAAC,CAAc,EAAGV,EACpC,CAACW,EAAmBC,CAAoB,EAAIC,EAAAA,SAASH,CAAY,EACjEI,EAAaN,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AmBL,EAAa,aAAe,UAGnD,OAAAM,EAAA,kBAAA,KAACC,EAAA,CACC,UAAU,WACV,QAAS3B,EAAK,QACd,cAAawB,EACb,IAAKH,EACL,QAASI,EACT,KAAAH,EACA,SAAAC,EACC,GAAGvB,EAEJ,SAAA,CAAAtE,EAAA,kBAAA,IAACkG,GAAA,CACC,UAAU,kBACV,cAAa,GAAGJ,CAAU,SAC1B,IAAKL,GAAe7F,CAAA,CACtB,EACAI,wBAACmG,GAAA,CAAkB,UAAU,oBAAoB,cAAa,GAAGL,CAAU,WACzE,iCAACM,EAAA,CAAoB,UAAU,sBAAsB,cAAa,GAAGN,CAAU,YAAc,CAAA,EAC/F,EACC,CAAC,CAACzB,GACDrE,EAAA,kBAAA,IAACqG,GAAA,CACC,UAAU,kBACV,cAAa,GAAGP,CAAU,SACzB,GAAID,GAAY,OAAOxB,GAAa,UAAY,CAAE,GAAI,MAAO,EAE7D,SAAO,OAAAA,GAAa,SACnBrE,EAAAA,kBAAAA,IAACsG,EAAAA,YAAK,CAAA,KAAAV,EAAY,WAAW,QAAQ,QAASF,EAAa,aAAe,UACvE,SAAArB,EACH,EAEAA,CAAA,CAAA,CAEJ,CAAA,CAEJ,CAAA,CAGN,EAEAkB,EAAS,YAAc,WACjB,MAAAgB,GAAkBC,kBAA+BjB,CAAQ","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
|
|
1
|
+
{"version":3,"file":"checkbox.component-DdOVYSSc.js","sources":["../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js","../../node_modules/@ark-ui/react/dist/utils/use-controllable-state.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group-context.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js","../../node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js","../../node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root-provider.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkmark/checkmark.js","../../node_modules/@chakra-ui/react/dist/esm/components/checkbox/checkbox.js","../../src/components/Checkbox/checkbox.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxProvider, useCheckboxContext] = createContext({\n name: \"CheckboxContext\",\n hookName: \"useCheckboxContext\",\n providerName: \"<CheckboxProvider />\"\n});\n\nexport { CheckboxProvider, useCheckboxContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxControl = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nCheckboxControl.displayName = \"CheckboxControl\";\n\nexport { CheckboxControl };\n","'use client';\nimport { useState, useCallback } from 'react';\n\nfunction useControllableState(props) {\n const { value, onChange, defaultValue } = props;\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const controlled = value !== void 0;\n const currentValue = controlled ? value : uncontrolledValue;\n const setValue = useCallback(\n (value2) => {\n if (controlled) {\n return onChange?.(value2);\n }\n setUncontrolledValue(value2);\n return onChange?.(value2);\n },\n [controlled, onChange]\n );\n return [currentValue, setValue];\n}\n\nexport { useControllableState };\n","'use client';\nimport { useControllableState } from '../../utils/use-controllable-state.js';\nimport { useEvent } from '../../utils/use-event.js';\n\nfunction useCheckboxGroup(props = {}) {\n const { defaultValue, value: controlledValue, onValueChange, disabled, readOnly, name, invalid } = props;\n const interactive = !(disabled || readOnly);\n const onChangeProp = useEvent(onValueChange, { sync: true });\n const [value, setValue] = useControllableState({\n value: controlledValue,\n defaultValue: defaultValue || [],\n onChange: onChangeProp\n });\n const isChecked = (val) => {\n return value.some((v) => String(v) === String(val));\n };\n const toggleValue = (val) => {\n isChecked(val) ? removeValue(val) : addValue(val);\n };\n const addValue = (val) => {\n if (!interactive) return;\n if (isChecked(val)) return;\n setValue(value.concat(val));\n };\n const removeValue = (val) => {\n if (!interactive) return;\n setValue(value.filter((v) => String(v) !== String(val)));\n };\n const getItemProps = (props2) => {\n return {\n checked: props2.value != null ? isChecked(props2.value) : void 0,\n onCheckedChange() {\n if (props2.value != null) {\n toggleValue(props2.value);\n }\n },\n name,\n disabled,\n readOnly,\n invalid\n };\n };\n return {\n isChecked,\n value,\n name,\n disabled: !!disabled,\n readOnly: !!readOnly,\n invalid: !!invalid,\n setValue,\n addValue,\n toggleValue,\n getItemProps\n };\n}\n\nexport { useCheckboxGroup };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({\n name: \"CheckboxGroupContext\",\n hookName: \"useCheckboxGroupContext\",\n providerName: \"<CheckboxGroupProvider />\",\n strict: false\n});\n\nexport { CheckboxGroupContextProvider, useCheckboxGroupContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { checkboxAnatomy } from './checkbox.anatomy.js';\nimport { useCheckboxGroup } from './use-checkbox-group.js';\nimport { CheckboxGroupContextProvider } from './use-checkbox-group-context.js';\n\nconst CheckboxGroup = forwardRef((props, ref) => {\n const [checkboxGroupProps, localProps] = createSplitProps()(props, [\n \"defaultValue\",\n \"value\",\n \"onValueChange\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"name\"\n ]);\n const checkboxGroup = useCheckboxGroup(checkboxGroupProps);\n return /* @__PURE__ */ jsx(CheckboxGroupContextProvider, { value: checkboxGroup, children: /* @__PURE__ */ jsx(ark.div, { ref, role: \"group\", ...localProps, ...checkboxAnatomy.build().group.attrs }) });\n});\nCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { CheckboxGroup };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxHiddenInput = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nCheckboxHiddenInput.displayName = \"CheckboxHiddenInput\";\n\nexport { CheckboxHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useCheckboxContext } from './use-checkbox-context.js';\n\nconst CheckboxLabel = forwardRef((props, ref) => {\n const checkbox = useCheckboxContext();\n const mergedProps = mergeProps(checkbox.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nCheckboxLabel.displayName = \"CheckboxLabel\";\n\nexport { CheckboxLabel };\n","'use client';\nimport * as checkbox from '@zag-js/checkbox';\nimport { mergeProps, useMachine, normalizeProps } from '@zag-js/react';\nimport { useMemo, useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useCheckboxGroupContext } from './use-checkbox-group-context.js';\n\nconst useCheckbox = (ownProps = {}) => {\n const checkboxGroup = useCheckboxGroupContext();\n const field = useFieldContext();\n const props = useMemo(() => {\n return mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});\n }, [ownProps, checkboxGroup]);\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(checkbox.machine, machineProps);\n return checkbox.connect(service, normalizeProps);\n};\n\nexport { useCheckbox };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useCheckbox } from './use-checkbox.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRoot = forwardRef((props, ref) => {\n const [useCheckboxProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const checkbox = useCheckbox(useCheckboxProps);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRoot.displayName = \"CheckboxRoot\";\n\nexport { CheckboxRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { CheckboxProvider } from './use-checkbox-context.js';\n\nconst CheckboxRootProvider = forwardRef((props, ref) => {\n const [{ value: checkbox }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(checkbox.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(CheckboxProvider, { value: checkbox, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nCheckboxRootProvider.displayName = \"CheckboxRootProvider\";\n\nexport { CheckboxRootProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { EMPTY_STYLES } from '../../styled-system/empty.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { useRecipe } from '../../styled-system/use-recipe.js';\n\nconst Checkmark = forwardRef(\n function Checkmark2(props, ref) {\n const recipe = useRecipe({ key: \"checkmark\", recipe: props.recipe });\n const [variantProps, restProps] = recipe.splitVariantProps(props);\n const { checked, indeterminate, disabled, unstyled, children, ...rest } = restProps;\n const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"3px\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"data-state\": indeterminate ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\",\n \"data-disabled\": dataAttr(disabled),\n css: [styles, props.css],\n ...rest,\n children: indeterminate ? /* @__PURE__ */ jsx(\"path\", { d: \"M5 12h14\" }) : checked ? /* @__PURE__ */ jsx(\"polyline\", { points: \"20 6 9 17 4 12\" }) : null\n }\n );\n }\n);\n\nexport { Checkmark };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';\nimport { forwardRef } from 'react';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { Checkmark } from '../checkmark/checkmark.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useCheckboxStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"checkbox\" });\nconst CheckboxRootProvider = withProvider(Checkbox.RootProvider, \"root\", { forwardAsChild: true });\nconst CheckboxRoot = withProvider(\n Checkbox.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst CheckboxPropsProvider = PropsProvider;\nconst CheckboxLabel = withContext(\n Checkbox.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst CheckboxIndicator = forwardRef(function CheckboxIndicator2(props, ref) {\n const { checked, indeterminate, ...rest } = props;\n const api = useCheckboxContext();\n const styles = useCheckboxStyles();\n if (checked && api.checked) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: checked\n }\n );\n }\n if (indeterminate && api.indeterminate) {\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n asChild: true,\n ...rest,\n css: [styles.indicator, props.css],\n children: indeterminate\n }\n );\n }\n return /* @__PURE__ */ jsx(\n Checkmark,\n {\n ref,\n checked: api.checked,\n indeterminate: api.indeterminate,\n disabled: api.disabled,\n unstyled: true,\n ...rest,\n css: [styles.indicator, props.css]\n }\n );\n});\nconst CheckboxControl = withContext(\n Checkbox.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(CheckboxIndicator, {}) }\n }\n);\nconst CheckboxGroup = chakra(\n Checkbox.Group,\n {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1.5\"\n }\n },\n { forwardAsChild: true }\n);\nconst CheckboxContext = Checkbox.Context;\nconst CheckboxHiddenInput = Checkbox.HiddenInput;\n\nexport { CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxPropsProvider, CheckboxRoot, CheckboxRootProvider, useCheckboxStyles };\n","import React from 'react';\nimport { Checkbox as CCheckbox } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\nimport { Text } from 'components/Text/text.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\nimport { CheckedChangeDetails, CheckedState } from './checkbox.types';\n\nexport interface CheckboxProps extends WithFormControlProps, Omit<CCheckbox.RootProps, 'onChange'> {\n /** Ref to the hidden input element. */\n checkboxRef?: React.Ref<HTMLInputElement | null>;\n /** Ref to the checkbox component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /** Size of the checkbox.\n * @default md\n */\n size?: FormControlSize;\n /**\n * If true, the checkbox will be wrapped in a Card component.\n * @default false\n */\n withCard?: boolean;\n /** Callback function when the checkbox value changes. */\n onCheckedChange?: (details: CheckedChangeDetails) => void;\n /** If true, the checkbox will be checked. Use `indeterminate` to show a checkbox with a dash in the middle. */\n checked?: CheckedState;\n /** Tooltip text to show when hovering over the checkbox input or label. */\n tooltipLabel?: string;\n /** Data test id for the checkbox.\n * @default kibble-checkbox\n */\n 'data-testid'?: string;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n checkboxRef,\n children,\n onContrast,\n rootRef,\n size = 'md',\n withCard = false,\n tooltipLabel,\n ['data-testid']: dataTestId = 'kibble-checkbox',\n ...rest\n },\n ref,\n ): React.ReactNode => {\n const _computedVariant = onContrast ? 'onContrast' : 'default';\n\n const checkboxContent = (\n <CCheckbox.Root\n className=\"Checkbox\"\n checked={rest.checked}\n data-testid={dataTestId}\n ref={rootRef}\n variant={_computedVariant}\n size={size}\n withCard={withCard}\n {...rest}\n >\n <CCheckbox.HiddenInput\n className=\"Checkbox__Input\"\n data-testid={`${dataTestId}-input`}\n ref={checkboxRef || ref}\n />\n <CCheckbox.Control className=\"Checkbox__Control\" data-testid={`${dataTestId}-control`}>\n <CCheckbox.Indicator className=\"Checkbox__Indicator\" data-testid={`${dataTestId}-indicator`} />\n </CCheckbox.Control>\n {!!children && (\n <CCheckbox.Label\n className=\"Checkbox__Label\"\n data-testid={`${dataTestId}-label`}\n {...(withCard && typeof children !== 'string' && { mt: '-4px' })}\n >\n {typeof children === 'string' ? (\n <Text size={size} lineHeight=\"unset\" variant={onContrast ? 'onContrast' : 'default'}>\n {children}\n </Text>\n ) : (\n children\n )}\n </CCheckbox.Label>\n )}\n </CCheckbox.Root>\n );\n\n if (tooltipLabel) {\n return (\n <Tooltip label={tooltipLabel} onContrast={onContrast} data-testid={`${dataTestId}-tooltip`}>\n {checkboxContent}\n </Tooltip>\n );\n }\n\n return checkboxContent;\n },\n);\n\nCheckbox.displayName = 'Checkbox';\nconst WrappedCheckbox = withFormControl<CheckboxProps>(Checkbox);\n\nexport { WrappedCheckbox as Checkbox };\n"],"names":["CheckboxProvider","useCheckboxContext","createContext","CheckboxControl","forwardRef","props","ref","checkbox","mergedProps","mergeProps","jsx","ark","useControllableState","value","onChange","defaultValue","uncontrolledValue","setUncontrolledValue","useState","controlled","currentValue","setValue","useCallback","value2","useCheckboxGroup","controlledValue","onValueChange","disabled","readOnly","name","invalid","interactive","onChangeProp","useEvent","isChecked","val","v","toggleValue","removeValue","addValue","props2","CheckboxGroupContextProvider","useCheckboxGroupContext","CheckboxGroup","checkboxGroupProps","localProps","createSplitProps","checkboxGroup","checkboxAnatomy","CheckboxHiddenInput","field","useFieldContext","CheckboxLabel","useCheckbox","ownProps","useMemo","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","checkbox.machine","checkbox.connect","normalizeProps","CheckboxRoot","useCheckboxProps","CheckboxRootProvider","Checkmark","recipe","useRecipe","variantProps","restProps","checked","indeterminate","unstyled","children","rest","styles","EMPTY_STYLES","chakra","dataAttr","withProvider","withContext","useCheckboxStyles","createSlotRecipeContext","Checkbox.RootProvider","Checkbox.Root","Checkbox.Label","CheckboxIndicator","api","Checkbox.Control","Checkbox.Group","Checkbox.HiddenInput","Checkbox","React","checkboxRef","onContrast","rootRef","size","withCard","tooltipLabel","dataTestId","_computedVariant","checkboxContent","jsxs","CCheckbox.Root","CCheckbox.HiddenInput","CCheckbox.Control","CCheckbox.Indic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Y,WAAW,QAAQ,QAASF,EAAa,aAAe,UACvE,SAAArB,EACH,EAEAA,CAAA,CAAA,CAEJ,CAAA,CAEJ,EAGF,OAAIyB,EAEA9F,EAAA,kBAAA,IAACyG,WAAQ,MAAOX,EAAc,WAAAJ,EAAwB,cAAa,GAAGK,CAAU,WAC7E,SACHE,CAAA,CAAA,EAIGA,CAAA,CAEX,EAEAV,EAAS,YAAc,WACjB,MAAAmB,GAAkBC,kBAA+BpB,CAAQ","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12]}
|
package/dist/chunks/{checkboxGroup.component-ByawKeXH.js → checkboxGroup.component-CvHKP7gd.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("./jsx-runtime-BjDatQAs.js"),G=require("./withFormControl-BSlIlVY0.js"),c=require("./checkbox.component-
|
|
2
|
-
//# sourceMappingURL=checkboxGroup.component-
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-BjDatQAs.js"),G=require("./withFormControl-BSlIlVY0.js"),c=require("./checkbox.component-DdOVYSSc.js"),q=require("./stack-BE-r1yqU.js"),i=({checkboxes:n,defaultValue:r,direction:t="column",disabled:u,invalid:p,onContrast:x,onValueChange:h,readOnly:d,required:a,name:k,size:l="md",value:s,gap:m=2,["data-testid"]:b="kibble-checkbox-group",...C})=>o.jsxRuntimeExports.jsx(c.CheckboxGroup,{className:"CheckboxGroup","data-testid":b,disabled:u,invalid:p,name:k,defaultValue:r,value:s,onValueChange:h,width:"inherit",children:o.jsxRuntimeExports.jsx(q.Stack,{direction:t,gap:m,...C,children:n.map((e,j)=>o.jsxRuntimeExports.jsx(c.WrappedCheckbox,{onContrast:x,checked:e.checked||r?.includes(`${e?.value}`)||s?.includes(`${e?.value}`),size:l,required:a,readOnly:d,...t==="row"&&{fullWidth:!1},...e},`checkbox-${j}`))})});i.displayName="CheckboxGroup";const w=G.withFormControl(i);exports.WrappedCheckboxGroup=w;
|
|
2
|
+
//# sourceMappingURL=checkboxGroup.component-CvHKP7gd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkboxGroup.component-
|
|
1
|
+
{"version":3,"file":"checkboxGroup.component-CvHKP7gd.js","sources":["../../src/components/CheckboxGroup/checkboxGroup.component.tsx"],"sourcesContent":["import React from 'react';\nimport { CheckboxGroup as CCheckboxGroup, CheckboxGroupProps as CCheckboxGroupProps } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FlexDirection } from 'shared/types/alignment';\nimport { Checkbox, CheckboxProps } from 'components/Checkbox/checkbox.component';\nimport { Stack } from '@chakra-ui/react/stack';\nimport { ConditionalValue } from '@chakra-ui/react/styled-system';\n\nexport interface KCheckboxGroupProps extends WithFormControlProps {\n /** An array of Checkbox props to be rendered inside the group. */\n checkboxes: CheckboxProps[];\n /**\n * The direction to stack the checkboxes.\n * @default column\n */\n direction?: ConditionalValue<FlexDirection>;\n /** Callback function triggered when the value changes. */\n onValueChange?: (value: string[]) => void;\n /** Data test id for the checkbox group.\n * @default kibble-checkbox-group\n */\n 'data-testid'?: string;\n}\n\nexport type CheckboxGroupProps = KCheckboxGroupProps & Omit<CCheckboxGroupProps, 'onChange'>;\n\nconst CheckboxGroup = ({\n checkboxes,\n defaultValue,\n direction = 'column',\n disabled,\n invalid,\n onContrast,\n onValueChange,\n readOnly,\n required,\n name,\n size = 'md',\n value,\n gap = 2,\n ['data-testid']: dataTestId = 'kibble-checkbox-group',\n ...rest\n}: CheckboxGroupProps): React.JSX.Element => {\n return (\n <CCheckboxGroup\n className=\"CheckboxGroup\"\n data-testid={dataTestId}\n disabled={disabled}\n invalid={invalid}\n name={name}\n defaultValue={defaultValue}\n value={value}\n onValueChange={onValueChange}\n width=\"inherit\"\n >\n <Stack direction={direction} gap={gap} {...rest}>\n {checkboxes.map((checkbox, index) => (\n <Checkbox\n onContrast={onContrast}\n key={`checkbox-${index}`}\n checked={\n checkbox.checked || defaultValue?.includes(`${checkbox?.value}`) || value?.includes(`${checkbox?.value}`)\n }\n size={size}\n required={required}\n readOnly={readOnly}\n {...(direction === 'row' && { fullWidth: false })}\n {...checkbox}\n />\n ))}\n </Stack>\n </CCheckboxGroup>\n );\n};\n\nCheckboxGroup.displayName = 'CheckboxGroup';\nconst WrappedCheckboxGroup = withFormControl(CheckboxGroup);\n\nexport { WrappedCheckboxGroup as CheckboxGroup };\n"],"names":["CheckboxGroup","checkboxes","defaultValue","direction","disabled","invalid","onContrast","onValueChange","readOnly","required","name","size","value","gap","dataTestId","rest","jsx","CCheckboxGroup","Stack","checkbox","index","Checkbox","WrappedCheckboxGroup","withFormControl"],"mappings":"oLA0BMA,EAAgB,CAAC,CACrB,WAAAC,EACA,aAAAC,EACA,UAAAC,EAAY,SACZ,SAAAC,EACA,QAAAC,EACA,WAAAC,EACA,cAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,IAAAC,EAAM,EACN,CAAC,eAAgBC,EAAa,wBAC9B,GAAGC,CACL,IAEIC,EAAA,kBAAA,IAACC,EAAA,cAAA,CACC,UAAU,gBACV,cAAaH,EACb,SAAAV,EACA,QAAAC,EACA,KAAAK,EACA,aAAAR,EACA,MAAAU,EACA,cAAAL,EACA,MAAM,UAEN,SAAAS,EAAAA,kBAAAA,IAACE,EAAAA,MAAM,CAAA,UAAAf,EAAsB,IAAAU,EAAW,GAAGE,EACxC,SAAWd,EAAA,IAAI,CAACkB,EAAUC,IACzBJ,EAAA,kBAAA,IAACK,EAAA,gBAAA,CACC,WAAAf,EAEA,QACEa,EAAS,SAAWjB,GAAc,SAAS,GAAGiB,GAAU,KAAK,EAAE,GAAKP,GAAO,SAAS,GAAGO,GAAU,KAAK,EAAE,EAE1G,KAAAR,EACA,SAAAF,EACA,SAAAD,EACC,GAAIL,IAAc,OAAS,CAAE,UAAW,EAAM,EAC9C,GAAGgB,CAAA,EARC,YAAYC,CAAK,EAAA,CAUzB,CACH,CAAA,CAAA,CACF,EAIJpB,EAAc,YAAc,gBACtB,MAAAsB,EAAuBC,kBAAgBvB,CAAa"}
|
package/dist/chunks/{checkboxGroup.component-BpPgob6o.js → checkboxGroup.component-lxNvlmd_.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { w as f } from "./withFormControl-lDkIqkED.js";
|
|
3
|
-
import { C as j, W as G } from "./checkbox.component-
|
|
3
|
+
import { C as j, W as G } from "./checkbox.component-C0XdgZkr.js";
|
|
4
4
|
import { S as W } from "./stack-rvdA8MI9.js";
|
|
5
5
|
const a = ({
|
|
6
6
|
checkboxes: p,
|
|
@@ -50,4 +50,4 @@ const g = f(a);
|
|
|
50
50
|
export {
|
|
51
51
|
g as W
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=checkboxGroup.component-
|
|
53
|
+
//# sourceMappingURL=checkboxGroup.component-lxNvlmd_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkboxGroup.component-
|
|
1
|
+
{"version":3,"file":"checkboxGroup.component-lxNvlmd_.js","sources":["../../src/components/CheckboxGroup/checkboxGroup.component.tsx"],"sourcesContent":["import React from 'react';\nimport { CheckboxGroup as CCheckboxGroup, CheckboxGroupProps as CCheckboxGroupProps } from '@chakra-ui/react/checkbox';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FlexDirection } from 'shared/types/alignment';\nimport { Checkbox, CheckboxProps } from 'components/Checkbox/checkbox.component';\nimport { Stack } from '@chakra-ui/react/stack';\nimport { ConditionalValue } from '@chakra-ui/react/styled-system';\n\nexport interface KCheckboxGroupProps extends WithFormControlProps {\n /** An array of Checkbox props to be rendered inside the group. */\n checkboxes: CheckboxProps[];\n /**\n * The direction to stack the checkboxes.\n * @default column\n */\n direction?: ConditionalValue<FlexDirection>;\n /** Callback function triggered when the value changes. */\n onValueChange?: (value: string[]) => void;\n /** Data test id for the checkbox group.\n * @default kibble-checkbox-group\n */\n 'data-testid'?: string;\n}\n\nexport type CheckboxGroupProps = KCheckboxGroupProps & Omit<CCheckboxGroupProps, 'onChange'>;\n\nconst CheckboxGroup = ({\n checkboxes,\n defaultValue,\n direction = 'column',\n disabled,\n invalid,\n onContrast,\n onValueChange,\n readOnly,\n required,\n name,\n size = 'md',\n value,\n gap = 2,\n ['data-testid']: dataTestId = 'kibble-checkbox-group',\n ...rest\n}: CheckboxGroupProps): React.JSX.Element => {\n return (\n <CCheckboxGroup\n className=\"CheckboxGroup\"\n data-testid={dataTestId}\n disabled={disabled}\n invalid={invalid}\n name={name}\n defaultValue={defaultValue}\n value={value}\n onValueChange={onValueChange}\n width=\"inherit\"\n >\n <Stack direction={direction} gap={gap} {...rest}>\n {checkboxes.map((checkbox, index) => (\n <Checkbox\n onContrast={onContrast}\n key={`checkbox-${index}`}\n checked={\n checkbox.checked || defaultValue?.includes(`${checkbox?.value}`) || value?.includes(`${checkbox?.value}`)\n }\n size={size}\n required={required}\n readOnly={readOnly}\n {...(direction === 'row' && { fullWidth: false })}\n {...checkbox}\n />\n ))}\n </Stack>\n </CCheckboxGroup>\n );\n};\n\nCheckboxGroup.displayName = 'CheckboxGroup';\nconst WrappedCheckboxGroup = withFormControl(CheckboxGroup);\n\nexport { WrappedCheckboxGroup as CheckboxGroup };\n"],"names":["CheckboxGroup","checkboxes","defaultValue","direction","disabled","invalid","onContrast","onValueChange","readOnly","required","name","size","value","gap","dataTestId","rest","jsx","CCheckboxGroup","Stack","checkbox","index","Checkbox","WrappedCheckboxGroup","withFormControl"],"mappings":";;;;AA0BA,MAAMA,IAAgB,CAAC;AAAA,EACrB,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,CAAC,gBAAgBC,IAAa;AAAA,EAC9B,GAAGC;AACL,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,eAAaH;AAAA,IACb,UAAAV;AAAA,IACA,SAAAC;AAAA,IACA,MAAAK;AAAA,IACA,cAAAR;AAAA,IACA,OAAAU;AAAA,IACA,eAAAL;AAAA,IACA,OAAM;AAAA,IAEN,UAAAS,gBAAAA,EAAAA,IAACE,GAAM,EAAA,WAAAf,GAAsB,KAAAU,GAAW,GAAGE,GACxC,UAAWd,EAAA,IAAI,CAACkB,GAAUC,MACzBJ,gBAAAA,EAAA;AAAA,MAACK;AAAAA,MAAA;AAAA,QACC,YAAAf;AAAA,QAEA,SACEa,EAAS,WAAWjB,GAAc,SAAS,GAAGiB,GAAU,KAAK,EAAE,KAAKP,GAAO,SAAS,GAAGO,GAAU,KAAK,EAAE;AAAA,QAE1G,MAAAR;AAAA,QACA,UAAAF;AAAA,QACA,UAAAD;AAAA,QACC,GAAIL,MAAc,SAAS,EAAE,WAAW,GAAM;AAAA,QAC9C,GAAGgB;AAAA,MAAA;AAAA,MARC,YAAYC,CAAK;AAAA,IAAA,CAUzB,EACH,CAAA;AAAA,EAAA;AACF;AAIJpB,EAAc,cAAc;AACtB,MAAAsB,IAAuBC,EAAgBvB,CAAa;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("./jsx-runtime-BjDatQAs.js"),y=require("react"),C=require("./index-BQRnVsAg.js"),z=require("./card.component-BmBiYbMV.js"),$=require("./timestamp.component-BfmZPfy5.js"),H=require("./notificationCounter.component-CBwi5vXa.js"),R=require("./icon.component-B1hr5lLa.js"),B=require("./heading.component-DnoZOXdz.js"),E=require("./text.component-BDDz5KQP.js"),F=require("./avatar.component-BGgZoVJS.js"),k=require("./tooltip.component-DBw-hAPU.js"),g=require("./flex-BOU6tYUd.js"),j=require("./h-stack-D4MnHHRc.js"),W=require("./v-stack-Bz-79Toq.js"),h=require("./button.component-DjdgBXDC.js"),O=require("./menu.component-
|
|
2
|
-
//# sourceMappingURL=conversationCard.component-
|
|
1
|
+
"use strict";const t=require("./jsx-runtime-BjDatQAs.js"),y=require("react"),C=require("./index-BQRnVsAg.js"),z=require("./card.component-BmBiYbMV.js"),$=require("./timestamp.component-BfmZPfy5.js"),H=require("./notificationCounter.component-CBwi5vXa.js"),R=require("./icon.component-B1hr5lLa.js"),B=require("./heading.component-DnoZOXdz.js"),E=require("./text.component-BDDz5KQP.js"),F=require("./avatar.component-BGgZoVJS.js"),k=require("./tooltip.component-DBw-hAPU.js"),g=require("./flex-BOU6tYUd.js"),j=require("./h-stack-D4MnHHRc.js"),W=require("./v-stack-Bz-79Toq.js"),h=require("./button.component-DjdgBXDC.js"),O=require("./menu.component-DypBuCwv.js"),T=require("./tag.component-C98Wf07v.js"),N=require("./wrap-BzPamGsJ.js"),w=({avatars:e,max:n=1,onAvatarGroupClick:a,tooltipLabel:s,["data-testid"]:i="kibble-conversation-card-avatar-group"})=>t.jsxRuntimeExports.jsx(k.Tooltip,{label:s||"",disabled:!s?.length,children:t.jsxRuntimeExports.jsx(g.Flex,{className:"ConversationCard__AvatarGroup","data-testid":i,alignItems:"flex-start",justifyContent:"flex-start",children:n&&e.length>n?t.jsxRuntimeExports.jsx(F.Avatar,{onClick:r=>{r.stopPropagation(),a&&a(r)},cursor:"pointer",name:e.length.toString(),showTooltip:!1}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map(r=>r)})})}),D=({avatarGroupProps:e,timestampProps:n,isHoveringCard:a,isCardPinned:s,title:i,showNotificationIndicator:r,subtitle:d,["data-testid"]:o="kibble-conversation-card-header"})=>t.jsxRuntimeExports.jsxs(j.HStack,{className:"ConversationCard__Header","data-testid":o,justify:"space-between",align:"flex-start",children:[t.jsxRuntimeExports.jsxs(j.HStack,{className:"ConversationCard__Header--Left","data-testid":`${o}-left`,cursor:"pointer",children:[e&&t.jsxRuntimeExports.jsx(w,{...e,tooltipLabel:e?.tooltipLabel||i}),t.jsxRuntimeExports.jsxs(W.VStack,{className:"ConversationCard__HeaderText","data-testid":`${o}-text`,justify:"center",align:"left",gap:"0",children:[t.jsxRuntimeExports.jsx(B.WrappedHeading,{className:"ConversationCard__HeaderText--Title","data-testid":`${o}-title`,size:"sm",truncated:!0,children:i}),d&&t.jsxRuntimeExports.jsx(E.WrappedText,{className:"ConversationCard__HeaderText--Subtitle","data-testid":`${o}-subtitle`,size:"sm",variant:"subtle",truncated:!0,children:d})]})]}),t.jsxRuntimeExports.jsxs(j.HStack,{className:"ConversationCard__Header--Right","data-testid":`${o}-right`,visibility:a?"hidden":"visible",align:"center",gap:1,children:[t.jsxRuntimeExports.jsx($.Timestamp,{...n}),r&&t.jsxRuntimeExports.jsx(C.Box,{as:"span",className:"ConversationCard__HeaderNotificationCounter","data-testid":`${o}-unread-indicator`,children:t.jsxRuntimeExports.jsx(H.NotificationCounter,{size:"xs"})}),s&&t.jsxRuntimeExports.jsx(g.Flex,{"data-testid":`${o}-pinned-icon`,children:t.jsxRuntimeExports.jsx(R.Icon,{size:"md",variant:"info",name:"pin"})})]})]}),M=({overlayProps:e,pinProps:n,headerMenuProps:a,isHovering:s,setIsHovering:i,["data-testid"]:r="kibble-conversation-card-buttons"})=>{const{isOpenInOverlay:d,onOpenInOverlay:o,["data-testid"]:u}=e||{},{isPinned:c,onTogglePin:x,["data-testid"]:l}=n||{},{listProps:v,["data-testid"]:m}=a||{},p=c?"pinCancel":"pin";return t.jsxRuntimeExports.jsxs(j.HStack,{className:"ConversationCard__Menu","data-testid":r,gap:1,children:[e&&t.jsxRuntimeExports.jsx(h.Button,{className:"ConversationCard__OverlayButton","data-testid":u||`${r}-overlay-button`,variant:"secondarySubtle",borderRadius:"sm",...d&&{active:!0},onClick:()=>{o&&o(),s&&i(!1)},iconName:"popup",size:"sm"}),n&&t.jsxRuntimeExports.jsx(h.Button,{className:"ConversationCard__PinButton","data-testid":l||`${r}-pin-button`,variant:c?"secondarySubtleDestructive":"secondarySubtle",borderRadius:"sm",onClick:()=>{x&&x(!c),s&&i(!1)},iconName:p,size:"sm"}),a&&t.jsxRuntimeExports.jsx(O.Menu,{buttonProps:a.buttonProps||{variant:"secondarySubtle",size:"sm",borderRadius:"sm",iconName:"dotsVertical",hideCaret:!0,padding:0},closeOnSelect:!1,lazyMount:!0,"data-testid":m||`${r}-menu`,...a,listProps:{...v,menuItems:[...n?[{label:`${c?"Unpin":"Pin"} Conversation`,value:"PinConversation",variant:c?"danger":"default",leftElement:t.jsxRuntimeExports.jsx(R.Icon,{size:"md",variant:c?"danger":"default",name:p}),onSelect:()=>{x&&x(!c)}}]:[],...v?.menuItems||[]]}})]})},A=({tags:e,["data-testid"]:n="kibble-conversation-card-tags"})=>t.jsxRuntimeExports.jsx(C.Box,{className:"ConversationCard__Tags",mt:3,"data-testid":n,children:t.jsxRuntimeExports.jsx(N.Wrap,{gap:2,children:e.map(a=>{const{tooltipContent:s,...i}=a;let r=t.jsxRuntimeExports.jsx(T.Tag,{...i,size:"sm",textTransform:"capitalize"});return s&&(r=t.jsxRuntimeExports.jsx(k.Tooltip,{label:s,placement:"top",children:t.jsxRuntimeExports.jsx(C.Box,{children:r})})),t.jsxRuntimeExports.jsx(N.WrapItem,{children:r},a.label)})})}),L=({iconProps:e,content:n,contentProps:a,["data-testid"]:s="kibble-conversation-card-footer"})=>{const i=typeof n=="string"?t.jsxRuntimeExports.jsx(E.WrappedText,{className:"ConversationCard__FooterMessage","data-testid":`${s}-message`,size:"sm",variant:"subtle",...a,...e&&{ml:1},children:n}):n;return t.jsxRuntimeExports.jsxs(g.Flex,{className:"ConversationCard__Footer","data-testid":s,mt:3,alignItems:"center",children:[e&&t.jsxRuntimeExports.jsx(R.Icon,{size:"sm",variant:"subtle",...e}),i]})},V=({contentMenu:e,content:n,contentProps:a,["data-testid"]:s="kibble-conversation-card-content"})=>{const i=typeof n=="string"?t.jsxRuntimeExports.jsx(E.WrappedText,{className:"ConversationCard__Content","data-testid":`${s}-content`,truncated:!0,size:"sm",...a,children:n}):n;return t.jsxRuntimeExports.jsxs(j.HStack,{className:"ConversationCard__ContentContainer","data-testid":`${s}-container`,mt:3,justifyContent:"space-between",alignItems:"center",children:[i,e&&t.jsxRuntimeExports.jsx(C.Box,{className:"ConversationCard__ContentMenu","data-testid":`${s}-menu`,ml:"auto",children:e})]})},I=({allowHoverActions:e=!0,avatarGroupProps:n,content:a,contentProps:s,contentMenu:i,footerProps:r,headerMenuProps:d,headerProps:o,active:u,onClick:c,overlayProps:x,pinProps:l,shouldPreservePosition:v=!1,showNotificationIndicator:m,tags:p,["data-testid"]:f="kibble-conversation-card"})=>{const{isPinned:q}=l||{},[b,_]=y.useState(!1);return t.jsxRuntimeExports.jsxs(z.Card,{className:"ConversationCard",id:"conversation-card-item","data-testid":f,interactive:!0,active:u,size:"sm",fullWidth:!0,onClick:()=>{c&&c()},bg:m||u||b?"background.default":"background.subtle",onMouseEnter:()=>{e&&_(!0)},onMouseLeave:()=>_(!1),pos:"relative",css:{overflowAnchor:v?"auto":"none"},children:[b&&t.jsxRuntimeExports.jsx(C.Box,{className:"ConversationCard__Button--Container","data-testid":`${f}-button-container`,pos:"absolute",top:2,zIndex:"banner",right:2,bg:"background",borderRadius:"md",onClick:S=>S.stopPropagation(),children:t.jsxRuntimeExports.jsx(M,{overlayProps:x,pinProps:l,headerMenuProps:d,isHovering:b,setIsHovering:_})}),t.jsxRuntimeExports.jsx(D,{avatarGroupProps:n,isHoveringCard:b,isCardPinned:q,showNotificationIndicator:m,...o}),t.jsxRuntimeExports.jsx(V,{content:a,contentProps:s,contentMenu:i}),!!p?.length&&t.jsxRuntimeExports.jsx(A,{tags:p}),r&&t.jsxRuntimeExports.jsx(L,{...r})]})};exports.ConversationCard=I;
|
|
2
|
+
//# sourceMappingURL=conversationCard.component-0D3jmvOf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversationCard.component-DHXX77Ye.js","sources":["../../src/components/ConversationCard/components/ConversationCardAvatarGroup/conversationCardAvatarGroup.component.tsx","../../src/components/ConversationCard/components/ConversationCardHeader/conversationCardHeader.component.tsx","../../src/components/ConversationCard/components/ConversationCardButtons/conversationCardButtons.component.tsx","../../src/components/ConversationCard/components/ConversationCardTags/conversationCardTags.component.tsx","../../src/components/ConversationCard/components/ConversationCardFooter/conversationCardFooter.component.tsx","../../src/components/ConversationCard/components/ConversationCardContent/conversationCardContent.component.tsx","../../src/components/ConversationCard/conversationCard.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Avatar } from 'components/Avatar/avatar.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\n\nexport interface ConversationCardAvatarGroupProps {\n /** Avatars to display in the group. */\n avatars: React.ReactNode[];\n /** Maximum number of avatars to display.\n * @default 1\n */\n max?: number;\n /** Callback function to be called when the avatar group is clicked. */\n onAvatarGroupClick?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;\n /** Label for the tooltip. */\n tooltipLabel?: string;\n /** Data test id for the avatar group.\n * @default kibble-conversation-card-avatar-group\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardAvatarGroup = ({\n avatars,\n max = 1,\n onAvatarGroupClick,\n tooltipLabel,\n ['data-testid']: dataTestId = 'kibble-conversation-card-avatar-group',\n}: ConversationCardAvatarGroupProps): React.JSX.Element => {\n return (\n <Tooltip label={tooltipLabel || ''} disabled={!tooltipLabel?.length}>\n <Flex\n className=\"ConversationCard__AvatarGroup\"\n data-testid={dataTestId}\n alignItems=\"flex-start\"\n justifyContent=\"flex-start\"\n >\n {max && avatars.length > max ? (\n <Avatar\n onClick={(e): void => {\n e.stopPropagation();\n if (onAvatarGroupClick) {\n onAvatarGroupClick(e);\n }\n }}\n cursor=\"pointer\"\n name={avatars.length.toString()}\n showTooltip={false}\n />\n ) : (\n <>{avatars.map((avatar) => avatar)}</>\n )}\n </Flex>\n </Tooltip>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { HStack, VStack } from '@chakra-ui/react/stack';\nimport { Timestamp, TimestampProps } from 'components/Timestamp/timestamp.component';\nimport { NotificationCounter } from 'components/NotificationCounter/notificationCounter.component';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Heading } from 'components/Heading/heading.component';\nimport { Text } from 'components/Text/text.component';\nimport {\n ConversationCardAvatarGroup,\n ConversationCardAvatarGroupProps,\n} from '../ConversationCardAvatarGroup/conversationCardAvatarGroup.component';\n\nexport interface ConversationCardHeaderProps {\n /** Props for the avatar group. */\n avatarGroupProps?: ConversationCardAvatarGroupProps;\n /** If true, the notification indicator will be displayed. */\n showNotificationIndicator?: boolean;\n /** Determines if the card is pinned. */\n isCardPinned?: boolean;\n /** Determines if the card is being hovered. */\n isHoveringCard?: boolean;\n /** Subtitle of the card. */\n subtitle?: string;\n /** Props for the timestamp. */\n timestampProps: TimestampProps;\n /** Title of the card. */\n title: string;\n /** Data test id for the header.\n * @default kibble-conversation-card-header\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardHeader = ({\n avatarGroupProps,\n timestampProps,\n isHoveringCard,\n isCardPinned,\n title,\n showNotificationIndicator,\n subtitle,\n ['data-testid']: dataTestId = 'kibble-conversation-card-header',\n}: ConversationCardHeaderProps): React.JSX.Element => {\n return (\n <HStack className=\"ConversationCard__Header\" data-testid={dataTestId} justify=\"space-between\" align=\"flex-start\">\n <HStack className=\"ConversationCard__Header--Left\" data-testid={`${dataTestId}-left`} cursor=\"pointer\">\n {avatarGroupProps && (\n <ConversationCardAvatarGroup {...avatarGroupProps} tooltipLabel={avatarGroupProps?.tooltipLabel || title} />\n )}\n <VStack\n className=\"ConversationCard__HeaderText\"\n data-testid={`${dataTestId}-text`}\n justify=\"center\"\n align=\"left\"\n gap=\"0\"\n >\n <Heading\n className=\"ConversationCard__HeaderText--Title\"\n data-testid={`${dataTestId}-title`}\n size=\"sm\"\n truncated\n >\n {title}\n </Heading>\n {subtitle && (\n <Text\n className=\"ConversationCard__HeaderText--Subtitle\"\n data-testid={`${dataTestId}-subtitle`}\n size=\"sm\"\n variant=\"subtle\"\n truncated\n >\n {subtitle}\n </Text>\n )}\n </VStack>\n </HStack>\n <HStack\n className=\"ConversationCard__Header--Right\"\n data-testid={`${dataTestId}-right`}\n visibility={isHoveringCard ? 'hidden' : 'visible'}\n align=\"center\"\n gap={1}\n >\n <Timestamp {...timestampProps} />\n {showNotificationIndicator && (\n <Box\n as=\"span\"\n className=\"ConversationCard__HeaderNotificationCounter\"\n data-testid={`${dataTestId}-unread-indicator`}\n >\n <NotificationCounter size=\"xs\" />\n </Box>\n )}\n {isCardPinned && (\n <Flex data-testid={`${dataTestId}-pinned-icon`}>\n <Icon size=\"md\" variant=\"info\" name=\"pin\" />\n </Flex>\n )}\n </HStack>\n </HStack>\n );\n};\n","import React from 'react';\nimport { HStack } from '@chakra-ui/react/stack';\nimport { Button } from 'components/Button/button.component';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Menu, MenuProps, MenuItemProps } from 'components/Menu';\n\nexport interface ConversationCardOverlayProps {\n /** Determines if the conversation is open in an overlay. */\n isOpenInOverlay?: boolean;\n /** Callback function to be called when the conversation is opened in an overlay. */\n onOpenInOverlay: () => void;\n /** Data test id for the overlay button. */\n 'data-testid'?: string;\n}\n\nexport interface ConversationCardPinProps {\n /** Determines if the conversation is pinned. */\n isPinned?: boolean;\n /** Callback function to called when the conversation is pinned. */\n onTogglePin: (isPinned: boolean) => void;\n /** Data test id for the pin button. */\n 'data-testid'?: string;\n}\n\nexport interface ConversationCardButtonsProps {\n /** Props for the overlay button. */\n overlayProps?: ConversationCardOverlayProps;\n /** Props for the pin button. */\n pinProps?: ConversationCardPinProps;\n /** Props for the header Menu. */\n headerMenuProps?: MenuProps;\n /** Data test id for the buttons.\n * @default kibble-conversation-card-buttons\n */\n 'data-testid'?: string;\n}\n\ninterface ConversationCardButtonsComponentProps extends ConversationCardButtonsProps {\n /** Determines if the conversation is being hovered.\n * @internal\n */\n isHovering: boolean;\n /** Callback function to set the hover state.\n * @internal\n */\n setIsHovering: (isHovering: boolean) => void;\n}\n\nexport const ConversationCardButtons = ({\n overlayProps,\n pinProps,\n headerMenuProps,\n isHovering,\n setIsHovering,\n ['data-testid']: dataTestId = 'kibble-conversation-card-buttons',\n}: ConversationCardButtonsComponentProps): React.JSX.Element => {\n const { isOpenInOverlay, onOpenInOverlay, ['data-testid']: overlayDataTestId } = overlayProps || {};\n const { isPinned, onTogglePin, ['data-testid']: pinDataTestId } = pinProps || {};\n const { listProps, ['data-testid']: headerMenuDataTestId } = headerMenuProps || {};\n const pinIconName = isPinned ? 'pinCancel' : 'pin';\n\n return (\n <HStack className=\"ConversationCard__Menu\" data-testid={dataTestId} gap={1}>\n {overlayProps && (\n <Button\n className=\"ConversationCard__OverlayButton\"\n data-testid={overlayDataTestId ? overlayDataTestId : `${dataTestId}-overlay-button`}\n variant=\"secondarySubtle\"\n borderRadius=\"sm\"\n {...(isOpenInOverlay && { active: true })}\n onClick={(): void => {\n if (onOpenInOverlay) {\n onOpenInOverlay();\n }\n\n if (isHovering) {\n setIsHovering(false);\n }\n }}\n iconName=\"popup\"\n size=\"sm\"\n />\n )}\n {pinProps && (\n <Button\n className=\"ConversationCard__PinButton\"\n data-testid={pinDataTestId ? pinDataTestId : `${dataTestId}-pin-button`}\n variant={isPinned ? 'secondarySubtleDestructive' : 'secondarySubtle'}\n borderRadius=\"sm\"\n onClick={(): void => {\n if (onTogglePin) {\n onTogglePin(!isPinned);\n }\n\n if (isHovering) {\n setIsHovering(false);\n }\n }}\n iconName={pinIconName}\n size=\"sm\"\n />\n )}\n {headerMenuProps && (\n <Menu\n buttonProps={\n headerMenuProps.buttonProps || {\n variant: 'secondarySubtle',\n size: 'sm',\n borderRadius: 'sm',\n iconName: 'dotsVertical',\n hideCaret: true,\n padding: 0,\n }\n }\n closeOnSelect={false}\n lazyMount\n data-testid={headerMenuDataTestId ? headerMenuDataTestId : `${dataTestId}-menu`}\n {...headerMenuProps}\n listProps={{\n ...listProps,\n menuItems: [\n ...(pinProps\n ? [\n {\n label: `${isPinned ? 'Unpin' : 'Pin'} Conversation`,\n value: 'PinConversation',\n variant: isPinned ? 'danger' : 'default',\n leftElement: <Icon size=\"md\" variant={isPinned ? 'danger' : 'default'} name={pinIconName} />,\n onSelect: (): void => {\n if (onTogglePin) {\n onTogglePin(!isPinned);\n }\n },\n } as MenuItemProps,\n ]\n : []),\n ...(listProps?.menuItems || []),\n ],\n }}\n />\n )}\n </HStack>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Wrap, WrapItem } from '@chakra-ui/react/wrap';\nimport { Tag, TagProps } from 'components/Tag/tag.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\n\nexport type ConversationCardTag = TagProps & {\n /** Content to display in the tooltip. */\n tooltipContent?: string;\n};\n\nexport interface ConversationCardTagsProps {\n /** Tags to display in the ConversationCard. */\n tags: ConversationCardTag[];\n /** Data test id for the tags.\n * @default kibble-conversation-card-tags\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardTags = ({\n tags,\n ['data-testid']: dataTestId = 'kibble-conversation-card-tags',\n}: ConversationCardTagsProps): React.JSX.Element => {\n return (\n <Box className=\"ConversationCard__Tags\" mt={3} data-testid={dataTestId}>\n <Wrap gap={2}>\n {tags.map((tag) => {\n const { tooltipContent, ...rest } = tag;\n let tagElement = <Tag {...rest} size=\"sm\" textTransform=\"capitalize\" />;\n\n if (tooltipContent) {\n tagElement = (\n <Tooltip label={tooltipContent} placement=\"top\">\n <Box>{tagElement}</Box>\n </Tooltip>\n );\n }\n\n return <WrapItem key={tag.label}>{tagElement}</WrapItem>;\n })}\n </Wrap>\n </Box>\n );\n};\n","import React from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon, IconProps } from 'components/Icon/icon.component';\nimport { Text, TextProps } from 'components/Text/text.component';\n\nexport interface ConversationCardFooterProps {\n /** Props for the Icon component. */\n iconProps?: IconProps;\n /** Content of the footer. */\n content: React.ReactNode;\n /** Props to customize the content styling. */\n contentProps?: Omit<TextProps, 'children'>;\n /** Data test id for the footer.\n * @default kibble-conversation-card-footer\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardFooter = ({\n iconProps,\n content,\n contentProps,\n ['data-testid']: dataTestId = 'kibble-conversation-card-footer',\n}: ConversationCardFooterProps): React.JSX.Element => {\n const _content =\n typeof content === 'string' ? (\n <Text\n className=\"ConversationCard__FooterMessage\"\n data-testid={`${dataTestId}-message`}\n size=\"sm\"\n variant=\"subtle\"\n {...contentProps}\n {...(iconProps && { ml: 1 })}\n >\n {content}\n </Text>\n ) : (\n content\n );\n return (\n <Flex className=\"ConversationCard__Footer\" data-testid={dataTestId} mt={3} alignItems=\"center\">\n {iconProps && <Icon size=\"sm\" variant=\"subtle\" {...iconProps} />}\n {_content}\n </Flex>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { HStack } from '@chakra-ui/react/stack';\nimport { Text, TextProps } from 'components/Text/text.component';\n\nexport interface ConversationCardContentProps {\n /** Content of the card. */\n content?: React.ReactNode;\n /** Props to customize the content styling. */\n contentProps?: Omit<TextProps, 'children'>;\n /** Optional Menu for the card. */\n contentMenu?: React.ReactNode;\n /** Data test id for the content.\n * @default kibble-conversation-card-content\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardContent = ({\n contentMenu,\n content,\n contentProps,\n ['data-testid']: dataTestId = 'kibble-conversation-card-content',\n}: ConversationCardContentProps): React.JSX.Element => {\n const _content =\n typeof content === 'string' ? (\n <Text\n className=\"ConversationCard__Content\"\n data-testid={`${dataTestId}-content`}\n truncated\n size=\"sm\"\n {...contentProps}\n >\n {content}\n </Text>\n ) : (\n content\n );\n\n return (\n <HStack\n className=\"ConversationCard__ContentContainer\"\n data-testid={`${dataTestId}-container`}\n mt={3}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n {_content}\n {contentMenu && (\n <Box className=\"ConversationCard__ContentMenu\" data-testid={`${dataTestId}-menu`} ml=\"auto\">\n {contentMenu}\n </Box>\n )}\n </HStack>\n );\n};\n","import React, { useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Card } from 'components/Card/card.component';\nimport { MenuProps } from 'components/Menu/menu.component';\nimport {\n ConversationCardHeader,\n ConversationCardHeaderProps,\n} from './components/ConversationCardHeader/conversationCardHeader.component';\nimport {\n ConversationCardButtons,\n ConversationCardOverlayProps,\n ConversationCardPinProps,\n} from './components/ConversationCardButtons/conversationCardButtons.component';\nimport {\n ConversationCardTag,\n ConversationCardTags,\n} from './components/ConversationCardTags/conversationCardTags.component';\nimport {\n ConversationCardFooter,\n ConversationCardFooterProps,\n} from './components/ConversationCardFooter/conversationCardFooter.component';\nimport {\n ConversationCardContent,\n ConversationCardContentProps,\n} from './components/ConversationCardContent/conversationCardContent.component';\nimport { ConversationCardAvatarGroupProps } from './components/ConversationCardAvatarGroup/conversationCardAvatarGroup.component';\n\nexport interface ConversationCardProps extends ConversationCardContentProps {\n /**\n * Used to enable hover actions on the ConversationCard.\n * @default true\n */\n allowHoverActions?: boolean;\n /** Props for the `AvatarGroup` component. */\n avatarGroupProps?: ConversationCardAvatarGroupProps;\n /** Props for the ConversationCard footer. */\n footerProps?: ConversationCardFooterProps;\n /** Props for the Menu component. See the `Menu` for more details. This component provides a default menu button if none is provided. If menuProps and pinProps are passed together, the component automatically adds a menuItem to control the pinned state. */\n headerMenuProps?: MenuProps;\n /** Props for the ConversationCard header. */\n headerProps: ConversationCardHeaderProps;\n /**\n * Used to set the active state of the ConversationCard.\n * @default false\n */\n active?: boolean;\n /** Callback function for clicking the ConversationCard. */\n onClick?: () => void;\n /** Props to show and configure the conversation overlay button. If not passed, the overlay button won't be shown. */\n overlayProps?: ConversationCardOverlayProps;\n /** Props for the pin functionality. If not passed, pin functionality won't be shown. */\n pinProps?: ConversationCardPinProps;\n /**\n * Used to preserve the position of the ConversationCard in a list with infinite scrolling.\n * @default false\n */\n shouldPreservePosition?: boolean;\n /**\n * Used to show the unread messages indicator.\n * @default false\n */\n showNotificationIndicator?: boolean;\n /** The tags to be displayed in the ConversationCard. See the `Tag` for more information. Additionally, you can pass in a tooltipContent to customize what is shown in the tooltip. */\n tags?: ConversationCardTag[];\n /** Data test id for the conversation card.\n * @default kibble-conversation-card\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCard = ({\n allowHoverActions = true,\n avatarGroupProps,\n content,\n contentProps,\n contentMenu,\n footerProps,\n headerMenuProps,\n headerProps,\n active,\n onClick,\n overlayProps,\n pinProps,\n shouldPreservePosition = false,\n showNotificationIndicator,\n tags,\n ['data-testid']: dataTestId = 'kibble-conversation-card',\n}: ConversationCardProps): React.JSX.Element => {\n const { isPinned } = pinProps || {};\n const [isHovering, setIsHovering] = useState(false);\n\n return (\n <Card\n className=\"ConversationCard\"\n id=\"conversation-card-item\"\n data-testid={dataTestId}\n interactive\n active={active}\n size=\"sm\"\n fullWidth\n onClick={(): void => {\n if (onClick) {\n onClick();\n }\n }}\n bg={showNotificationIndicator || active || isHovering ? 'background.default' : 'background.subtle'}\n onMouseEnter={(): void => {\n if (allowHoverActions) {\n setIsHovering(true);\n }\n }}\n onMouseLeave={(): void => setIsHovering(false)}\n pos=\"relative\"\n css={{ overflowAnchor: shouldPreservePosition ? 'auto' : 'none' }}\n >\n {isHovering && (\n <Box\n className=\"ConversationCard__Button--Container\"\n data-testid={`${dataTestId}-button-container`}\n pos=\"absolute\"\n top={2}\n zIndex=\"banner\"\n right={2}\n bg=\"background\"\n borderRadius=\"md\"\n onClick={(e): void => e.stopPropagation()}\n >\n <ConversationCardButtons\n overlayProps={overlayProps}\n pinProps={pinProps}\n headerMenuProps={headerMenuProps}\n isHovering={isHovering}\n setIsHovering={setIsHovering}\n />\n </Box>\n )}\n <ConversationCardHeader\n avatarGroupProps={avatarGroupProps}\n isHoveringCard={isHovering}\n isCardPinned={isPinned}\n showNotificationIndicator={showNotificationIndicator}\n {...headerProps}\n />\n <ConversationCardContent content={content} contentProps={contentProps} contentMenu={contentMenu} />\n {!!tags?.length && <ConversationCardTags tags={tags} />}\n {footerProps && <ConversationCardFooter {...footerProps} />}\n </Card>\n );\n};\n"],"names":["ConversationCardAvatarGroup","avatars","max","onAvatarGroupClick","tooltipLabel","dataTestId","jsx","Tooltip","Flex","Avatar","e","Fragment","avatar","ConversationCardHeader","avatarGroupProps","timestampProps","isHoveringCard","isCardPinned","title","showNotificationIndicator","subtitle","jsxs","HStack","VStack","Heading","Text","Timestamp","Box","NotificationCounter","Icon","ConversationCardButtons","overlayProps","pinProps","headerMenuProps","isHovering","setIsHovering","isOpenInOverlay","onOpenInOverlay","overlayDataTestId","isPinned","onTogglePin","pinDataTestId","listProps","headerMenuDataTestId","pinIconName","Button","Menu","ConversationCardTags","tags","Wrap","tag","tooltipContent","rest","tagElement","Tag","WrapItem","ConversationCardFooter","iconProps","content","contentProps","_content","ConversationCardContent","contentMenu","ConversationCard","allowHoverActions","footerProps","headerProps","active","onClick","shouldPreservePosition","useState","Card"],"mappings":"+tBAsBaA,EAA8B,CAAC,CAC1C,QAAAC,EACA,IAAAC,EAAM,EACN,mBAAAC,EACA,aAAAC,EACA,CAAC,eAAgBC,EAAa,uCAChC,IAEIC,wBAACC,EAAAA,SAAQ,MAAOH,GAAgB,GAAI,SAAU,CAACA,GAAc,OAC3D,SAAAE,EAAA,kBAAA,IAACE,EAAA,KAAA,CACC,UAAU,gCACV,cAAaH,EACb,WAAW,aACX,eAAe,aAEd,SAAAH,GAAOD,EAAQ,OAASC,EACvBI,EAAA,kBAAA,IAACG,EAAA,OAAA,CACC,QAAUC,GAAY,CACpBA,EAAE,gBAAgB,EACdP,GACFA,EAAmBO,CAAC,CAExB,EACA,OAAO,UACP,KAAMT,EAA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G,CAA0B,CAAA,EAChG,CAAC,CAACd,GAAM,QAAU1C,EAAA,kBAAA,IAACyC,GAAqB,KAAAC,EAAY,EACpDiB,GAAe3D,EAAA,kBAAA,IAACkD,EAAwB,CAAA,GAAGS,CAAa,CAAA,CAAA,CAAA,CAC3D,CAEJ"}
|
|
1
|
+
{"version":3,"file":"conversationCard.component-0D3jmvOf.js","sources":["../../src/components/ConversationCard/components/ConversationCardAvatarGroup/conversationCardAvatarGroup.component.tsx","../../src/components/ConversationCard/components/ConversationCardHeader/conversationCardHeader.component.tsx","../../src/components/ConversationCard/components/ConversationCardButtons/conversationCardButtons.component.tsx","../../src/components/ConversationCard/components/ConversationCardTags/conversationCardTags.component.tsx","../../src/components/ConversationCard/components/ConversationCardFooter/conversationCardFooter.component.tsx","../../src/components/ConversationCard/components/ConversationCardContent/conversationCardContent.component.tsx","../../src/components/ConversationCard/conversationCard.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Avatar } from 'components/Avatar/avatar.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\n\nexport interface ConversationCardAvatarGroupProps {\n /** Avatars to display in the group. */\n avatars: React.ReactNode[];\n /** Maximum number of avatars to display.\n * @default 1\n */\n max?: number;\n /** Callback function to be called when the avatar group is clicked. */\n onAvatarGroupClick?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;\n /** Label for the tooltip. */\n tooltipLabel?: string;\n /** Data test id for the avatar group.\n * @default kibble-conversation-card-avatar-group\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardAvatarGroup = ({\n avatars,\n max = 1,\n onAvatarGroupClick,\n tooltipLabel,\n ['data-testid']: dataTestId = 'kibble-conversation-card-avatar-group',\n}: ConversationCardAvatarGroupProps): React.JSX.Element => {\n return (\n <Tooltip label={tooltipLabel || ''} disabled={!tooltipLabel?.length}>\n <Flex\n className=\"ConversationCard__AvatarGroup\"\n data-testid={dataTestId}\n alignItems=\"flex-start\"\n justifyContent=\"flex-start\"\n >\n {max && avatars.length > max ? (\n <Avatar\n onClick={(e): void => {\n e.stopPropagation();\n if (onAvatarGroupClick) {\n onAvatarGroupClick(e);\n }\n }}\n cursor=\"pointer\"\n name={avatars.length.toString()}\n showTooltip={false}\n />\n ) : (\n <>{avatars.map((avatar) => avatar)}</>\n )}\n </Flex>\n </Tooltip>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { HStack, VStack } from '@chakra-ui/react/stack';\nimport { Timestamp, TimestampProps } from 'components/Timestamp/timestamp.component';\nimport { NotificationCounter } from 'components/NotificationCounter/notificationCounter.component';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Heading } from 'components/Heading/heading.component';\nimport { Text } from 'components/Text/text.component';\nimport {\n ConversationCardAvatarGroup,\n ConversationCardAvatarGroupProps,\n} from '../ConversationCardAvatarGroup/conversationCardAvatarGroup.component';\n\nexport interface ConversationCardHeaderProps {\n /** Props for the avatar group. */\n avatarGroupProps?: ConversationCardAvatarGroupProps;\n /** If true, the notification indicator will be displayed. */\n showNotificationIndicator?: boolean;\n /** Determines if the card is pinned. */\n isCardPinned?: boolean;\n /** Determines if the card is being hovered. */\n isHoveringCard?: boolean;\n /** Subtitle of the card. */\n subtitle?: string;\n /** Props for the timestamp. */\n timestampProps: TimestampProps;\n /** Title of the card. */\n title: string;\n /** Data test id for the header.\n * @default kibble-conversation-card-header\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardHeader = ({\n avatarGroupProps,\n timestampProps,\n isHoveringCard,\n isCardPinned,\n title,\n showNotificationIndicator,\n subtitle,\n ['data-testid']: dataTestId = 'kibble-conversation-card-header',\n}: ConversationCardHeaderProps): React.JSX.Element => {\n return (\n <HStack className=\"ConversationCard__Header\" data-testid={dataTestId} justify=\"space-between\" align=\"flex-start\">\n <HStack className=\"ConversationCard__Header--Left\" data-testid={`${dataTestId}-left`} cursor=\"pointer\">\n {avatarGroupProps && (\n <ConversationCardAvatarGroup {...avatarGroupProps} tooltipLabel={avatarGroupProps?.tooltipLabel || title} />\n )}\n <VStack\n className=\"ConversationCard__HeaderText\"\n data-testid={`${dataTestId}-text`}\n justify=\"center\"\n align=\"left\"\n gap=\"0\"\n >\n <Heading\n className=\"ConversationCard__HeaderText--Title\"\n data-testid={`${dataTestId}-title`}\n size=\"sm\"\n truncated\n >\n {title}\n </Heading>\n {subtitle && (\n <Text\n className=\"ConversationCard__HeaderText--Subtitle\"\n data-testid={`${dataTestId}-subtitle`}\n size=\"sm\"\n variant=\"subtle\"\n truncated\n >\n {subtitle}\n </Text>\n )}\n </VStack>\n </HStack>\n <HStack\n className=\"ConversationCard__Header--Right\"\n data-testid={`${dataTestId}-right`}\n visibility={isHoveringCard ? 'hidden' : 'visible'}\n align=\"center\"\n gap={1}\n >\n <Timestamp {...timestampProps} />\n {showNotificationIndicator && (\n <Box\n as=\"span\"\n className=\"ConversationCard__HeaderNotificationCounter\"\n data-testid={`${dataTestId}-unread-indicator`}\n >\n <NotificationCounter size=\"xs\" />\n </Box>\n )}\n {isCardPinned && (\n <Flex data-testid={`${dataTestId}-pinned-icon`}>\n <Icon size=\"md\" variant=\"info\" name=\"pin\" />\n </Flex>\n )}\n </HStack>\n </HStack>\n );\n};\n","import React from 'react';\nimport { HStack } from '@chakra-ui/react/stack';\nimport { Button } from 'components/Button/button.component';\nimport { Icon } from 'components/Icon/icon.component';\nimport { Menu, MenuProps, MenuItemProps } from 'components/Menu';\n\nexport interface ConversationCardOverlayProps {\n /** Determines if the conversation is open in an overlay. */\n isOpenInOverlay?: boolean;\n /** Callback function to be called when the conversation is opened in an overlay. */\n onOpenInOverlay: () => void;\n /** Data test id for the overlay button. */\n 'data-testid'?: string;\n}\n\nexport interface ConversationCardPinProps {\n /** Determines if the conversation is pinned. */\n isPinned?: boolean;\n /** Callback function to called when the conversation is pinned. */\n onTogglePin: (isPinned: boolean) => void;\n /** Data test id for the pin button. */\n 'data-testid'?: string;\n}\n\nexport interface ConversationCardButtonsProps {\n /** Props for the overlay button. */\n overlayProps?: ConversationCardOverlayProps;\n /** Props for the pin button. */\n pinProps?: ConversationCardPinProps;\n /** Props for the header Menu. */\n headerMenuProps?: MenuProps;\n /** Data test id for the buttons.\n * @default kibble-conversation-card-buttons\n */\n 'data-testid'?: string;\n}\n\ninterface ConversationCardButtonsComponentProps extends ConversationCardButtonsProps {\n /** Determines if the conversation is being hovered.\n * @internal\n */\n isHovering: boolean;\n /** Callback function to set the hover state.\n * @internal\n */\n setIsHovering: (isHovering: boolean) => void;\n}\n\nexport const ConversationCardButtons = ({\n overlayProps,\n pinProps,\n headerMenuProps,\n isHovering,\n setIsHovering,\n ['data-testid']: dataTestId = 'kibble-conversation-card-buttons',\n}: ConversationCardButtonsComponentProps): React.JSX.Element => {\n const { isOpenInOverlay, onOpenInOverlay, ['data-testid']: overlayDataTestId } = overlayProps || {};\n const { isPinned, onTogglePin, ['data-testid']: pinDataTestId } = pinProps || {};\n const { listProps, ['data-testid']: headerMenuDataTestId } = headerMenuProps || {};\n const pinIconName = isPinned ? 'pinCancel' : 'pin';\n\n return (\n <HStack className=\"ConversationCard__Menu\" data-testid={dataTestId} gap={1}>\n {overlayProps && (\n <Button\n className=\"ConversationCard__OverlayButton\"\n data-testid={overlayDataTestId ? overlayDataTestId : `${dataTestId}-overlay-button`}\n variant=\"secondarySubtle\"\n borderRadius=\"sm\"\n {...(isOpenInOverlay && { active: true })}\n onClick={(): void => {\n if (onOpenInOverlay) {\n onOpenInOverlay();\n }\n\n if (isHovering) {\n setIsHovering(false);\n }\n }}\n iconName=\"popup\"\n size=\"sm\"\n />\n )}\n {pinProps && (\n <Button\n className=\"ConversationCard__PinButton\"\n data-testid={pinDataTestId ? pinDataTestId : `${dataTestId}-pin-button`}\n variant={isPinned ? 'secondarySubtleDestructive' : 'secondarySubtle'}\n borderRadius=\"sm\"\n onClick={(): void => {\n if (onTogglePin) {\n onTogglePin(!isPinned);\n }\n\n if (isHovering) {\n setIsHovering(false);\n }\n }}\n iconName={pinIconName}\n size=\"sm\"\n />\n )}\n {headerMenuProps && (\n <Menu\n buttonProps={\n headerMenuProps.buttonProps || {\n variant: 'secondarySubtle',\n size: 'sm',\n borderRadius: 'sm',\n iconName: 'dotsVertical',\n hideCaret: true,\n padding: 0,\n }\n }\n closeOnSelect={false}\n lazyMount\n data-testid={headerMenuDataTestId ? headerMenuDataTestId : `${dataTestId}-menu`}\n {...headerMenuProps}\n listProps={{\n ...listProps,\n menuItems: [\n ...(pinProps\n ? [\n {\n label: `${isPinned ? 'Unpin' : 'Pin'} Conversation`,\n value: 'PinConversation',\n variant: isPinned ? 'danger' : 'default',\n leftElement: <Icon size=\"md\" variant={isPinned ? 'danger' : 'default'} name={pinIconName} />,\n onSelect: (): void => {\n if (onTogglePin) {\n onTogglePin(!isPinned);\n }\n },\n } as MenuItemProps,\n ]\n : []),\n ...(listProps?.menuItems || []),\n ],\n }}\n />\n )}\n </HStack>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Wrap, WrapItem } from '@chakra-ui/react/wrap';\nimport { Tag, TagProps } from 'components/Tag/tag.component';\nimport { Tooltip } from 'components/Tooltip/tooltip.component';\n\nexport type ConversationCardTag = TagProps & {\n /** Content to display in the tooltip. */\n tooltipContent?: string;\n};\n\nexport interface ConversationCardTagsProps {\n /** Tags to display in the ConversationCard. */\n tags: ConversationCardTag[];\n /** Data test id for the tags.\n * @default kibble-conversation-card-tags\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardTags = ({\n tags,\n ['data-testid']: dataTestId = 'kibble-conversation-card-tags',\n}: ConversationCardTagsProps): React.JSX.Element => {\n return (\n <Box className=\"ConversationCard__Tags\" mt={3} data-testid={dataTestId}>\n <Wrap gap={2}>\n {tags.map((tag) => {\n const { tooltipContent, ...rest } = tag;\n let tagElement = <Tag {...rest} size=\"sm\" textTransform=\"capitalize\" />;\n\n if (tooltipContent) {\n tagElement = (\n <Tooltip label={tooltipContent} placement=\"top\">\n <Box>{tagElement}</Box>\n </Tooltip>\n );\n }\n\n return <WrapItem key={tag.label}>{tagElement}</WrapItem>;\n })}\n </Wrap>\n </Box>\n );\n};\n","import React from 'react';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { Icon, IconProps } from 'components/Icon/icon.component';\nimport { Text, TextProps } from 'components/Text/text.component';\n\nexport interface ConversationCardFooterProps {\n /** Props for the Icon component. */\n iconProps?: IconProps;\n /** Content of the footer. */\n content: React.ReactNode;\n /** Props to customize the content styling. */\n contentProps?: Omit<TextProps, 'children'>;\n /** Data test id for the footer.\n * @default kibble-conversation-card-footer\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardFooter = ({\n iconProps,\n content,\n contentProps,\n ['data-testid']: dataTestId = 'kibble-conversation-card-footer',\n}: ConversationCardFooterProps): React.JSX.Element => {\n const _content =\n typeof content === 'string' ? (\n <Text\n className=\"ConversationCard__FooterMessage\"\n data-testid={`${dataTestId}-message`}\n size=\"sm\"\n variant=\"subtle\"\n {...contentProps}\n {...(iconProps && { ml: 1 })}\n >\n {content}\n </Text>\n ) : (\n content\n );\n return (\n <Flex className=\"ConversationCard__Footer\" data-testid={dataTestId} mt={3} alignItems=\"center\">\n {iconProps && <Icon size=\"sm\" variant=\"subtle\" {...iconProps} />}\n {_content}\n </Flex>\n );\n};\n","import React from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { HStack } from '@chakra-ui/react/stack';\nimport { Text, TextProps } from 'components/Text/text.component';\n\nexport interface ConversationCardContentProps {\n /** Content of the card. */\n content?: React.ReactNode;\n /** Props to customize the content styling. */\n contentProps?: Omit<TextProps, 'children'>;\n /** Optional Menu for the card. */\n contentMenu?: React.ReactNode;\n /** Data test id for the content.\n * @default kibble-conversation-card-content\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCardContent = ({\n contentMenu,\n content,\n contentProps,\n ['data-testid']: dataTestId = 'kibble-conversation-card-content',\n}: ConversationCardContentProps): React.JSX.Element => {\n const _content =\n typeof content === 'string' ? (\n <Text\n className=\"ConversationCard__Content\"\n data-testid={`${dataTestId}-content`}\n truncated\n size=\"sm\"\n {...contentProps}\n >\n {content}\n </Text>\n ) : (\n content\n );\n\n return (\n <HStack\n className=\"ConversationCard__ContentContainer\"\n data-testid={`${dataTestId}-container`}\n mt={3}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n {_content}\n {contentMenu && (\n <Box className=\"ConversationCard__ContentMenu\" data-testid={`${dataTestId}-menu`} ml=\"auto\">\n {contentMenu}\n </Box>\n )}\n </HStack>\n );\n};\n","import React, { useState } from 'react';\nimport { Box } from '@chakra-ui/react/box';\nimport { Card } from 'components/Card/card.component';\nimport { MenuProps } from 'components/Menu/menu.component';\nimport {\n ConversationCardHeader,\n ConversationCardHeaderProps,\n} from './components/ConversationCardHeader/conversationCardHeader.component';\nimport {\n ConversationCardButtons,\n ConversationCardOverlayProps,\n ConversationCardPinProps,\n} from './components/ConversationCardButtons/conversationCardButtons.component';\nimport {\n ConversationCardTag,\n ConversationCardTags,\n} from './components/ConversationCardTags/conversationCardTags.component';\nimport {\n ConversationCardFooter,\n ConversationCardFooterProps,\n} from './components/ConversationCardFooter/conversationCardFooter.component';\nimport {\n ConversationCardContent,\n ConversationCardContentProps,\n} from './components/ConversationCardContent/conversationCardContent.component';\nimport { ConversationCardAvatarGroupProps } from './components/ConversationCardAvatarGroup/conversationCardAvatarGroup.component';\n\nexport interface ConversationCardProps extends ConversationCardContentProps {\n /**\n * Used to enable hover actions on the ConversationCard.\n * @default true\n */\n allowHoverActions?: boolean;\n /** Props for the `AvatarGroup` component. */\n avatarGroupProps?: ConversationCardAvatarGroupProps;\n /** Props for the ConversationCard footer. */\n footerProps?: ConversationCardFooterProps;\n /** Props for the Menu component. See the `Menu` for more details. This component provides a default menu button if none is provided. If menuProps and pinProps are passed together, the component automatically adds a menuItem to control the pinned state. */\n headerMenuProps?: MenuProps;\n /** Props for the ConversationCard header. */\n headerProps: ConversationCardHeaderProps;\n /**\n * Used to set the active state of the ConversationCard.\n * @default false\n */\n active?: boolean;\n /** Callback function for clicking the ConversationCard. */\n onClick?: () => void;\n /** Props to show and configure the conversation overlay button. If not passed, the overlay button won't be shown. */\n overlayProps?: ConversationCardOverlayProps;\n /** Props for the pin functionality. If not passed, pin functionality won't be shown. */\n pinProps?: ConversationCardPinProps;\n /**\n * Used to preserve the position of the ConversationCard in a list with infinite scrolling.\n * @default false\n */\n shouldPreservePosition?: boolean;\n /**\n * Used to show the unread messages indicator.\n * @default false\n */\n showNotificationIndicator?: boolean;\n /** The tags to be displayed in the ConversationCard. See the `Tag` for more information. Additionally, you can pass in a tooltipContent to customize what is shown in the tooltip. */\n tags?: ConversationCardTag[];\n /** Data test id for the conversation card.\n * @default kibble-conversation-card\n */\n 'data-testid'?: string;\n}\n\nexport const ConversationCard = ({\n allowHoverActions = true,\n avatarGroupProps,\n content,\n contentProps,\n contentMenu,\n footerProps,\n headerMenuProps,\n headerProps,\n active,\n onClick,\n overlayProps,\n pinProps,\n shouldPreservePosition = false,\n showNotificationIndicator,\n tags,\n ['data-testid']: dataTestId = 'kibble-conversation-card',\n}: ConversationCardProps): React.JSX.Element => {\n const { isPinned } = pinProps || {};\n const [isHovering, setIsHovering] = useState(false);\n\n return (\n <Card\n className=\"ConversationCard\"\n id=\"conversation-card-item\"\n data-testid={dataTestId}\n interactive\n active={active}\n size=\"sm\"\n fullWidth\n onClick={(): void => {\n if (onClick) {\n onClick();\n }\n }}\n bg={showNotificationIndicator || active || isHovering ? 'background.default' : 'background.subtle'}\n onMouseEnter={(): void => {\n if (allowHoverActions) {\n setIsHovering(true);\n }\n }}\n onMouseLeave={(): void => setIsHovering(false)}\n pos=\"relative\"\n css={{ overflowAnchor: shouldPreservePosition ? 'auto' : 'none' }}\n >\n {isHovering && (\n <Box\n className=\"ConversationCard__Button--Container\"\n data-testid={`${dataTestId}-button-container`}\n pos=\"absolute\"\n top={2}\n zIndex=\"banner\"\n right={2}\n bg=\"background\"\n borderRadius=\"md\"\n onClick={(e): void => e.stopPropagation()}\n >\n <ConversationCardButtons\n overlayProps={overlayProps}\n pinProps={pinProps}\n headerMenuProps={headerMenuProps}\n isHovering={isHovering}\n setIsHovering={setIsHovering}\n />\n </Box>\n )}\n <ConversationCardHeader\n avatarGroupProps={avatarGroupProps}\n isHoveringCard={isHovering}\n isCardPinned={isPinned}\n showNotificationIndicator={showNotificationIndicator}\n {...headerProps}\n />\n <ConversationCardContent content={content} contentProps={contentProps} contentMenu={contentMenu} />\n {!!tags?.length && <ConversationCardTags tags={tags} />}\n {footerProps && <ConversationCardFooter {...footerProps} />}\n </Card>\n );\n};\n"],"names":["ConversationCardAvatarGroup","avatars","max","onAvatarGroupClick","tooltipLabel","dataTestId","jsx","Tooltip","Flex","Avatar","e","Fragment","avatar","ConversationCardHeader","avatarGroupProps","timestampProps","isHoveringCard","isCardPinned","title","showNotificationIndicator","subtitle","jsxs","HStack","VStack","Heading","Text","Timestamp","Box","NotificationCounter","Icon","ConversationCardButtons","overlayProps","pinProps","headerMenuProps","isHovering","setIsHovering","isOpenInOverlay","onOpenInOverlay","overlayDataTestId","isPinned","onTogglePin","pinDataTestId","listProps","headerMenuDataTestId","pinIconName","Button","Menu","ConversationCardTags","tags","Wrap","tag","tooltipContent","rest","tagElement","Tag","WrapItem","ConversationCardFooter","iconProps","content","contentProps","_content","ConversationCardContent","contentMenu","ConversationCard","allowHoverActions","footerProps","headerProps","active","onClick","shouldPreservePosition","useState","Card"],"mappings":"+tBAsBaA,EAA8B,CAAC,CAC1C,QAAAC,EACA,IAAAC,EAAM,EACN,mBAAAC,EACA,aAAAC,EACA,CAAC,eAAgBC,EAAa,uCAChC,IAEIC,wBAACC,EAAAA,SAAQ,MAAOH,GAAgB,GAAI,SAAU,CAACA,GAAc,OAC3D,SAAAE,EAAA,kBAAA,IAACE,EAAA,KAAA,CACC,UAAU,gCACV,cAAaH,EACb,WAAW,aACX,eAAe,aAEd,SAAAH,GAAOD,EAA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