@constructive-io/ui 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/autocomplete.js +11 -3
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js +50 -14
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +16 -35
- package/dist/components/command.js +72 -508
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +3 -3
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.js +3 -3
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/org-chart/index.d.ts +54 -0
- package/dist/components/org-chart/index.js +861 -0
- package/dist/components/org-chart/index.js.map +1 -0
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.js.map +1 -1
- package/dist/components/record-picker.js +3 -3
- package/dist/components/record-picker.js.map +1 -1
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.js +6 -4
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +3 -3
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/stack/index.d.ts +11 -0
- package/dist/components/stack/index.js +33 -6
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.d.ts +1 -3
- package/dist/components/tags.js +107 -388
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.cjs +867 -378
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -24
- package/dist/index.d.ts +82 -24
- package/dist/index.js +746 -259
- package/dist/index.js.map +1 -1
- package/package.json +13 -6
- package/src/styles/globals.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/stepper.tsx"],"names":["React2","jsx","Fragment"],"mappings":";;;;;;;AAQA,SAAS,eAAkB,IAAA,EAA0D;AACpF,EAAA,OAAO,CAAC,IAAA,KAAS;AAChB,IAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACrB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC9B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACvB,QAAC,IAAyC,OAAA,GAAU,IAAA;AAAA,MACrD;AAAA,IACD,CAAC,CAAA;AAAA,EACF,CAAA;AACD;AAMA,SAAS,UAAA,CACR,WACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,aAAA,GAAyC,EAAE,GAAG,UAAA,EAAW;AAE/D,EAAA,KAAA,MAAW,YAAY,UAAA,EAAY;AAElC,IAAA,IAAI,aAAa,KAAA,EAAO;AAExB,IAAA,MAAM,aAAA,GAAgB,UAAU,QAAQ,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,WAAW,QAAQ,CAAA;AAG1C,IAAA,IAAI,UAAA,CAA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E,SAAS,CAAA;AAAA,MAC/F,GAAG;AAAA;AAAA,GACL;AAEF;AAGA,SAAS,gBAAA,CAAiB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAyC;AACxF,EAAA,uBACCA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,mBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,mDAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"stepper.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot='stepper'\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot='stepper-item'\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-all\n\t\tduration-200 ease-out outline-none hover:scale-105 focus-visible:z-10 focus-visible:ring-[3px] active:scale-95\n\t\tdisabled:pointer-events-none disabled:opacity-50`,\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot='stepper-trigger'\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot='stepper-trigger'\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot='stepper-indicator'\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-all duration-300 ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName='transition-all duration-200 ease-out group-data-loading/step:scale-75\n\t\t\t\t\t\t\tgroup-data-loading/step:opacity-0 group-data-loading/step:transition-none\n\t\t\t\t\t\t\tgroup-data-[state=completed]/step:scale-75 group-data-[state=completed]/step:opacity-0'\n\t\t\t\t\t>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName='absolute scale-75 opacity-0 transition-all duration-200 ease-out\n\t\t\t\t\t\t\tgroup-data-[state=completed]/step:scale-100 group-data-[state=completed]/step:opacity-100'\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t{isLoading && (\n\t\t\t\t\t\t<span className='absolute transition-all duration-200 ease-out'>\n\t\t\t\t\t\t\t<LoaderCircleIcon className='animate-spin' size={14} aria-hidden='true' />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot='stepper-title'\n\t\t\tclassName={cn('text-sm font-medium transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot='stepper-description'\n\t\t\tclassName={cn('text-muted-foreground text-sm transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot='stepper-separator'\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-all duration-500 ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/slot.tsx","../../src/lib/utils.ts","../../src/components/stepper.tsx"],"names":["React2","jsx","Fragment"],"mappings":";;;;;;;AAQA,SAAS,eAAkB,IAAA,EAA0D;AACpF,EAAA,OAAO,CAAC,IAAA,KAAS;AAChB,IAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACrB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC9B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACvB,QAAC,IAAyC,OAAA,GAAU,IAAA;AAAA,MACrD;AAAA,IACD,CAAC,CAAA;AAAA,EACF,CAAA;AACD;AAMA,SAAS,UAAA,CACR,WACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,aAAA,GAAyC,EAAE,GAAG,UAAA,EAAW;AAE/D,EAAA,KAAA,MAAW,YAAY,UAAA,EAAY;AAElC,IAAA,IAAI,aAAa,KAAA,EAAO;AAExB,IAAA,MAAM,aAAA,GAAgB,UAAU,QAAQ,CAAA;AACxC,IAAA,MAAM,cAAA,GAAiB,WAAW,QAAQ,CAAA;AAG1C,IAAA,IAAI,UAAA,CAAW,KAAK,QAAQ,CAAA,IAAK,OAAO,aAAA,KAAkB,UAAA,IAAc,OAAO,cAAA,KAAmB,UAAA,EAAY;AAC7G,MAAA,aAAA,CAAc,QAAQ,CAAA,GAAI,CAAA,GAAI,IAAA,KAAoB;AACjD,QAAA,cAAA,CAAe,GAAG,IAAI,CAAA;AACtB,QAAA,aAAA,CAAc,GAAG,IAAI,CAAA;AAAA,MACtB,CAAA;AAAA,I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,mDAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"stepper.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper-item\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-all\n\t\tduration-200 ease-out outline-none hover:scale-105 focus-visible:z-10 focus-visible:ring-[3px] active:scale-95\n\t\tdisabled:pointer-events-none disabled:opacity-50`,\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"stepper-indicator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-all duration-300 ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName='transition-all duration-200 ease-out group-data-loading/step:scale-75\n\t\t\t\t\t\t\tgroup-data-loading/step:opacity-0 group-data-loading/step:transition-none\n\t\t\t\t\t\t\tgroup-data-[state=completed]/step:scale-75 group-data-[state=completed]/step:opacity-0'\n\t\t\t\t\t>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName='absolute scale-75 opacity-0 transition-all duration-200 ease-out\n\t\t\t\t\t\t\tgroup-data-[state=completed]/step:scale-100 group-data-[state=completed]/step:opacity-100'\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t{isLoading && (\n\t\t\t\t\t\t<span className='absolute transition-all duration-200 ease-out'>\n\t\t\t\t\t\t\t<LoaderCircleIcon className='animate-spin' size={14} aria-hidden='true' />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"stepper-title\"\n\t\t\tclassName={cn('text-sm font-medium transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"stepper-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"stepper-separator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-all duration-500 ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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A+E,SAAS,CAAA;AAAA,MACrG,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,SAAA,CAAU,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACvE,EAAA,uBACC,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,YAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA,iCAAA,CAAA;AAAA,QAEA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,SAAA,CAAU,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACvE,EAAA,uBACC,GAAA,CAAC,IAAA,EAAA,EAAG,WAAA,EAAU,YAAA,EAAa,SAAA,EAAW,GAAG,gDAAA,EAAkD,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAEpH;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AAC/E,EAAA,uBACC,GAAA,CAAC,SAAA,EAAA,EAAQ,WAAA,EAAU,eAAA,EAAgB,SAAA,EAAW,GAAG,oCAAA,EAAsC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAEhH","file":"table.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Table({\n\tclassName,\n\t...props\n}: React.ComponentProps<'table'> & { containerProps?: React.ComponentProps<'div'> }) {\n\treturn <table data-slot
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/table.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,SAAS,KAAA,CAAM;AAAA,EACd,SAAA;A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AAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA,iCAAA,CAAA;AAAA,QAEA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,SAAA,CAAU,EAAE,SAAA,EAAW,GAAG,OAAM,EAA+B;AACvE,EAAA,uBACC,GAAA,CAAC,IAAA,EAAA,EAAG,WAAA,EAAU,YAAA,EAAa,SAAA,EAAW,GAAG,gDAAA,EAAkD,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAEpH;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoC;AAC/E,EAAA,uBACC,GAAA,CAAC,SAAA,EAAA,EAAQ,WAAA,EAAU,eAAA,EAAgB,SAAA,EAAW,GAAG,oCAAA,EAAsC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAEhH","file":"table.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Table({\n\tclassName,\n\t...props\n}: React.ComponentProps<'table'> & { containerProps?: React.ComponentProps<'div'> }) {\n\treturn <table data-slot=\"table\" className={cn('w-full caption-bottom text-sm', className)} {...props} />;\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn <thead data-slot=\"table-header\" className={cn(className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n\treturn <tbody data-slot=\"table-body\" className={cn('[&_tr:last-child]:border-0', className)} {...props} />;\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t`text-muted-foreground h-12 px-3 text-left align-middle font-medium has-[role=checkbox]:w-px\n\t\t\t\t[&:has([role=checkbox])]:pr-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n\treturn (\n\t\t<td data-slot=\"table-cell\" className={cn('p-3 align-middle [&:has([role=checkbox])]:pr-0', className)} {...props} />\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n\treturn (\n\t\t<caption data-slot=\"table-caption\" className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />\n\t);\n}\n\nexport { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/tabs.tsx"],"names":["TabsPrimitive"],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AACvF,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,MAAA,EAAO,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACzG;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AAC3F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,IAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,kGAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAmD;AAC7F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,GAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,2GAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqD;AAC/F,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,KAAA,EAAd,EAAoB,WAAA,EAAU,cAAA,EAAe,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClH","file":"tabs.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn <TabsPrimitive.Root data-slot
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/tabs.tsx"],"names":["TabsPrimitive"],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AACvF,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,IAAA,EAAd,EAAmB,WAAA,EAAU,MAAA,EAAO,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AACzG;AAEA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAoD;AAC3F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,IAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,kGAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAmD;AAC7F,EAAA,uBACC,GAAA;AAAA,IAACA,MAAA,CAAc,GAAA;AAAA,IAAd;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA;AAAA,2GAAA,CAAA;AAAA,QAIA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqD;AAC/F,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAc,KAAA,EAAd,EAAoB,WAAA,EAAU,cAAA,EAAe,SAAA,EAAW,EAAA,CAAG,qBAAA,EAAuB,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAClH","file":"tabs.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from '@base-ui/react/tabs';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n\treturn <TabsPrimitive.Root data-slot=\"tabs\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tdata-slot=\"tabs-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'bg-muted text-muted-foreground/70 inline-flex w-fit items-center justify-center rounded-md p-0.5',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tdata-slot=\"tabs-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t`hover:text-muted-foreground data-[active]:bg-background data-[active]:text-foreground\n\t\t\t\tfocus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center justify-center rounded-sm px-3\n\t\t\t\tpy-1.5 text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px]\n\t\t\t\tdata-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[active]:shadow-xs [&_svg]:shrink-0`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>) {\n\treturn <TabsPrimitive.Panel data-slot=\"tabs-content\" className={cn('flex-1 outline-none', className)} {...props} />;\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"]}
|
|
@@ -6,9 +6,7 @@ import { CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } fr
|
|
|
6
6
|
import { PopoverContent } from './popover.js';
|
|
7
7
|
import 'class-variance-authority/types';
|
|
8
8
|
import 'class-variance-authority';
|
|
9
|
-
import '
|
|
10
|
-
import '@base-ui/react/autocomplete';
|
|
11
|
-
import './autocomplete.js';
|
|
9
|
+
import 'cmdk';
|
|
12
10
|
import '@base-ui/react/popover';
|
|
13
11
|
|
|
14
12
|
type TagsProps = {
|