@codefast/ui 0.1.49 → 0.1.51
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/{chunk-UZ2CW6TS.js → chunk-BHLW3MWI.js} +2 -2
- package/dist/{chunk-UZ2CW6TS.js.map → chunk-BHLW3MWI.js.map} +1 -1
- package/dist/{chunk-VA36YONO.cjs → chunk-E2QRPDUI.cjs} +1 -1
- package/dist/{chunk-VA36YONO.cjs.map → chunk-E2QRPDUI.cjs.map} +1 -1
- package/dist/chunk-EEDKRHHZ.cjs +2 -0
- package/dist/chunk-EEDKRHHZ.cjs.map +1 -0
- package/dist/{chunk-A5RTV4IE.js → chunk-FSXJI6UE.js} +1 -1
- package/dist/{chunk-A5RTV4IE.js.map → chunk-FSXJI6UE.js.map} +1 -1
- package/dist/chunk-GV5FQF4J.js +2 -0
- package/dist/chunk-GV5FQF4J.js.map +1 -0
- package/dist/chunk-HO5BFEZO.cjs +4 -0
- package/dist/chunk-HO5BFEZO.cjs.map +1 -0
- package/dist/chunk-KASTA74M.cjs +2 -0
- package/dist/chunk-KASTA74M.cjs.map +1 -0
- package/dist/chunk-OUWUINGX.cjs +2 -0
- package/dist/chunk-OUWUINGX.cjs.map +1 -0
- package/dist/{chunk-3TS74A2W.cjs → chunk-PYKB3C2F.cjs} +2 -2
- package/dist/{chunk-3TS74A2W.cjs.map → chunk-PYKB3C2F.cjs.map} +1 -1
- package/dist/chunk-TTKMKXCU.js +2 -0
- package/dist/chunk-TTKMKXCU.js.map +1 -0
- package/dist/{chunk-3TOWLKUY.js → chunk-UHHMORLE.js} +2 -2
- package/dist/chunk-WNXJ2WHS.js +4 -0
- package/dist/chunk-WNXJ2WHS.js.map +1 -0
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/breadcrumb.d.cts +1 -1
- package/dist/components/breadcrumb.d.ts +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.d.cts +2 -2
- package/dist/components/calendar.d.ts +2 -2
- package/dist/components/calendar.js +1 -1
- package/dist/components/chart.cjs +1 -1
- package/dist/components/chart.d.cts +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/command.d.cts +1 -1
- package/dist/components/command.d.ts +1 -1
- package/dist/components/context-menu.d.cts +1 -1
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/dialog.d.cts +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/drawer.d.cts +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/dropdown-menu.d.cts +1 -1
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/form.d.cts +2 -2
- package/dist/components/form.d.ts +2 -2
- package/dist/components/hover-card.d.cts +1 -1
- package/dist/components/hover-card.d.ts +1 -1
- package/dist/components/input-otp.cjs +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/menubar.d.cts +1 -1
- package/dist/components/menubar.d.ts +1 -1
- package/dist/components/popover.d.cts +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.d.cts +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sidebar.cjs +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/table.d.cts +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/tooltip.d.cts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +20 -20
- package/dist/chunk-2XO4KTBF.js +0 -4
- package/dist/chunk-2XO4KTBF.js.map +0 -1
- package/dist/chunk-3SJHSQTX.cjs +0 -4
- package/dist/chunk-3SJHSQTX.cjs.map +0 -1
- package/dist/chunk-LOFRT7V5.js +0 -2
- package/dist/chunk-LOFRT7V5.js.map +0 -1
- package/dist/chunk-SQURQUD2.js +0 -2
- package/dist/chunk-SQURQUD2.js.map +0 -1
- package/dist/chunk-V2AN2A7C.cjs +0 -2
- package/dist/chunk-V2AN2A7C.cjs.map +0 -1
- package/dist/chunk-VFQ5AO6A.cjs +0 -2
- package/dist/chunk-VFQ5AO6A.cjs.map +0 -1
- package/dist/chunk-X2F3KWSW.cjs +0 -2
- package/dist/chunk-X2F3KWSW.cjs.map +0 -1
- /package/dist/{chunk-3TOWLKUY.js.map → chunk-UHHMORLE.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/chart.tsx"],"names":["createContext","forwardRef","useContext","useId","useMemo","RechartsPrimitive","Fragment","jsx","jsxs","THEMES","ChartContext","useChart","context","ChartContainer","children","className","config","id","props","ref","uniqueId","chartId","cn","ChartStyle","cssString","generateCSS","ChartTooltip","ChartTooltipContent","active","color","formatter","hideIndicator","hideLabel","indicator","label","labelClassName","labelFormatter","labelKey","nameKey","payload","tooltipLabel","item","key","itemConfig","getPayloadConfigFromPayload","value","nestLabel","index","indicatorColor","ChartLegend","ChartLegendContent","hideIcon","verticalAlign","isValidObject","nestedPayload","configLabelKey","getConfigLabelKey","obj","generateThemeCSS","theme","configEntries","rules","themeOrColorConfig","_","allRules","themeCSS"],"mappings":"wCAEA,OAGE,iBAAAA,EAEA,cAAAC,EAGA,cAAAC,EACA,SAAAC,EACA,WAAAC,MACK,QACP,UAAYC,MAAuB,WA6D3B,OAmJU,YAAAC,EA9HR,OAAAC,EArBF,QAAAC,MAAA,oBAxDR,IAAMC,EAAS,CACb,MAAO,GACP,KAAM,OACR,EAwBMC,EAAeV,EAAwC,IAAI,EAEjE,SAASW,GAA8B,CACrC,IAAMC,EAAUV,EAAWQ,CAAY,EAEvC,GAAI,CAACE,EACH,MAAM,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U,CACrC,IAAMM,EAAWP,EAAiBC,EAAgB1C,EAAI6C,CAAkB,EAExEE,EAAS,KAAKC,CAAQ,CACxB,CAAC,EAEMD,EAAS,KAAK;AAAA,CAAI,CAC3B","sourcesContent":["'use client';\n\nimport {\n type ComponentProps,\n type ComponentType,\n createContext,\n type CSSProperties,\n forwardRef,\n type JSX,\n type ReactNode,\n useContext,\n useId,\n useMemo,\n} from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { type NameType, type Payload, type ValueType } from 'recharts/types/component/DefaultTooltipContent';\n\nimport { cn } from '@/lib/utils';\n\nconst THEMES = {\n light: '',\n dark: '.dark',\n} as const;\n\ntype Theme = keyof typeof THEMES;\n\ntype ChartConfig = {\n [k in string]: {\n icon?: ComponentType;\n label?: ReactNode;\n } & (\n | {\n color?: string;\n theme?: never;\n }\n | {\n theme: Record<Theme, string>;\n color?: never;\n }\n );\n};\n\ninterface ChartContextProps {\n config: ChartConfig;\n}\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart(): ChartContextProps {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\ntype ChartContainerElement = HTMLDivElement;\ninterface ChartContainerProps extends ComponentProps<'div'> {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n config: ChartConfig;\n}\n\nconst ChartContainer = forwardRef<ChartContainerElement, ChartContainerProps>(\n ({ children, className, config, id, ...props }, ref) => {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n 'flex aspect-video justify-center text-xs',\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n '[&_.recharts-cartesian-grid_line]:stroke-border/50',\n '[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n '[&_.recharts-dot]:stroke-transparent',\n '[&_.recharts-layer]:outline-none',\n '[&_.recharts-polar-grid_]:stroke-border',\n '[&_.recharts-radial-bar-background-sector]:fill-muted',\n '[&_.recharts-reference-line_]:stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted',\n '[&_.recharts-sector]:outline-none',\n '[&_.recharts-sector]:stroke-transparent',\n '[&_.recharts-surface]:outline-none',\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n },\n);\n\nChartContainer.displayName = 'Chart';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\ninterface ChartStyleProps {\n config: ChartConfig;\n id: string;\n}\n\nfunction ChartStyle({ id, config }: ChartStyleProps): JSX.Element | null {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipProps = ComponentProps<typeof RechartsPrimitive.Tooltip>;\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipContentElement = HTMLDivElement;\ninterface ChartTooltipContentProps\n extends ComponentProps<typeof RechartsPrimitive.Tooltip>,\n Omit<ComponentProps<'div'>, 'content'> {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n labelKey?: string;\n nameKey?: string;\n}\n\nconst ChartTooltipContent = forwardRef<ChartTooltipContentElement, ChartTooltipContentProps>(\n (\n {\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = 'dot',\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n if (!item) {\n return null;\n }\n\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\n\nChartTooltipContent.displayName = 'ChartTooltipContent';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendContent = HTMLDivElement;\ninterface ChartLegendContentProps\n extends ComponentProps<'div'>,\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> {\n hideIcon?: boolean;\n nameKey?: string;\n}\n\nconst ChartLegendContent = forwardRef<HTMLDivElement, ChartLegendContentProps>(\n ({ className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}\n >\n {payload.map((item) => {\n let key = 'value';\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nChartLegendContent.displayName = 'ChartLegendContent';\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n):\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n color?: string;\n theme?: never;\n })\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n theme: Record<Theme, string>;\n color?: never;\n })\n | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = 'payload' in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === 'string') {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === 'string') {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n configEntries.forEach(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme] || itemConfig.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n });\n\n rules.push('}');\n\n return rules.join('\\n');\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, { theme, color }]) => theme || color);\n\n const allRules: string[] = [];\n\n Object.keys(THEMES).forEach((theme) => {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n });\n\n return allRules.join('\\n');\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n type ChartContainerProps,\n type ChartLegendContentProps,\n type ChartLegendProps,\n type ChartStyleProps,\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n};\n"]}
|
package/dist/chunk-3SJHSQTX.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _react = require('react');var _recharts = require('recharts'); var f = _interopRequireWildcard(_recharts);var _jsxruntime = require('react/jsx-runtime');var N={light:"",dark:".dark"},_=_react.createContext.call(void 0, null);function w(){let e=_react.useContext.call(void 0, _);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}var $=_react.forwardRef.call(void 0, ({children:e,className:n,config:t,id:o,...a},l)=>{let s=_react.useId.call(void 0, ),c=`chart-${o||s.replace(/:/g,"")}`;return _jsxruntime.jsx.call(void 0, _.Provider,{value:{config:t},children:_jsxruntime.jsxs.call(void 0, "div",{ref:l,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex aspect-video justify-center text-xs","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-cartesian-grid_line]:stroke-border/50","[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border","[&_.recharts-dot]:stroke-transparent","[&_.recharts-layer]:outline-none","[&_.recharts-polar-grid_]:stroke-border","[&_.recharts-radial-bar-background-sector]:fill-muted","[&_.recharts-reference-line_]:stroke-border","[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted","[&_.recharts-sector]:outline-none","[&_.recharts-sector]:stroke-transparent","[&_.recharts-surface]:outline-none",n),"data-chart":c,...a,children:[_jsxruntime.jsx.call(void 0, I,{config:t,id:c}),_jsxruntime.jsx.call(void 0, f.ResponsiveContainer,{children:e})]})})});$.displayName="Chart";function I({id:e,config:n}){let t=_react.useMemo.call(void 0, ()=>J(e,n),[e,n]);return _jsxruntime.jsx.call(void 0, "style",{dangerouslySetInnerHTML:{__html:t}})}var G=f.Tooltip,O= exports.d =_react.forwardRef.call(void 0, ({active:e,className:n,color:t,formatter:o,hideIndicator:a=!1,hideLabel:l=!1,indicator:s="dot",label:c,labelClassName:p,labelFormatter:h,labelKey:y,nameKey:E,payload:u},j)=>{let{config:m}=w(),R=_react.useMemo.call(void 0, ()=>{if(l||!_optionalChain([u, 'optionalAccess', _2 => _2.length]))return null;let[r]=u;if(!r)return null;let P=`${y||r.dataKey||r.name||"value"}`,b=T(m,r,P),C=!y&&typeof c=="string"?_optionalChain([m, 'access', _3 => _3[c], 'optionalAccess', _4 => _4.label])||c:_optionalChain([b, 'optionalAccess', _5 => _5.label]);return h?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:h(C,u)}):C?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:C}):null},[m,l,c,p,h,y,u]);if(!e||!_optionalChain([u, 'optionalAccess', _6 => _6.length]))return null;let v=u.length===1&&s!=="dot";return _jsxruntime.jsxs.call(void 0, "div",{ref:j,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",n),children:[v?null:R,_jsxruntime.jsx.call(void 0, "div",{className:"grid gap-1.5",children:u.map((r,P)=>{let b=`${E||r.name||r.dataKey||"value"}`,C=T(m,r,b),S=t||r.payload.fill||r.color;return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",s==="dot"&&"items-center"),children:o&&r.value!==void 0&&r.name?o(r.value,r.name,r,P,r.payload):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_optionalChain([C, 'optionalAccess', _7 => _7.icon])?_jsxruntime.jsx.call(void 0, C.icon,{}):!a&&_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":s==="dot","w-1":s==="line","w-0 border-[1.5px] border-dashed bg-transparent":s==="dashed","my-0.5":v&&s==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),_jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-1 justify-between leading-none",v?"items-end":"items-center"),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"grid gap-1.5",children:[v?R:null,_jsxruntime.jsx.call(void 0, "span",{className:"text-muted-foreground",children:_optionalChain([C, 'optionalAccess', _8 => _8.label])||r.name})]}),r.value?_jsxruntime.jsx.call(void 0, "span",{className:"text-foreground font-mono font-medium tabular-nums",children:r.value.toLocaleString()}):null]})]})},r.dataKey)})})]})});O.displayName="ChartTooltipContent";var Q=f.Legend,D= exports.f =_react.forwardRef.call(void 0, ({className:e,hideIcon:n=!1,nameKey:t,payload:o,verticalAlign:a="bottom"},l)=>{let{config:s}=w();return _optionalChain([o, 'optionalAccess', _9 => _9.length])?_jsxruntime.jsx.call(void 0, "div",{ref:l,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:o.map(c=>{let p="value";t?p=t:c.dataKey&&(p=String(c.dataKey));let h=T(s,c,p);return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3"),children:[_optionalChain([h, 'optionalAccess', _10 => _10.icon])&&!n?_jsxruntime.jsx.call(void 0, h.icon,{}):_jsxruntime.jsx.call(void 0, "div",{className:"size-2 shrink-0 rounded",style:{backgroundColor:c.color}}),_optionalChain([h, 'optionalAccess', _11 => _11.label])]},String(c.value))})}):null});D.displayName="ChartLegendContent";function T(e,n,t){if(!L(n))return;let o="payload"in n&&L(n.payload)?n.payload:void 0,a=V(n,o,t);return a in e?e[a]:e[t]}function L(e){return typeof e=="object"&&e!==null}function V(e,n,t){return t in e&&typeof e[t]=="string"?e[t]:n&&t in n&&typeof n[t]=="string"?n[t]:t}function z(e,n,t){let o=[];return o.push(`${N[e]} [data-chart=${n}] {`),t.forEach(([a,l])=>{let s=_optionalChain([l, 'access', _12 => _12.theme, 'optionalAccess', _13 => _13[e]])||l.color;s&&o.push(` --color-${a}: ${s};`)}),o.push("}"),o.join(`
|
|
2
|
-
`)}function J(e,n){let t=Object.entries(n).filter(([a,{theme:l,color:s}])=>l||s),o=[];return Object.keys(N).forEach(a=>{let l=z(a,e,t);o.push(l)}),o.join(`
|
|
3
|
-
`)}exports.a = $; exports.b = I; exports.c = G; exports.d = O; exports.e = Q; exports.f = D;
|
|
4
|
-
//# sourceMappingURL=chunk-3SJHSQTX.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3SJHSQTX.cjs","../src/components/chart.tsx"],"names":["RechartsPrimitive","createContext","useChart","ChartContainer","children","className","id","ref","uniqueId","useId","chartId","jsx","ChartContext"],"mappings":"AAAA,22BAAY,CAAC,wDCKX,8BASUA,gFAgNM,+CA1MhB,IACA,CAAA,CAAA,CAAA,KAAM,CAAA,EACR,CAAA,IAwBqBC,CAAwC,OAE7D,CAAA,CAAA,CAAA,CAAA,kCAAA,IAASC,CAA8B,CACrC,SAAuC,CAAA,CAEvC,CAAA,CAAA,IACE,CAAA,CAAA,+BAAA,CAAA,CAAM,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,MAAM,IAAA,KAAA,CAAA,mDAgBpB,CAAA,CAAMC,OACD,CAAA,CAAA,IAAA,CAAA,CAAAC,+BAAAA,CAAU,CAAA,QAAAC,CAAAA,CAAW,CAAA,SAAQ,CAAA,CAAAC,CAAAA,MAAa,CAAGC,CAAAA,CAAAA,EAAQ,CACtD,CAAA,CAAA,GAAMC,CAAWC,CAAAA,CAAM,CAAA,CACjBC,EAAU,CAAA,IAAA,CAAA,CAAA,0BAAA,CAASJ,CAAAA,CAAME,CAAAA,CAAS,MAAA,EAAQ,CAAA,EAAA,CAAA,CAAM,OAEtD,CAAA,IAAA,CACEG,EAACC,CAAAA,CAAa,CAAA;AAoZG;AACvB","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-3SJHSQTX.cjs","sourcesContent":[null,"'use client';\n\nimport {\n type ComponentProps,\n type ComponentType,\n createContext,\n type CSSProperties,\n forwardRef,\n type JSX,\n type ReactNode,\n useContext,\n useId,\n useMemo,\n} from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { type NameType, type Payload, type ValueType } from 'recharts/types/component/DefaultTooltipContent';\n\nimport { cn } from '@/lib/utils';\n\nconst THEMES = {\n light: '',\n dark: '.dark',\n} as const;\n\ntype Theme = keyof typeof THEMES;\n\ntype ChartConfig = {\n [k in string]: {\n icon?: ComponentType;\n label?: ReactNode;\n } & (\n | {\n color?: string;\n theme?: never;\n }\n | {\n theme: Record<Theme, string>;\n color?: never;\n }\n );\n};\n\ninterface ChartContextProps {\n config: ChartConfig;\n}\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart(): ChartContextProps {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\ntype ChartContainerElement = HTMLDivElement;\ninterface ChartContainerProps extends ComponentProps<'div'> {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n config: ChartConfig;\n}\n\nconst ChartContainer = forwardRef<ChartContainerElement, ChartContainerProps>(\n ({ children, className, config, id, ...props }, ref) => {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n 'flex aspect-video justify-center text-xs',\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n '[&_.recharts-cartesian-grid_line]:stroke-border/50',\n '[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n '[&_.recharts-dot]:stroke-transparent',\n '[&_.recharts-layer]:outline-none',\n '[&_.recharts-polar-grid_]:stroke-border',\n '[&_.recharts-radial-bar-background-sector]:fill-muted',\n '[&_.recharts-reference-line_]:stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted',\n '[&_.recharts-sector]:outline-none',\n '[&_.recharts-sector]:stroke-transparent',\n '[&_.recharts-surface]:outline-none',\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n },\n);\n\nChartContainer.displayName = 'Chart';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\ninterface ChartStyleProps {\n config: ChartConfig;\n id: string;\n}\n\nfunction ChartStyle({ id, config }: ChartStyleProps): JSX.Element | null {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipProps = ComponentProps<typeof RechartsPrimitive.Tooltip>;\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipContentElement = HTMLDivElement;\ninterface ChartTooltipContentProps\n extends ComponentProps<typeof RechartsPrimitive.Tooltip>,\n Omit<ComponentProps<'div'>, 'content'> {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n labelKey?: string;\n nameKey?: string;\n}\n\nconst ChartTooltipContent = forwardRef<ChartTooltipContentElement, ChartTooltipContentProps>(\n (\n {\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = 'dot',\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n if (!item) {\n return null;\n }\n\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\n\nChartTooltipContent.displayName = 'ChartTooltipContent';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendContent = HTMLDivElement;\ninterface ChartLegendContentProps\n extends ComponentProps<'div'>,\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> {\n hideIcon?: boolean;\n nameKey?: string;\n}\n\nconst ChartLegendContent = forwardRef<HTMLDivElement, ChartLegendContentProps>(\n ({ className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}\n >\n {payload.map((item) => {\n let key = 'value';\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nChartLegendContent.displayName = 'ChartLegendContent';\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n):\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n color?: string;\n theme?: never;\n })\n | ({\n icon?: ComponentType;\n label?: ReactNode;\n } & {\n theme: Record<Theme, string>;\n color?: never;\n })\n | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = 'payload' in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === 'string') {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === 'string') {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n configEntries.forEach(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme] || itemConfig.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n });\n\n rules.push('}');\n\n return rules.join('\\n');\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, { theme, color }]) => theme || color);\n\n const allRules: string[] = [];\n\n Object.keys(THEMES).forEach((theme) => {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n });\n\n return allRules.join('\\n');\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n type ChartContainerProps,\n type ChartLegendContentProps,\n type ChartLegendProps,\n type ChartStyleProps,\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n};\n"]}
|
package/dist/chunk-LOFRT7V5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{a as c}from"./chunk-EVRI6TWT.js";import{a as o}from"./chunk-VPYH6JWS.js";import{ChevronDownIcon as m,ChevronLeftIcon as p,ChevronRightIcon as f,ChevronUpIcon as g,DotFilledIcon as y}from"@radix-ui/react-icons";import{format as i}from"date-fns";import{useEffect as b,useRef as C}from"react";import{DayFlag as u,DayPicker as x,SelectionState as d,UI as t}from"react-day-picker";import{jsx as a,jsxs as D}from"react/jsx-runtime";function P({orientation:e,...n}){switch(e){case"up":return a(g,{className:"size-4",...n});case"down":return a(m,{className:"size-4",...n});case"left":return a(p,{className:"size-4",...n});case"right":return a(f,{className:"size-4",...n});default:return a(y,{className:"size-4",...n})}}function h({modifiers:e,className:n,day:r,...s}){let l=C(null);return b(()=>{e.focused&&l.current?.focus()},[e.focused]),a("button",{ref:l,className:c({icon:!0,size:"sm",variant:e.selected&&!e.range_middle?"default":"ghost",className:["focus-visible:ring-1 focus-visible:ring-offset-0",(!e.selected||e.range_middle)&&[e.today?"bg-accent":"hover:border-accent hover:bg-transparent",e.outside&&"text-opacity-30"],e.range_middle&&"bg-transparent",n]}),type:"button",...s})}function M({className:e,classNames:n,...r}){return a(x,{className:o("p-3",e),classNames:{[u.outside]:o(!r.mode&&"text-opacity-30"),[u.today]:o(!r.mode&&"bg-accent rounded-md"),[d.range_end]:"to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md",[d.range_middle]:"bg-accent first:rounded-l-md last:rounded-r-md",[d.range_start]:"to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md",[t.CaptionLabel]:"inline-flex items-center",[t.Day]:o("py-0",!r.mode&&"text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium"),[t.DayButton]:"border border-transparent",[t.Dropdown]:"absolute size-full appearance-none opacity-0",[t.DropdownRoot]:"relative inline-flex",[t.Dropdowns]:"inline-flex items-center gap-2",[t.Footer]:"text-sm",[t.Month]:"grid grid-rows-[2rem_1fr] gap-4",[t.MonthCaption]:"flex w-full justify-center text-sm font-medium",[t.MonthGrid]:"relative block table-fixed border-collapse space-y-2 [&>thead]:block",[t.Months]:"relative flex flex-wrap gap-4",[t.Nav]:"-mr-4",[t.NextMonthButton]:c({className:"absolute end-0",icon:!0,size:"xs",variant:"outline"}),[t.PreviousMonthButton]:c({className:"absolute start-0",icon:!0,size:"xs",variant:"outline"}),[t.Root]:"inline-grid gap-4",[t.Week]:"flex",[t.WeekNumber]:"text-foreground/50 size-9 text-center text-xs",[t.Weekday]:"text-muted-foreground flex-1 text-sm font-normal",[t.Weekdays]:"flex",[t.Weeks]:"block space-y-2",...n},components:{Chevron:P,DayButton:h},...r})}function _({date:e,formatStr:n="LLL dd, y",placeholder:r="Pick a date"}){if(!e?.from)return a("span",{className:"truncate",children:r});let s=i(e.from,n);if(!e.to)return a("span",{className:"truncate",children:s});let l=i(e.to,n);return D("span",{className:"truncate",children:[s," - ",l]})}function B({date:e,formatStr:n="PPP",placeholder:r="Pick a date"}){return e?a("span",{className:"truncate",children:i(e,n)}):a("span",{className:"truncate",children:r})}export{M as a,_ as b,B as c};
|
|
2
|
-
//# sourceMappingURL=chunk-LOFRT7V5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/calendar.tsx"],"names":["ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","ChevronUpIcon","DotFilledIcon","format","useEffect","useRef","DayFlag","DayPicker","SelectionState","UI","jsx","jsxs","Chevron","orientation","props","DayButton","modifiers","className","_","buttonRef","buttonVariants","Calendar","classNames","cn","CalendarRangeLabel","date","formatStr","placeholder","formattedFromDate","formattedToDate","CalendarLabel"],"mappings":"gFAEA,OACE,mBAAAA,EACA,mBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,iBAAAC,MACK,wBACP,OAAS,UAAAC,MAAc,WACvB,OAAwC,aAAAC,EAAW,UAAAC,MAAc,QACjE,OAIE,WAAAC,EACA,aAAAC,EAGA,kBAAAC,EACA,MAAAC,MACK,mBAcM,cAAAC,EAoJT,QAAAC,MApJS,oBAHb,SAASC,EAAQ,CAAE,YAAAC,EAAa,GAAGC,CAAM,EAA8B,CACrE,OAAQD,EAAa,CACnB,IAAK,KACH,OAAOH,EAACT,EAAA,CAAc,UAAU,SAAU,GAAGa,EAAO,EAGtD,IAAK,OACH,OAAOJ,EAACZ,EAAA,CAAgB,UAAU,SAAU,GAAGgB,EAAO,EAGxD,IAAK,OACH,OAAOJ,EAACX,EAAA,CAAgB,UAAU,SAAU,GAAGe,EAAO,EAGxD,IAAK,QACH,OAAOJ,EAACV,EAAA,CAAiB,UAAU,SAAU,GAAGc,EAAO,EAGzD,QACE,OAAOJ,EAACR,EAAA,CAAc,UAAU,SAAU,GAAGY,EAAO,CACxD,CACF,CAWA,SAASC,EAAU,CAAE,UAAAC,EAAW,UAAAC,EAAW,IAAKC,EAAG,GAAGJ,CAAM,EAAgC,CAC1F,IAAMK,EAAYd,EAA0B,IAAI,EAEhD,OAAAD,EAAU,IAAM,CACVY,EAAU,SACZG,EAAU,SAAS,MAAM,CAE7B,EAAG,CAACH,EAAU,OAAO,CAAC,EAGpBN,EAAC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KACN,QAAS,SACX,CAAC,EACD,CAACX,EAAG,IAAI,EAAG,oBACX,CAACA,EAAG,IAAI,EAAG,OACX,CAACA,EAAG,UAAU,EAAG,gDACjB,CAACA,EAAG,OAAO,EAAG,mDACd,CAACA,EAAG,QAAQ,EAAG,OACf,CAACA,EAAG,KAAK,EAAG,kBACZ,GAAGa,CACL,EACA,WAAY,CAAE,QAAAV,EAAS,UAAAG,CAAU,EAChC,GAAGD,EACN,CAEJ,CAYA,SAASU,EAAmB,CAC1B,KAAAC,EACA,UAAAC,EAAY,YACZ,YAAAC,EAAc,aAChB,EAAkD,CAChD,GAAI,CAACF,GAAM,KACT,OAAOf,EAAC,QAAK,UAAU,WAAY,SAAAiB,EAAY,EAGjD,IAAMC,EAAoBzB,EAAOsB,EAAK,KAAMC,CAAS,EAErD,GAAI,CAACD,EAAK,GACR,OAAOf,EAAC,QAAK,UAAU,WAAY,SAAAkB,EAAkB,EAGvD,IAAMC,EAAkB1B,EAAOsB,EAAK,GAAIC,CAAS,EAEjD,OACEf,EAAC,QAAK,UAAU,WACb,UAAAiB,EAAkB,MAAIC,GACzB,CAEJ,CAYA,SAASC,EAAc,CACrB,KAAAL,EACA,UAAAC,EAAY,MACZ,YAAAC,EAAc,aAChB,EAA6C,CAC3C,OAAKF,EAIEf,EAAC,QAAK,UAAU,WAAY,SAAAP,EAAOsB,EAAMC,CAAS,EAAE,EAHlDhB,EAAC,QAAK,UAAU,WAAY,SAAAiB,EAAY,CAInD","sourcesContent":["'use client';\n\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { format } from 'date-fns';\nimport { type ComponentProps, type JSX, useEffect, useRef } from 'react';\nimport {\n type CalendarDay,\n type CustomComponents,\n type DateRange,\n DayFlag,\n DayPicker,\n type DayPickerProps,\n type Matcher,\n SelectionState,\n UI,\n} from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\ntype ChevronProps = ComponentProps<CustomComponents['Chevron']>;\n\nfunction Chevron({ orientation, ...props }: ChevronProps): JSX.Element {\n switch (orientation) {\n case 'up': {\n return <ChevronUpIcon className=\"size-4\" {...props} />;\n }\n\n case 'down': {\n return <ChevronDownIcon className=\"size-4\" {...props} />;\n }\n\n case 'left': {\n return <ChevronLeftIcon className=\"size-4\" {...props} />;\n }\n\n case 'right': {\n return <ChevronRightIcon className=\"size-4\" {...props} />;\n }\n\n default:\n return <DotFilledIcon className=\"size-4\" {...props} />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DayButton\n * -------------------------------------------------------------------------- */\n\ninterface DayButtonProps extends ComponentProps<'button'> {\n day: CalendarDay;\n modifiers: Record<DayFlag | SelectionState, boolean>;\n}\n\nfunction DayButton({ modifiers, className, day: _, ...props }: DayButtonProps): JSX.Element {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) {\n buttonRef.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <button\n ref={buttonRef}\n className={buttonVariants({\n icon: true,\n size: 'sm',\n variant: modifiers.selected && !modifiers.range_middle ? 'default' : 'ghost',\n className: [\n 'focus-visible:ring-1 focus-visible:ring-offset-0',\n (!modifiers.selected || modifiers.range_middle) && [\n modifiers.today ? 'bg-accent' : 'hover:border-accent hover:bg-transparent',\n modifiers.outside && 'text-opacity-30',\n ],\n modifiers.range_middle && 'bg-transparent',\n className,\n ],\n })}\n type=\"button\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\ntype CalendarProps = DayPickerProps;\n\nfunction Calendar({ className, classNames, ...props }: CalendarProps): JSX.Element {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n [DayFlag.outside]: cn(!props.mode && 'text-opacity-30'),\n [DayFlag.today]: cn(!props.mode && 'bg-accent rounded-md'),\n [SelectionState.range_end]:\n 'to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md',\n [SelectionState.range_middle]: 'bg-accent first:rounded-l-md last:rounded-r-md',\n [SelectionState.range_start]:\n 'to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md',\n [UI.CaptionLabel]: 'inline-flex items-center',\n [UI.Day]: cn(\n 'py-0',\n !props.mode && 'text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium',\n ),\n [UI.DayButton]: 'border border-transparent',\n [UI.Dropdown]: 'absolute size-full appearance-none opacity-0',\n [UI.DropdownRoot]: 'relative inline-flex',\n [UI.Dropdowns]: 'inline-flex items-center gap-2',\n [UI.Footer]: 'text-sm',\n [UI.Month]: 'grid grid-rows-[2rem_1fr] gap-4',\n [UI.MonthCaption]: 'flex w-full justify-center text-sm font-medium',\n [UI.MonthGrid]: 'relative block table-fixed border-collapse space-y-2 [&>thead]:block',\n [UI.Months]: 'relative flex flex-wrap gap-4',\n [UI.Nav]: '-mr-4',\n [UI.NextMonthButton]: buttonVariants({\n className: 'absolute end-0',\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n className: 'absolute start-0',\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.Root]: 'inline-grid gap-4',\n [UI.Week]: 'flex',\n [UI.WeekNumber]: 'text-foreground/50 size-9 text-center text-xs',\n [UI.Weekday]: 'text-muted-foreground flex-1 text-sm font-normal',\n [UI.Weekdays]: 'flex',\n [UI.Weeks]: 'block space-y-2',\n ...classNames,\n }}\n components={{ Chevron, DayButton }}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarRangeLabelProps {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarRangeLabel({\n date,\n formatStr = 'LLL dd, y',\n placeholder = 'Pick a date',\n}: CalendarRangeLabelProps): string | JSX.Element {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarLabelProps {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarLabel({\n date,\n formatStr = 'PPP',\n placeholder = 'Pick a date',\n}: CalendarLabelProps): string | JSX.Element {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Calendar,\n CalendarLabel,\n CalendarRangeLabel,\n type CalendarLabelProps,\n type CalendarProps,\n type CalendarRangeLabelProps,\n type DateRange,\n type Matcher,\n};\n"]}
|
package/dist/chunk-SQURQUD2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-EVRI6TWT.js";import{a as l}from"./chunk-VPYH6JWS.js";import{CaretSortIcon as d,CheckIcon as P,ChevronDownIcon as f,ChevronUpIcon as y}from"@radix-ui/react-icons";import*as e from"@radix-ui/react-select";import{forwardRef as a}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";var R=e.Root,E=e.Group,T=e.Value,u=a(({children:i,className:r,size:o,...p},n)=>c(e.Trigger,{ref:n,className:s({variant:"outline",size:o,className:["w-full justify-between px-3 font-normal",r]}),...p,children:[i,t(e.Icon,{asChild:!0,children:t(d,{className:"size-4 shrink-0 opacity-50"})})]}));u.displayName=e.Trigger.displayName;var m=a(({className:i,...r},o)=>t(e.ScrollUpButton,{ref:o,className:l("flex cursor-pointer items-center justify-center py-1",i),...r,children:t(y,{})}));m.displayName=e.ScrollUpButton.displayName;var S=a(({className:i,...r},o)=>t(e.ScrollDownButton,{ref:o,className:l("flex cursor-pointer items-center justify-center py-1",i),...r,children:t(f,{})}));S.displayName=e.ScrollDownButton.displayName;var v=a(({children:i,className:r,position:o="popper",...p},n)=>t(e.Portal,{children:c(e.Content,{ref:n,className:l("bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md","data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95","data-[state=open]:data-[side=bottom]:slide-in-from-top-2","data-[state=open]:data-[side=left]:slide-in-from-right-2","data-[state=open]:data-[side=right]:slide-in-from-left-2","data-[state=open]:data-[side=top]:slide-in-from-bottom-2","data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95","data-[state=closed]:data-[side=bottom]:slide-out-to-top-2","data-[state=closed]:data-[side=left]:slide-out-to-right-2","data-[state=closed]:data-[side=right]:slide-out-to-left-2","data-[state=closed]:data-[side=top]:slide-out-to-bottom-2",o==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1"],r),position:o,...p,children:[t(m,{}),t(e.Viewport,{className:l("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),t(S,{})]})}));v.displayName=e.Content.displayName;var g=a(({className:i,...r},o)=>t(e.Label,{ref:o,className:l("gap-x-2 px-3 py-1.5","flex items-center text-sm font-semibold",i),...r}));g.displayName=e.Label.displayName;var C=a(({children:i,className:r,...o},p)=>c(e.Item,{ref:p,className:l("relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r),...o,children:[t("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t(e.ItemIndicator,{children:t(P,{className:"size-4"})})}),t(e.ItemText,{children:i})]}));C.displayName=e.Item.displayName;var h=a(({className:i,...r},o)=>t(e.Separator,{ref:o,className:l("bg-muted mx-2 my-1 h-px",i),...r}));h.displayName=e.Separator.displayName;export{R as a,E as b,T as c,u as d,m as e,S as f,v as g,g as h,C as i,h as j};
|
|
2
|
-
//# sourceMappingURL=chunk-SQURQUD2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/select.tsx"],"names":["CaretSortIcon","CheckIcon","ChevronDownIcon","ChevronUpIcon","SelectPrimitive","forwardRef","jsx","jsxs","Select","SelectGroup","SelectValue","SelectTrigger","children","className","size","props","forwardedRef","buttonVariants","SelectScrollUpButton","cn","SelectScrollDownButton","SelectContent","position","SelectLabel","SelectItem","SelectSeparator"],"mappings":"gFAAA,OAAS,iBAAAA,EAAe,aAAAC,EAAW,mBAAAC,EAAiB,iBAAAC,MAAqB,wBACzE,UAAYC,MAAqB,yBACjC,OAAgF,cAAAC,MAAkB,QAqC9F,OAWI,OAAAC,EAXJ,QAAAC,MAAA,oBA3BJ,IAAMC,EAAyB,OAOzBC,EAA8B,QAO9BC,EAA8B,QAW9BC,EAAgBN,EACpB,CAAC,CAAE,SAAAO,EAAU,UAAAC,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IACxCT,EAAiB,UAAhB,CACC,IAAKS,EACL,UAAWC,EAAe,CACxB,QAAS,UACT,KAAAH,EACA,UAAW,CAAC,0CAA2CD,CAAS,CAClE,CAAC,EACA,GAAGE,EAEH,UAAAH,EACDN,EAAiB,OAAhB,CAAqB,QAAO,GAC3B,SAAAA,EAACN,EAAA,CAAc,UAAU,6BAA6B,EACxD,GACF,CAEJ,EAEAW,EAAc,YAA8B,UAAQ,YASpD,IAAMO,EAAuBb,EAC3B,CAAC,CAAE,UAAAQ,EAAW,GAAGE,CAA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C,IAAKS,EACL,UAAWG,EACT,gGACA,kEACA,6DACAN,CACF,EACC,GAAGE,EAEJ,UAAAT,EAAC,QAAK,UAAU,6DACd,SAAAA,EAAiB,gBAAhB,CACC,SAAAA,EAACL,EAAA,CAAU,UAAU,SAAS,EAChC,EACF,EACAK,EAAiB,WAAhB,CAA0B,SAAAM,EAAS,GACtC,CACD,EAEDY,EAAW,YAA8B,OAAK,YAS9C,IAAMC,EAAkBpB,EACtB,CAAC,CAAE,UAAAQ,EAAW,GAAGE,CAAM,EAAGC,IACxBV,EAAiB,YAAhB,CAA0B,IAAKU,EAAc,UAAWG,EAAG,0BAA2BN,CAAS,EAAI,GAAGE,EAAO,CAElH,EAEAU,EAAgB,YAA8B,YAAU","sourcesContent":["import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type ComponentProps, type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = ComponentRef<typeof SelectPrimitive.Trigger>;\ninterface SelectTriggerProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n size?: ButtonVariantsProps['size'];\n}\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ children, className, size, ...props }, forwardedRef) => (\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n className={buttonVariants({\n variant: 'outline',\n size,\n className: ['w-full justify-between px-3 font-normal', className],\n })}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 shrink-0 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n ),\n);\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = ComponentRef<typeof SelectPrimitive.ScrollUpButton>;\ntype SelectScrollUpButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;\n\nconst SelectScrollUpButton = forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollUpButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n ),\n);\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = ComponentRef<typeof SelectPrimitive.ScrollDownButton>;\ntype SelectScrollDownButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;\n\nconst SelectScrollDownButton = forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollDownButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n ),\n);\n\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = ComponentRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;\n\nconst SelectContent = forwardRef<SelectContentElement, SelectContentProps>(\n ({ children, className, position = 'popper', ...props }, forwardedRef) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n 'data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95',\n 'data-[state=open]:data-[side=bottom]:slide-in-from-top-2',\n 'data-[state=open]:data-[side=left]:slide-in-from-right-2',\n 'data-[state=open]:data-[side=right]:slide-in-from-left-2',\n 'data-[state=open]:data-[side=top]:slide-in-from-bottom-2',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:data-[side=bottom]:slide-out-to-top-2',\n 'data-[state=closed]:data-[side=left]:slide-out-to-right-2',\n 'data-[state=closed]:data-[side=right]:slide-out-to-left-2',\n 'data-[state=closed]:data-[side=top]:slide-out-to-bottom-2',\n position === 'popper' && [\n 'data-[side=bottom]:translate-y-1',\n 'data-[side=left]:-translate-x-1',\n 'data-[side=right]:translate-x-1',\n 'data-[side=top]:-translate-y-1',\n ],\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = ComponentRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\nconst SelectLabel = forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n ref={forwardedRef}\n className={cn('gap-x-2 px-3 py-1.5', 'flex items-center text-sm font-semibold', className)}\n {...props}\n />\n));\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = ComponentRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;\n\nconst SelectItem = forwardRef<SelectItemElement, SelectItemProps>(({ children, className, ...props }, forwardedRef) => (\n <SelectPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = ComponentRef<typeof SelectPrimitive.Separator>;\ntype SelectSeparatorProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;\n\nconst SelectSeparator = forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator ref={forwardedRef} className={cn('bg-muted mx-2 my-1 h-px', className)} {...props} />\n ),\n);\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n type SelectContentProps,\n type SelectGroupProps,\n type SelectItemProps,\n type SelectLabelProps,\n type SelectProps,\n type SelectScrollDownButtonProps,\n type SelectScrollUpButtonProps,\n type SelectSeparatorProps,\n type SelectTriggerProps,\n type SelectValueProps,\n};\n"]}
|
package/dist/chunk-V2AN2A7C.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _reactselect = require('@radix-ui/react-select'); var e = _interopRequireWildcard(_reactselect);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var x=e.Root,R= exports.b =e.Group,E= exports.c =e.Value,u= exports.d =_react.forwardRef.call(void 0, ({children:i,className:r,size:o,...p},n)=>_jsxruntime.jsxs.call(void 0, e.Trigger,{ref:n,className:_chunkKF7Y7B3Gcjs.a.call(void 0, {variant:"outline",size:o,className:["w-full justify-between px-3 font-normal",r]}),...p,children:[i,_jsxruntime.jsx.call(void 0, e.Icon,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"size-4 shrink-0 opacity-50"})})]}));u.displayName=e.Trigger.displayName;var m=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.ScrollUpButton,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...r,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{})}));m.displayName=e.ScrollUpButton.displayName;var S=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.ScrollDownButton,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex cursor-pointer items-center justify-center py-1",i),...r,children:_jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{})}));S.displayName=e.ScrollDownButton.displayName;var v=_react.forwardRef.call(void 0, ({children:i,className:r,position:o="popper",...p},n)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsxs.call(void 0, e.Content,{ref:n,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md","data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95","data-[state=open]:data-[side=bottom]:slide-in-from-top-2","data-[state=open]:data-[side=left]:slide-in-from-right-2","data-[state=open]:data-[side=right]:slide-in-from-left-2","data-[state=open]:data-[side=top]:slide-in-from-bottom-2","data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95","data-[state=closed]:data-[side=bottom]:slide-out-to-top-2","data-[state=closed]:data-[side=left]:slide-out-to-right-2","data-[state=closed]:data-[side=right]:slide-out-to-left-2","data-[state=closed]:data-[side=top]:slide-out-to-bottom-2",o==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1"],r),position:o,...p,children:[_jsxruntime.jsx.call(void 0, m,{}),_jsxruntime.jsx.call(void 0, e.Viewport,{className:_chunkDD6AVCRHcjs.a.call(void 0, "p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),_jsxruntime.jsx.call(void 0, S,{})]})}));v.displayName=e.Content.displayName;var g=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","flex items-center text-sm font-semibold",i),...r}));g.displayName=e.Label.displayName;var C=_react.forwardRef.call(void 0, ({children:i,className:r,...o},p)=>_jsxruntime.jsxs.call(void 0, e.Item,{ref:p,className:_chunkDD6AVCRHcjs.a.call(void 0, "relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r),...o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"size-4"})})}),_jsxruntime.jsx.call(void 0, e.ItemText,{children:i})]}));C.displayName=e.Item.displayName;var h=_react.forwardRef.call(void 0, ({className:i,...r},o)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-muted mx-2 my-1 h-px",i),...r}));h.displayName=e.Separator.displayName;exports.a = x; exports.b = R; exports.c = E; exports.d = u; exports.e = m; exports.f = S; exports.g = v; exports.h = g; exports.i = C; exports.j = h;
|
|
2
|
-
//# sourceMappingURL=chunk-V2AN2A7C.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-V2AN2A7C.cjs","../src/components/select.tsx"],"names":["Select","SelectGroup","SelectValue","SelectTrigger","forwardRef","children","className","size","props","forwardedRef","jsxs","buttonVariants","jsx","CaretSortIcon","SelectScrollUpButton","cn","ChevronUpIcon","SelectScrollDownButton","ChevronDownIcon","SelectContent","position","SelectLabel","SelectItem","CheckIcon","SelectSeparator"],"mappings":"AAAA,mZAAwC,wDAAyC,mDCAR,oGACxC,8BACiE,+CAqC9F,IA3BEA,CAAAA,CAAyB,CAAA,CAAA,IAAA,CAOzBC,CAAAA,aAA8B,CAAA,CAAA,KAAA,CAO9BC,CAAAA,aAA8B,CAAA,CAAA,KAAA,CAW9BC,CAAAA,aAAgBC,+BAAAA,CACnB,CAAE,QAAA,CAAAC,CAAAA,CAAU,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxCC,8BAAAA,CAAiB,CAAA,OAAA,CAAhB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,CACT,OAAA,CAAS,SAAA,CACT,IAAA,CAAAJ,CAAAA,CACA,SAAA,CAAW,CAAC,yCAAA,CAA2CD,CAAS,CAClE,CAAC,CAAA,CACA,GAAGE,CAAAA,CAEH,QAAA,CAAA,CAAAH,CAAAA,CACDO,6BAAAA,CAAiB,CAAA,IAAA,CAAhB,CAAqB,OAAA,CAAO,CAAA,CAAA,CAC3B,QAAA,CAAAA,6BAAAA,yBAACC,CAAA,CAAc,SAAA,CAAU,4BAAA,CAA6B,CAAA,CACxD,CAAA,CAAA,CACF,CAEJ,CAAA,CAEAV,CAAAA,CAAc,WAAA,CAA8B,CAAA,CAAA,OAAA,CAAQ,WAAA,CASpD,IAAMW,CAAAA,CAAuBV,+BAAAA,CAC1B,CAAE,SAAA,CAAAE,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBG,6BAAAA,CAAiB,CAAA,cAAA,CAAhB,CACC,GAAA,CAAKH,CAAAA,CACL,SAAA,CAAWM,iCAAAA,sDAAG,CAAwDT,CAAS,CAAA,CAC9E,GAAG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QAAA,CAAAP,CAAAA,CAAS,CAAA,CAAA,CACtC,CACD,CAAA,CAEDiB,CAAAA,CAAW,WAAA,CAA8B,CAAA,CAAA,IAAA,CAAK,WAAA,CAS9C,IAAME,CAAAA,CAAkBpB,+BAAAA,CACrB,CAAE,SAAA,CAAAE,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBG,6BAAAA,CAAiB,CAAA,SAAA,CAAhB,CAA0B,GAAA,CAAKH,CAAAA,CAAc,SAAA,CAAWM,iCAAAA,yBAAG,CAA2BT,CAAS,CAAA,CAAI,GAAGE,CAAAA,CAAO,CAElH,CAAA,CAEAgB,CAAAA,CAAgB,WAAA,CAA8B,CAAA,CAAA,SAAA,CAAU,WAAA,CAAA,qJAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-V2AN2A7C.cjs","sourcesContent":[null,"import { CaretSortIcon, CheckIcon, ChevronDownIcon, ChevronUpIcon } from '@radix-ui/react-icons';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type ComponentProps, type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\ntype SelectProps = ComponentProps<typeof SelectPrimitive.Root>;\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Value>;\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\ntype SelectTriggerElement = ComponentRef<typeof SelectPrimitive.Trigger>;\ninterface SelectTriggerProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n size?: ButtonVariantsProps['size'];\n}\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ children, className, size, ...props }, forwardedRef) => (\n <SelectPrimitive.Trigger\n ref={forwardedRef}\n className={buttonVariants({\n variant: 'outline',\n size,\n className: ['w-full justify-between px-3 font-normal', className],\n })}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 shrink-0 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n ),\n);\n\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollUpButtonElement = ComponentRef<typeof SelectPrimitive.ScrollUpButton>;\ntype SelectScrollUpButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>;\n\nconst SelectScrollUpButton = forwardRef<SelectScrollUpButtonElement, SelectScrollUpButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollUpButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n ),\n);\n\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\ntype SelectScrollDownButtonElement = ComponentRef<typeof SelectPrimitive.ScrollDownButton>;\ntype SelectScrollDownButtonProps = ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>;\n\nconst SelectScrollDownButton = forwardRef<SelectScrollDownButtonElement, SelectScrollDownButtonProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.ScrollDownButton\n ref={forwardedRef}\n className={cn('flex cursor-pointer items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n ),\n);\n\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\ntype SelectContentElement = ComponentRef<typeof SelectPrimitive.Content>;\ntype SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content>;\n\nconst SelectContent = forwardRef<SelectContentElement, SelectContentProps>(\n ({ children, className, position = 'popper', ...props }, forwardedRef) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md',\n 'data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95',\n 'data-[state=open]:data-[side=bottom]:slide-in-from-top-2',\n 'data-[state=open]:data-[side=left]:slide-in-from-right-2',\n 'data-[state=open]:data-[side=right]:slide-in-from-left-2',\n 'data-[state=open]:data-[side=top]:slide-in-from-bottom-2',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:data-[side=bottom]:slide-out-to-top-2',\n 'data-[state=closed]:data-[side=left]:slide-out-to-right-2',\n 'data-[state=closed]:data-[side=right]:slide-out-to-left-2',\n 'data-[state=closed]:data-[side=top]:slide-out-to-bottom-2',\n position === 'popper' && [\n 'data-[side=bottom]:translate-y-1',\n 'data-[side=left]:-translate-x-1',\n 'data-[side=right]:translate-x-1',\n 'data-[side=top]:-translate-y-1',\n ],\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\n\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\ntype SelectLabelElement = ComponentRef<typeof SelectPrimitive.Label>;\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\nconst SelectLabel = forwardRef<SelectLabelElement, SelectLabelProps>(({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n ref={forwardedRef}\n className={cn('gap-x-2 px-3 py-1.5', 'flex items-center text-sm font-semibold', className)}\n {...props}\n />\n));\n\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\ntype SelectItemElement = ComponentRef<typeof SelectPrimitive.Item>;\ntype SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item>;\n\nconst SelectItem = forwardRef<SelectItemElement, SelectItemProps>(({ children, className, ...props }, forwardedRef) => (\n <SelectPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'relative flex w-full cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-8 text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\n\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\ntype SelectSeparatorElement = ComponentRef<typeof SelectPrimitive.Separator>;\ntype SelectSeparatorProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;\n\nconst SelectSeparator = forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator ref={forwardedRef} className={cn('bg-muted mx-2 my-1 h-px', className)} {...props} />\n ),\n);\n\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n type SelectContentProps,\n type SelectGroupProps,\n type SelectItemProps,\n type SelectLabelProps,\n type SelectProps,\n type SelectScrollDownButtonProps,\n type SelectScrollUpButtonProps,\n type SelectSeparatorProps,\n type SelectTriggerProps,\n type SelectValueProps,\n};\n"]}
|
package/dist/chunk-VFQ5AO6A.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _datefns = require('date-fns');var _react = require('react');var _reactdaypicker = require('react-day-picker');var _jsxruntime = require('react/jsx-runtime');function P({orientation:e,...n}){switch(e){case"up":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronUpIcon,{className:"size-4",...n});case"down":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronDownIcon,{className:"size-4",...n});case"left":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"size-4",...n});case"right":return _jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"size-4",...n});default:return _jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon,{className:"size-4",...n})}}function h({modifiers:e,className:n,day:r,...s}){let l=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{e.focused&&_optionalChain([l, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()])},[e.focused]),_jsxruntime.jsx.call(void 0, "button",{ref:l,className:_chunkKF7Y7B3Gcjs.a.call(void 0, {icon:!0,size:"sm",variant:e.selected&&!e.range_middle?"default":"ghost",className:["focus-visible:ring-1 focus-visible:ring-offset-0",(!e.selected||e.range_middle)&&[e.today?"bg-accent":"hover:border-accent hover:bg-transparent",e.outside&&"text-opacity-30"],e.range_middle&&"bg-transparent",n]}),type:"button",...s})}function z({className:e,classNames:n,...r}){return _jsxruntime.jsx.call(void 0, _reactdaypicker.DayPicker,{className:_chunkDD6AVCRHcjs.a.call(void 0, "p-3",e),classNames:{[_reactdaypicker.DayFlag.outside]:_chunkDD6AVCRHcjs.a.call(void 0, !r.mode&&"text-opacity-30"),[_reactdaypicker.DayFlag.today]:_chunkDD6AVCRHcjs.a.call(void 0, !r.mode&&"bg-accent rounded-md"),[_reactdaypicker.SelectionState.range_end]:"to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md",[_reactdaypicker.SelectionState.range_middle]:"bg-accent first:rounded-l-md last:rounded-r-md",[_reactdaypicker.SelectionState.range_start]:"to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md",[_reactdaypicker.UI.CaptionLabel]:"inline-flex items-center",[_reactdaypicker.UI.Day]:_chunkDD6AVCRHcjs.a.call(void 0, "py-0",!r.mode&&"text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium"),[_reactdaypicker.UI.DayButton]:"border border-transparent",[_reactdaypicker.UI.Dropdown]:"absolute size-full appearance-none opacity-0",[_reactdaypicker.UI.DropdownRoot]:"relative inline-flex",[_reactdaypicker.UI.Dropdowns]:"inline-flex items-center gap-2",[_reactdaypicker.UI.Footer]:"text-sm",[_reactdaypicker.UI.Month]:"grid grid-rows-[2rem_1fr] gap-4",[_reactdaypicker.UI.MonthCaption]:"flex w-full justify-center text-sm font-medium",[_reactdaypicker.UI.MonthGrid]:"relative block table-fixed border-collapse space-y-2 [&>thead]:block",[_reactdaypicker.UI.Months]:"relative flex flex-wrap gap-4",[_reactdaypicker.UI.Nav]:"-mr-4",[_reactdaypicker.UI.NextMonthButton]:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:"absolute end-0",icon:!0,size:"xs",variant:"outline"}),[_reactdaypicker.UI.PreviousMonthButton]:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:"absolute start-0",icon:!0,size:"xs",variant:"outline"}),[_reactdaypicker.UI.Root]:"inline-grid gap-4",[_reactdaypicker.UI.Week]:"flex",[_reactdaypicker.UI.WeekNumber]:"text-foreground/50 size-9 text-center text-xs",[_reactdaypicker.UI.Weekday]:"text-muted-foreground flex-1 text-sm font-normal",[_reactdaypicker.UI.Weekdays]:"flex",[_reactdaypicker.UI.Weeks]:"block space-y-2",...n},components:{Chevron:P,DayButton:h},...r})}function M({date:e,formatStr:n="LLL dd, y",placeholder:r="Pick a date"}){if(!_optionalChain([e, 'optionalAccess', _5 => _5.from]))return _jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:r});let s=_datefns.format.call(void 0, e.from,n);if(!e.to)return _jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:s});let l=_datefns.format.call(void 0, e.to,n);return _jsxruntime.jsxs.call(void 0, "span",{className:"truncate",children:[s," - ",l]})}function _({date:e,formatStr:n="PPP",placeholder:r="Pick a date"}){return e?_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:_datefns.format.call(void 0, e,n)}):_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:r})}exports.a = z; exports.b = M; exports.c = _;
|
|
2
|
-
//# sourceMappingURL=chunk-VFQ5AO6A.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-VFQ5AO6A.cjs","../src/components/calendar.tsx"],"names":["orientation","jsx","props","DayButton","modifiers","className","buttonRef","useRef","buttonVariants","Calendar","classNames","DayPicker","cn","DayFlag","UI","CalendarRangeLabel","formatStr","placeholder","date","jsxs","CalendarLabel"],"mappings":"AAAA,ylBAAY,CAAC,wDAAwC,wDCGnD,mDAMO,mCAC+B,8BAKtC,kDAoBW,+CAHM,SAAA,CAAA,CAAAA,CAAAA,WACjB,CAAA,CAAA,CAAA,GAAqB,CACnB,CAAA,CAAA,CAAA,MACE,CAAA,CAAA,CAAA,CAAA,IAAOC,IAAe,CAAA,OAAA,6BAAA,yBAAU,CAAA,CAAA,SAAaC,CAAAA,QAG1C,CAAA,GAAA,CAAA,CACH,CAAA,CAAA,IAAA,MAAwB,CAAA,OAAA,6BAAA,2BAAU,CAAA,CAAA,SAAaA,CAAAA,QAG5C,CAAA,GAAA,CAAA,CACH,CAAA,CAAA,IAAA,MAAwB,CAAA,OAAA,6BAAA,2BAAU,CAAA,CAAA,SAAaA,CAAAA,QAG5C,CAAA,GAAA,CAAA,CAAA,CACH,CAAA,IAAA,OAAyB,CAAA,OAAA,6BAAA,4BAAU,CAAA,CAAA,SAAaA,CAAAA,QAGlD,CAAA,GACE,CAAA,CAAA,CAAA,CAAA,OAAsB,CAAA,OAAA,6BAAA,yBAAU,CAAA,CAAA,SAAaA,CAAAA,QAanD,CAAA,GAAA,CAASC,CAAAA,CAAU,CAAE,CAAA,SAAAC,CAAAA,CAAW,CAAA,SAAAC,CAAAA,CAAW,CAAA,SAAiB,CAAA,CAAgC,CAC1F,GAAA,CAAMC,CAAAA,CAAYC,GA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AAA,6BAAA,MAAU,CAAA,CAAA,SAAY,CAAA,UAIvC,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-VFQ5AO6A.cjs","sourcesContent":[null,"'use client';\n\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n DotFilledIcon,\n} from '@radix-ui/react-icons';\nimport { format } from 'date-fns';\nimport { type ComponentProps, type JSX, useEffect, useRef } from 'react';\nimport {\n type CalendarDay,\n type CustomComponents,\n type DateRange,\n DayFlag,\n DayPicker,\n type DayPickerProps,\n type Matcher,\n SelectionState,\n UI,\n} from 'react-day-picker';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\ntype ChevronProps = ComponentProps<CustomComponents['Chevron']>;\n\nfunction Chevron({ orientation, ...props }: ChevronProps): JSX.Element {\n switch (orientation) {\n case 'up': {\n return <ChevronUpIcon className=\"size-4\" {...props} />;\n }\n\n case 'down': {\n return <ChevronDownIcon className=\"size-4\" {...props} />;\n }\n\n case 'left': {\n return <ChevronLeftIcon className=\"size-4\" {...props} />;\n }\n\n case 'right': {\n return <ChevronRightIcon className=\"size-4\" {...props} />;\n }\n\n default:\n return <DotFilledIcon className=\"size-4\" {...props} />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DayButton\n * -------------------------------------------------------------------------- */\n\ninterface DayButtonProps extends ComponentProps<'button'> {\n day: CalendarDay;\n modifiers: Record<DayFlag | SelectionState, boolean>;\n}\n\nfunction DayButton({ modifiers, className, day: _, ...props }: DayButtonProps): JSX.Element {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) {\n buttonRef.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <button\n ref={buttonRef}\n className={buttonVariants({\n icon: true,\n size: 'sm',\n variant: modifiers.selected && !modifiers.range_middle ? 'default' : 'ghost',\n className: [\n 'focus-visible:ring-1 focus-visible:ring-offset-0',\n (!modifiers.selected || modifiers.range_middle) && [\n modifiers.today ? 'bg-accent' : 'hover:border-accent hover:bg-transparent',\n modifiers.outside && 'text-opacity-30',\n ],\n modifiers.range_middle && 'bg-transparent',\n className,\n ],\n })}\n type=\"button\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\ntype CalendarProps = DayPickerProps;\n\nfunction Calendar({ className, classNames, ...props }: CalendarProps): JSX.Element {\n return (\n <DayPicker\n className={cn('p-3', className)}\n classNames={{\n [DayFlag.outside]: cn(!props.mode && 'text-opacity-30'),\n [DayFlag.today]: cn(!props.mode && 'bg-accent rounded-md'),\n [SelectionState.range_end]:\n 'to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md',\n [SelectionState.range_middle]: 'bg-accent first:rounded-l-md last:rounded-r-md',\n [SelectionState.range_start]:\n 'to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md',\n [UI.CaptionLabel]: 'inline-flex items-center',\n [UI.Day]: cn(\n 'py-0',\n !props.mode && 'text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium',\n ),\n [UI.DayButton]: 'border border-transparent',\n [UI.Dropdown]: 'absolute size-full appearance-none opacity-0',\n [UI.DropdownRoot]: 'relative inline-flex',\n [UI.Dropdowns]: 'inline-flex items-center gap-2',\n [UI.Footer]: 'text-sm',\n [UI.Month]: 'grid grid-rows-[2rem_1fr] gap-4',\n [UI.MonthCaption]: 'flex w-full justify-center text-sm font-medium',\n [UI.MonthGrid]: 'relative block table-fixed border-collapse space-y-2 [&>thead]:block',\n [UI.Months]: 'relative flex flex-wrap gap-4',\n [UI.Nav]: '-mr-4',\n [UI.NextMonthButton]: buttonVariants({\n className: 'absolute end-0',\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n className: 'absolute start-0',\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.Root]: 'inline-grid gap-4',\n [UI.Week]: 'flex',\n [UI.WeekNumber]: 'text-foreground/50 size-9 text-center text-xs',\n [UI.Weekday]: 'text-muted-foreground flex-1 text-sm font-normal',\n [UI.Weekdays]: 'flex',\n [UI.Weeks]: 'block space-y-2',\n ...classNames,\n }}\n components={{ Chevron, DayButton }}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarRangeLabelProps {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarRangeLabel({\n date,\n formatStr = 'LLL dd, y',\n placeholder = 'Pick a date',\n}: CalendarRangeLabelProps): string | JSX.Element {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarLabelProps {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarLabel({\n date,\n formatStr = 'PPP',\n placeholder = 'Pick a date',\n}: CalendarLabelProps): string | JSX.Element {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Calendar,\n CalendarLabel,\n CalendarRangeLabel,\n type CalendarLabelProps,\n type CalendarProps,\n type CalendarRangeLabelProps,\n type DateRange,\n type Matcher,\n};\n"]}
|
package/dist/chunk-X2F3KWSW.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reacticons = require('@radix-ui/react-icons');var _inputotp = require('input-otp');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var m=_react.forwardRef.call(void 0, ({className:t,containerClassName:e,...p},s)=>_jsxruntime.jsx.call(void 0, _inputotp.OTPInput,{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "disabled:cursor-default",t),containerClassName:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center gap-2","has-[:disabled]:opacity-50",e),...p}));m.displayName="InputOTP";var T=_react.forwardRef.call(void 0, ({className:t,...e},p)=>_jsxruntime.jsx.call(void 0, "div",{ref:p,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center",t),...e}));T.displayName="InputOTPGroup";var I=_react.forwardRef.call(void 0, ({index:t,className:e,...p},s)=>{let u=_react.useContext.call(void 0, _inputotp.OTPInputContext).slots[t];return _jsxruntime.jsxs.call(void 0, "div",{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all","first:rounded-l-md first:border-l","last:rounded-r-md",_optionalChain([u, 'optionalAccess', _ => _.isActive])&&"z-10 outline outline-2",e),...p,children:[_optionalChain([u, 'optionalAccess', _2 => _2.char]),_optionalChain([u, 'optionalAccess', _3 => _3.hasFakeCaret])?_jsxruntime.jsx.call(void 0, "div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px"})}):null]})});I.displayName="InputOTPSlot";var O=_react.forwardRef.call(void 0, ({...t},e)=>_jsxruntime.jsx.call(void 0, "div",{ref:e,role:"separator",...t,children:_jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon,{})}));O.displayName="InputOTPSeparator";exports.a = _inputotp.REGEXP_ONLY_CHARS; exports.b = _inputotp.REGEXP_ONLY_DIGITS; exports.c = _inputotp.REGEXP_ONLY_DIGITS_AND_CHARS; exports.d = m; exports.e = T; exports.f = I; exports.g = O;
|
|
2
|
-
//# sourceMappingURL=chunk-X2F3KWSW.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-X2F3KWSW.cjs","../src/components/input-otp.tsx"],"names":["className","jsx","OTPInput","forwardedRef","cn","InputOTP","InputOTPGroup","index","slot","useContext","OTPInputContext","InputOTPSlot","props","DotFilledIcon","InputOTPSeparator"],"mappings":"AAAA,ylBAAY,CAAC,wDCEJ,mDAEP,qCAMyD,8BAavD,+CADC,IAAA,CAAA,CAAA,+BAAAA,CAAW,CAAA,SAAA,CAAA,CAAA,CAAA,kBACZC,CAAAA,CAACC,CAAAA,GACC,CAAA,CAAA,CAAKC,CAAAA,CACL,EAAA,6BAAA,kBAAA,CAAA,CAAA,GAAWC,CAAAA,CAAG,CAAA,SAAA,CAAA,iCAAA,yBACd,CAAA,CAAA,CAAA,CAAA,kBAAuB,CAAA,iCAAA,yBAA2B,CAAA,4BAMxDC,CAAS,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,WASvB,CAAA,UAA8E,CAAA,IAAA,CAAA,CAAA,+BAAAL,CAAW,CAAA,SACvFC,CAAAA,CAAC,CAAA,GAAA,CAAA,CAAA,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/ui/dist/chunk-X2F3KWSW.cjs","sourcesContent":[null,"'use client';\n\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from 'input-otp';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPElement = ComponentRef<typeof OTPInput>;\ntype InputOTPProps = ComponentPropsWithoutRef<typeof OTPInput>;\n\nconst InputOTP = forwardRef<InputOTPElement, InputOTPProps>(\n ({ className, containerClassName, ...props }, forwardedRef) => (\n <OTPInput\n ref={forwardedRef}\n className={cn('disabled:cursor-default', className)}\n containerClassName={cn('flex items-center gap-2', 'has-[:disabled]:opacity-50', containerClassName)}\n {...props}\n />\n ),\n);\n\nInputOTP.displayName = 'InputOTP';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupElement = HTMLDivElement;\ntype InputOTPGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPGroup = forwardRef<InputOTPGroupElement, InputOTPGroupProps>(({ className, ...props }, forwardedRef) => (\n <div ref={forwardedRef} className={cn('flex items-center', className)} {...props} />\n));\n\nInputOTPGroup.displayName = 'InputOTPGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSlotElement = HTMLDivElement;\n\ninterface InputOTPSlotProps extends HTMLAttributes<HTMLDivElement> {\n index: number;\n}\n\nconst InputOTPSlot = forwardRef<InputOTPSlotElement, InputOTPSlotProps>(\n ({ index, className, ...props }, forwardedRef) => {\n const inputOTPContext = useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={forwardedRef}\n className={cn(\n 'border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all',\n 'first:rounded-l-md first:border-l',\n 'last:rounded-r-md',\n slot?.isActive && 'z-10 outline outline-2',\n className,\n )}\n {...props}\n >\n {slot?.char}\n {slot?.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nInputOTPSlot.displayName = 'InputOTPSlot';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorElement = HTMLDivElement;\ntype InputOTPSeparatorProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPSeparator = forwardRef<InputOTPSeparatorElement, InputOTPSeparatorProps>(({ ...props }, forwardedRef) => (\n <div ref={forwardedRef} role=\"separator\" {...props}>\n <DotFilledIcon />\n </div>\n));\n\nInputOTPSeparator.displayName = 'InputOTPSeparator';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n type InputOTPGroupProps,\n type InputOTPProps,\n type InputOTPSeparatorProps,\n type InputOTPSlotProps,\n};\n"]}
|
|
File without changes
|