@devalok/shilp-sutra 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +36 -12
- package/BREAKING.json +78 -0
- package/MIGRATION.md +891 -846
- package/dist/_chunks/badge-group.js +50 -63
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +1 -1
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/emoji-suggestion.js +124 -0
- package/dist/_chunks/emoji-suggestion.js.map +1 -0
- package/dist/_chunks/emoji.js +1115 -0
- package/dist/_chunks/emoji.js.map +1 -0
- package/dist/_chunks/field-state.js +8 -0
- package/dist/_chunks/field-state.js.map +1 -0
- package/dist/_chunks/popover.js +50 -47
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives.js +155 -155
- package/dist/_chunks/primitives.js.map +1 -1
- package/dist/_chunks/shared.js +4 -4
- package/dist/_chunks/tiptap.js +10 -10
- package/dist/_chunks/tiptap.js.map +1 -1
- package/dist/_chunks/use-calendar.js +1 -1
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/_chunks/use-controllable-open.js +15 -0
- package/dist/_chunks/use-controllable-open.js.map +1 -0
- package/dist/composed/command-palette.js +3 -3
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/confirm-dialog.js +3 -3
- package/dist/composed/confirm-dialog.js.map +1 -1
- package/dist/composed/date-picker/index.js +3 -3
- package/dist/composed/date-picker/index.js.map +1 -1
- package/dist/composed/emoji-picker.d.ts +19 -9
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +87 -68
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/error-boundary.js +1 -1
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-data.d.ts +1 -14
- package/dist/composed/extensions/emoji-data.d.ts.map +1 -1
- package/dist/composed/extensions/emoji-node.d.ts +0 -3
- package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
- package/dist/composed/extensions/emoji-node.js +9 -34
- package/dist/composed/extensions/emoji-node.js.map +1 -1
- package/dist/composed/extensions/emoji-suggestion.d.ts +2 -2
- package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
- package/dist/composed/extensions/emoji-suggestion.js +2 -116
- package/dist/composed/index.d.ts +3 -1
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +4 -3
- package/dist/composed/loading-skeleton.js +15 -15
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-header.js +32 -45
- package/dist/composed/page-header.js.map +1 -1
- package/dist/composed/page-skeletons.js +19 -19
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/responsive-modal.d.ts +39 -0
- package/dist/composed/responsive-modal.d.ts.map +1 -0
- package/dist/composed/responsive-modal.js +212 -0
- package/dist/composed/responsive-modal.js.map +1 -0
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +558 -579
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +167 -190
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.d.ts +1 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +48 -54
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts +13 -11
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +54 -130
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/top-bar.js +1 -1
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/semantic.css +8 -1
- package/dist/ui/accordion.js +9 -9
- package/dist/ui/alert-dialog.js +26 -26
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/autocomplete.js +7 -7
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +87 -82
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/breadcrumb.d.ts +0 -1
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +58 -35
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.js +3 -3
- package/dist/ui/checkbox.d.ts +4 -2
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +33 -28
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/collapsible.js +4 -4
- package/dist/ui/combobox.d.ts +3 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +137 -132
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.js +46 -46
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +53 -50
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dot.d.ts +38 -0
- package/dist/ui/dot.d.ts.map +1 -0
- package/dist/ui/dot.js +92 -0
- package/dist/ui/dot.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +70 -65
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/hover-card.js +11 -11
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +67 -67
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts +4 -2
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +38 -37
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/field-state.d.ts +21 -0
- package/dist/ui/lib/field-state.d.ts.map +1 -0
- package/dist/ui/lib/use-controllable-open.d.ts +32 -0
- package/dist/ui/lib/use-controllable-open.d.ts.map +1 -0
- package/dist/ui/link.js +1 -1
- package/dist/ui/number-input.d.ts +4 -2
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +51 -50
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/progress.d.ts +66 -42
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +144 -40
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.d.ts +6 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +44 -33
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +58 -57
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.js +2 -2
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +59 -56
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.js +5 -5
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/slider.js +6 -6
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +122 -125
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/surface.js +1 -1
- package/dist/ui/switch.d.ts +3 -1
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +32 -27
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/textarea.d.ts +3 -3
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +18 -17
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.js +2 -2
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +36 -33
- package/dist/ui/tooltip.js.map +1 -1
- package/docs/components/ai/ai-command-provider.md +46 -0
- package/docs/components/ai/block-renderer.md +59 -0
- package/docs/components/ai/command-bar.md +78 -0
- package/docs/components/ai/conversation.md +59 -0
- package/docs/components/ai/devadoot-icon.md +41 -0
- package/docs/components/composed/emoji-picker.md +19 -17
- package/docs/components/composed/page-header.md +1 -1
- package/docs/components/composed/responsive-modal.md +66 -0
- package/docs/components/composed/rich-text-editor.md +1 -1
- package/docs/components/composed/schedule-view.md +6 -2
- package/docs/components/ui/breadcrumb.md +1 -1
- package/docs/components/ui/checkbox.md +4 -1
- package/docs/components/ui/combobox.md +4 -0
- package/docs/components/ui/dot.md +61 -0
- package/docs/components/ui/progress.md +54 -16
- package/docs/components/ui/radio.md +6 -2
- package/docs/components/ui/select.md +9 -5
- package/docs/components/ui/switch.md +4 -1
- package/docs/components/ui/table-row-link.md +1 -1
- package/docs/components/ui/table.md +2 -1
- package/docs/recipes/index.md +1 -1
- package/docs/recipes/install-astro.md +15 -12
- package/docs/recipes/install-next-app-router.md +20 -12
- package/docs/recipes/install-next-pages.md +3 -1
- package/docs/recipes/install-remix.md +16 -13
- package/docs/recipes/install-tanstack-start.md +19 -12
- package/docs/recipes/install-vite.md +18 -15
- package/docs/recipes/troubleshoot.md +7 -8
- package/llms.txt +12 -4
- package/make-kit/components/form.md +2 -2
- package/make-kit/components/icon.md +2 -2
- package/make-kit/components/overview.md +2 -2
- package/make-kit/components/select.md +1 -1
- package/make-kit/components/table.md +1 -1
- package/mcp-manifest.json +2696 -1145
- package/mcp-manifest.schema.json +18 -0
- package/package.json +16 -14
- package/skill/SKILL.md +1 -1
- package/skill/references/components.md +12 -4
- package/skill/references/setup-astro.md +15 -12
- package/skill/references/setup-next-app-router.md +20 -12
- package/skill/references/setup-next-pages.md +3 -1
- package/skill/references/setup-remix.md +16 -13
- package/skill/references/setup-tanstack-start.md +19 -12
- package/skill/references/setup-vite.md +18 -15
- package/skill/references/troubleshoot.md +7 -8
- package/dist/_chunks/emoji-data.js +0 -45
- package/dist/_chunks/emoji-data.js.map +0 -1
- package/dist/composed/extensions/emoji-suggestion.js.map +0 -1
- package/dist/ui/status-dot.d.ts +0 -27
- package/dist/ui/status-dot.d.ts.map +0 -1
- package/dist/ui/status-dot.js +0 -68
- package/dist/ui/status-dot.js.map +0 -1
- package/docs/components/ui/status-dot.md +0 -35
package/dist/ui/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":[],"sources":["../../src/ui/progress.tsx"],"sourcesContent":["'use client'\n\nimport * as ProgressPrimitive from '@primitives/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\n/* ---------------------------------------------------------------------------\n * CVA Variants\n * ------------------------------------------------------------------------ */\n\nconst progressTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-pill bg-surface-raised',\n {\n variants: {\n size: {\n sm: 'h-1',\n md: 'h-2',\n lg: 'h-3',\n },\n },\n defaultVariants: { size: 'md' },\n },\n)\n\nconst progressIndicatorVariants = cva(\n 'h-full w-full flex-1 transition-[width] duration-moderate-02 ease-expressive-standard',\n {\n variants: {\n color: {\n default: 'bg-accent-9',\n success: 'bg-success-9',\n warning: 'bg-warning-9',\n error: 'bg-error-9',\n },\n },\n defaultVariants: { color: 'default' },\n },\n)\n\n/* ---------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------ */\n\n/**\n * Props for Progress — a horizontal progress bar with size and color variants, an optional\n * percentage label, and an indeterminate animation when `value` is undefined/null.\n *\n * **Track size:** `sm` (4px) | `md` (8px, default) | `lg` (12px)\n *\n * **Indicator color:** `default` (brand interactive) | `success` | `warning` | `error`\n *\n * **Indeterminate:** Omit `value` (or pass `undefined`) to show an animated indeterminate bar.\n * When `value` is provided, it should be a number between 0–100.\n *\n * **`showLabel`:** Renders the percentage value next to the bar (only when `value` is set).\n *\n * @example\n * // Determinate upload progress:\n * <Progress value={uploadPercent} color=\"default\" showLabel />\n *\n * @example\n * // Indeterminate loading bar (while waiting for an async operation):\n * <Progress size=\"sm\" />\n *\n * @example\n * // Success-colored completion bar (e.g. after all tasks done):\n * <Progress value={100} color=\"success\" size=\"md\" />\n *\n * @example\n * // Warning threshold indicator (disk usage at 80%):\n * <Progress value={80} color=\"warning\" showLabel size=\"lg\" />\n * // These are just a few ways — feel free to combine props creatively!\n */\ninterface ProgressProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>,\n 'color'\n >,\n VariantProps<typeof progressTrackVariants>,\n VariantProps<typeof progressIndicatorVariants> {\n /** Additional class names for the indicator element */\n indicatorClassName?: string\n /** Display the percentage label next to the progress bar */\n showLabel?: boolean\n /** When true, color auto-shifts by value: 0-59 = default (accent), 60-84 = warning, 85-100 = success, >100 = error. @default false */\n autoColor?: boolean\n}\n\n/* ---------------------------------------------------------------------------\n * Component\n * ------------------------------------------------------------------------ */\n\nconst Progress = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n ProgressProps\n>(\n (\n {\n className,\n value,\n size,\n color,\n indicatorClassName,\n showLabel,\n autoColor,\n ...props\n },\n ref,\n ) => {\n const isIndeterminate = value === undefined || value === null\n\n const effectiveColor =\n autoColor && value != null\n ? value > 100\n ? 'error'\n : value >= 85\n ? 'success'\n : value >= 60\n ? 'warning'\n : 'default'\n : color\n\n return (\n <div className={cn('flex items-center gap-ds-03', showLabel && 'w-full')}>\n <ProgressPrimitive.Root\n ref={ref}\n value={isIndeterminate ? null : value}\n className={cn(progressTrackVariants({ size }), className)}\n {...props}\n >\n {isIndeterminate ? (\n <ProgressPrimitive.Indicator\n className={cn(\n progressIndicatorVariants({ color: effectiveColor }),\n 'w-2/5 animate-progress-indeterminate motion-reduce:animate-none',\n indicatorClassName,\n )}\n />\n ) : (\n <ProgressPrimitive.Indicator\n className={cn('h-full', indicatorClassName)}\n asChild\n >\n <motion.div\n className={cn(\n progressIndicatorVariants({ color: effectiveColor }),\n 'transition-colors duration-moderate-01 ease-productive-standard',\n )}\n initial={false}\n animate={{ width: `${value || 0}%` }}\n transition={springs.smooth}\n />\n </ProgressPrimitive.Indicator>\n )}\n </ProgressPrimitive.Root>\n\n {showLabel && !isIndeterminate && (\n <span className=\"shrink-0 text-ds-xs text-surface-fg-muted tabular-nums\">\n {value}%\n </span>\n )}\n </div>\n )\n },\n)\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress, progressIndicatorVariants,progressTrackVariants }\nexport type { ProgressProps }\n"],"mappings":";;;;;;;;;AAcA,IAAM,IAAwB,EAC5B,kEACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACD,iBAAiB,EAAE,MAAM,MAAM;CAChC,CACF,EAEK,IAA4B,EAChC,yFACA;CACE,UAAU,EACR,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,OAAO;EACR,EACF;CACD,iBAAiB,EAAE,OAAO,WAAW;CACtC,CACF,EAuDK,IAAW,EAAM,YAKnB,EACE,cACA,UACA,SACA,UACA,uBACA,cACA,cACA,GAAG,KAEL,MACG;CACH,IAAM,IAAkB,KAAiC,MAEnD,IACJ,KAAa,KAAS,OAClB,IAAQ,MACN,UACA,KAAS,KACP,YACA,KAAS,KACP,YACA,YACN;AAEN,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,+BAA+B,KAAa,SAAS;YAAxE,CACE,kBAAC,GAAD;GACO;GACL,OAAO,IAAkB,OAAO;GAChC,WAAW,EAAG,EAAsB,EAAE,SAAM,CAAC,EAAE,EAAU;GACzD,GAAI;aAEH,IACC,kBAAC,GAAD,EACE,WAAW,EACT,EAA0B,EAAE,OAAO,GAAgB,CAAC,EACpD,mEACA,EACD,EACD,CAAA,GAEF,kBAAC,GAAD;IACE,WAAW,EAAG,UAAU,EAAmB;IAC3C,SAAA;cAEA,kBAAC,EAAO,KAAR;KACE,WAAW,EACT,EAA0B,EAAE,OAAO,GAAgB,CAAC,EACpD,kEACD;KACD,SAAS;KACT,SAAS,EAAE,OAAO,GAAG,KAAS,EAAE,IAAI;KACpC,YAAY,EAAQ;KACpB,CAAA;IAC0B,CAAA;GAET,CAAA,EAExB,KAAa,CAAC,KACb,kBAAC,QAAD;GAAM,WAAU;aAAhB,CACG,GAAM,IACF;KAEL;;EAGX;AACD,EAAS,cAAA,EAAqC"}
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../src/ui/progress.tsx"],"sourcesContent":["'use client'\n\nimport * as ProgressPrimitive from '@primitives/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\n/* ---------------------------------------------------------------------------\n * Progress — a linear progress bar.\n *\n * Two ways to use it:\n * 1. Smart all-in-one `<Progress value={70} />` — covers the common cases\n * (value, size, color, label, %-value, auto-color, indeterminate, segments).\n * 2. Compound parts `<Progress.Root>/<Progress.Track>/<Progress.Indicator>` etc.\n * — full layout control, borrowed from Ark UI / Chakra's structure, with\n * Mantine-style `<Progress.Segment>` for multi-colour bars.\n *\n * The compound parts share a context so `value`/`max`/`size` are set once on\n * `Root` and read by Track/Indicator/Segment/Value.\n * ------------------------------------------------------------------------ */\n\nexport type ProgressSize = 'sm' | 'md' | 'lg'\nexport type ProgressColor = 'accent' | 'success' | 'warning' | 'error'\n\nexport const progressTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-pill bg-surface-raised',\n {\n variants: { size: { sm: 'h-1', md: 'h-2', lg: 'h-3' } },\n defaultVariants: { size: 'md' },\n },\n)\n\nconst COLOR_FILL: Record<ProgressColor, string> = {\n accent: 'bg-accent-9',\n success: 'bg-success-9',\n warning: 'bg-warning-9',\n error: 'bg-error-9',\n}\n\nexport const progressIndicatorVariants = cva(\n 'h-full transition-[width] duration-moderate-02 ease-expressive-standard',\n {\n variants: { color: COLOR_FILL },\n defaultVariants: { color: 'accent' },\n },\n)\n\n/** Auto-color by value: 0–59 accent, 60–84 warning, 85–100 success, >100 error. */\nfunction autoColorFor(value: number | null | undefined): ProgressColor {\n if (value == null) return 'accent'\n if (value > 100) return 'error'\n if (value >= 85) return 'success'\n if (value >= 60) return 'warning'\n return 'accent'\n}\n\nconst clampPct = (value: number, max: number) =>\n Math.max(0, Math.min(100, (value / max) * 100))\n\n/* ---------------------------------------------------------------------------\n * Context — set once on Root, read by Track / Indicator / Segment / Value.\n * ------------------------------------------------------------------------ */\n\ninterface ProgressContextValue {\n value: number | null\n max: number\n size: ProgressSize\n indeterminate: boolean\n}\n\nconst ProgressContext = React.createContext<ProgressContextValue | null>(null)\n\nfunction useProgressContext(part: string): ProgressContextValue {\n const ctx = React.useContext(ProgressContext)\n if (!ctx) {\n throw new Error(`<Progress.${part}> must be rendered inside <Progress.Root>.`)\n }\n return ctx\n}\n\n/* ---------------------------------------------------------------------------\n * Progress.Root — layout container + context. NOT the progressbar itself\n * (that's Track) so labels/value can sit outside the bar (Ark UI model).\n * ------------------------------------------------------------------------ */\n\nexport interface ProgressRootProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 0–max. Omit (or null) for an indeterminate bar. */\n value?: number | null\n /** Scale maximum. @default 100 */\n max?: number\n /** Track thickness. @default 'md' */\n size?: ProgressSize\n}\n\nconst ProgressRoot = React.forwardRef<HTMLDivElement, ProgressRootProps>(\n ({ value = null, max = 100, size = 'md', className, children, ...props }, ref) => {\n const ctx = React.useMemo<ProgressContextValue>(\n () => ({ value, max, size, indeterminate: value == null }),\n [value, max, size],\n )\n return (\n <ProgressContext.Provider value={ctx}>\n <div ref={ref} className={cn('flex w-full items-center gap-ds-03', className)} {...props}>\n {children}\n </div>\n </ProgressContext.Provider>\n )\n },\n)\nProgressRoot.displayName = 'Progress.Root'\n\n/* ---------------------------------------------------------------------------\n * Progress.Track — the aria progressbar + track visual. Holds Indicator/Segment.\n * ------------------------------------------------------------------------ */\n\nexport type ProgressTrackProps = React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n\nconst ProgressTrack = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n ProgressTrackProps\n>(({ className, children, ...props }, ref) => {\n const { value, max, size, indeterminate } = useProgressContext('Track')\n // Accessible name comes from the consumer's aria-label / aria-labelledby (spread\n // via ...props) — no auto-wiring, so a Track never carries a dangling reference.\n return (\n <ProgressPrimitive.Root\n ref={ref}\n value={indeterminate ? null : value}\n max={max}\n className={cn(progressTrackVariants({ size }), 'flex-1', className)}\n {...props}\n >\n {children}\n </ProgressPrimitive.Root>\n )\n})\nProgressTrack.displayName = 'Progress.Track'\n\n/* ---------------------------------------------------------------------------\n * Progress.Indicator — single fill. Determinate width from context, or the\n * indeterminate sweep animation when Root has no value.\n * ------------------------------------------------------------------------ */\n\nexport interface ProgressIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Fill colour. Omit to auto-colour by value. */\n color?: ProgressColor\n /** Force auto-colour even when `color` is unset. @default true when color unset */\n autoColor?: boolean\n}\n\nconst ProgressIndicator = React.forwardRef<HTMLDivElement, ProgressIndicatorProps>(\n ({ color, autoColor, className, ...props }, ref) => {\n const { value, max, indeterminate } = useProgressContext('Indicator')\n const resolved = color ?? (autoColor !== false ? autoColorFor(value) : 'accent')\n\n if (indeterminate) {\n return (\n <div\n ref={ref}\n className={cn(\n progressIndicatorVariants({ color: resolved }),\n 'w-2/5 animate-progress-indeterminate motion-reduce:animate-none',\n className,\n )}\n {...props}\n />\n )\n }\n return (\n <motion.div\n ref={ref}\n className={cn(progressIndicatorVariants({ color: resolved }), 'transition-colors', className)}\n initial={false}\n animate={{ width: `${clampPct(value ?? 0, max)}%` }}\n transition={springs.smooth}\n {...(props as React.ComponentProps<typeof motion.div>)}\n />\n )\n },\n)\nProgressIndicator.displayName = 'Progress.Indicator'\n\n/* ---------------------------------------------------------------------------\n * Progress.Segment — one slice of a multi-segment bar (Mantine-style). Place\n * several inside a Track. Widths are each segment's value as a % of max.\n * ------------------------------------------------------------------------ */\n\nexport interface ProgressSegmentProps extends React.HTMLAttributes<HTMLDivElement> {\n /** This segment's portion of `max`. */\n value: number\n color?: ProgressColor\n}\n\nconst ProgressSegment = React.forwardRef<HTMLDivElement, ProgressSegmentProps>(\n ({ value, color = 'accent', className, style, ...props }, ref) => {\n const { max } = useProgressContext('Segment')\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cn('h-full first:rounded-l-pill last:rounded-r-pill', COLOR_FILL[color], className)}\n style={{ width: `${clampPct(value, max)}%`, ...style }}\n {...props}\n />\n )\n },\n)\nProgressSegment.displayName = 'Progress.Segment'\n\n/* ---------------------------------------------------------------------------\n * Progress.Label — descriptive text, associated with the bar via aria.\n * ------------------------------------------------------------------------ */\n\nexport type ProgressLabelProps = React.HTMLAttributes<HTMLSpanElement>\n\nconst ProgressLabel = React.forwardRef<HTMLSpanElement, ProgressLabelProps>(\n ({ className, ...props }, ref) => {\n useProgressContext('Label')\n return (\n <span\n ref={ref}\n className={cn('shrink-0 text-ds-sm font-medium text-surface-fg', className)}\n {...props}\n />\n )\n },\n)\nProgressLabel.displayName = 'Progress.Label'\n\n/* ---------------------------------------------------------------------------\n * Progress.Value — the \"{n}%\" readout. Custom content via children or `format`.\n * ------------------------------------------------------------------------ */\n\nexport interface ProgressValueProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {\n /** Format the percentage. Default: `${round(pct)}%`. */\n format?: (pct: number, value: number | null, max: number) => React.ReactNode\n children?: React.ReactNode\n}\n\nconst ProgressValue = React.forwardRef<HTMLSpanElement, ProgressValueProps>(\n ({ className, format, children, ...props }, ref) => {\n const { value, max, indeterminate } = useProgressContext('Value')\n const pct = indeterminate ? 0 : clampPct(value ?? 0, max)\n return (\n <span\n ref={ref}\n className={cn('shrink-0 text-ds-xs text-surface-fg-muted tabular-nums', className)}\n {...props}\n >\n {children ?? (indeterminate ? '' : format ? format(pct, value, max) : `${Math.round(pct)}%`)}\n </span>\n )\n },\n)\nProgressValue.displayName = 'Progress.Value'\n\n/* ---------------------------------------------------------------------------\n * Progress — smart all-in-one. Composes the parts for the common cases.\n * ------------------------------------------------------------------------ */\n\nexport interface ProgressProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof progressTrackVariants> {\n /** 0–max. Omit (or null) for an indeterminate bar. */\n value?: number | null\n max?: number\n /** Fill colour. Omit + set `autoColor` to colour by value. */\n color?: ProgressColor\n /** Auto-colour the fill by value (0–59 accent · 60–84 warning · 85–100 success · >100 error). @default false */\n autoColor?: boolean\n /** Descriptive label rendered before the bar. */\n label?: React.ReactNode\n /** Show the `{n}%` readout after the bar. */\n showValue?: boolean\n /** Multi-segment bar: each slice is `value` (portion of max) + `color`. Overrides the single indicator. */\n segments?: Array<{ value: number; color?: ProgressColor }>\n /** Class for the Track element. */\n trackClassName?: string\n /** Class for the single Indicator (ignored when `segments` is set). */\n indicatorClassName?: string\n}\n\nconst ProgressBase = React.forwardRef<HTMLDivElement, ProgressProps>(\n (\n {\n value = null, max = 100, size, color, autoColor, label, showValue, segments,\n trackClassName, indicatorClassName, className,\n 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, ...props\n },\n ref,\n ) => {\n const labelId = React.useId()\n const hasLabel = label != null\n return (\n <ProgressRoot ref={ref} value={value} max={max} size={size ?? 'md'} className={className} {...props}>\n {hasLabel && <ProgressLabel id={labelId}>{label}</ProgressLabel>}\n <ProgressTrack\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby ?? (hasLabel ? labelId : undefined)}\n className={cn(segments && 'flex', trackClassName)}\n >\n {segments\n ? segments.map((s, i) => <ProgressSegment key={i} value={s.value} color={s.color} />)\n : <ProgressIndicator color={color} autoColor={autoColor} className={indicatorClassName} />}\n </ProgressTrack>\n {showValue && value != null && <ProgressValue />}\n </ProgressRoot>\n )\n },\n)\nProgressBase.displayName = 'Progress'\n\nconst Progress = Object.assign(ProgressBase, {\n Root: ProgressRoot,\n Track: ProgressTrack,\n Indicator: ProgressIndicator,\n Segment: ProgressSegment,\n Label: ProgressLabel,\n Value: ProgressValue,\n})\n\nexport {\n Progress,\n ProgressIndicator,\n ProgressLabel,\n ProgressRoot,\n ProgressSegment,\n ProgressTrack,\n ProgressValue,\n}\n"],"mappings":";;;;;;;;;AA2BA,IAAa,IAAwB,EACnC,kEACA;CACE,UAAU,EAAE,MAAM;EAAE,IAAI;EAAO,IAAI;EAAO,IAAI;EAAO,EAAE;CACvD,iBAAiB,EAAE,MAAM,MAAM;CAChC,CACF,EAEK,IAA4C;CAChD,QAAQ;CACR,SAAS;CACT,SAAS;CACT,OAAO;CACR,EAEY,IAA4B,EACvC,2EACA;CACE,UAAU,EAAE,OAAO,GAAY;CAC/B,iBAAiB,EAAE,OAAO,UAAU;CACrC,CACF;AAGD,SAAS,EAAa,GAAiD;AAKrE,QAJI,KAAS,OAAa,WACtB,IAAQ,MAAY,UACpB,KAAS,KAAW,YACpB,KAAS,KAAW,YACjB;;AAGT,IAAM,KAAY,GAAe,MAC/B,KAAK,IAAI,GAAG,KAAK,IAAI,KAAM,IAAQ,IAAO,IAAI,CAAC,EAa3C,IAAkB,EAAM,cAA2C,KAAK;AAE9E,SAAS,EAAmB,GAAoC;CAC9D,IAAM,IAAM,EAAM,WAAW,EAAgB;AAC7C,KAAI,CAAC,EACH,OAAU,MAAM,aAAa,EAAK,4CAA4C;AAEhF,QAAO;;AAiBT,IAAM,IAAe,EAAM,YACxB,EAAE,WAAQ,MAAM,SAAM,KAAK,UAAO,MAAM,cAAW,aAAU,GAAG,KAAS,MAAQ;CAChF,IAAM,IAAM,EAAM,eACT;EAAE;EAAO;EAAK;EAAM,eAAe,KAAS;EAAM,GACzD;EAAC;EAAO;EAAK;EAAK,CACnB;AACD,QACE,kBAAC,EAAgB,UAAjB;EAA0B,OAAO;YAC/B,kBAAC,OAAD;GAAU;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;KAAW,WAAW;KAAsB,CAAA;IAC9E,CAAA;GACf,KAAa,KAAS,QAAQ,kBAAC,GAAD,EAAiB,CAAA;GACnC;;EAGpB;AACD,EAAa,cAAc;AAE3B,IAAM,IAAW,OAAO,OAAO,GAAc;CAC3C,MAAM;CACN,OAAO;CACP,WAAW;CACX,SAAS;CACT,OAAO;CACP,OAAO;CACR,CAAC"}
|
package/dist/ui/radio.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { FieldState } from './lib/field-state';
|
|
2
3
|
import * as RadioGroupPrimitive from '../primitives/react-radio-group';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
|
|
5
|
+
export interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
6
|
+
/** Validation/feedback state for the whole group. `'error'` also sets `aria-invalid`. Inherited from `FormField` when omitted. */
|
|
7
|
+
state?: FieldState;
|
|
8
|
+
}
|
|
9
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
10
|
export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
6
11
|
/** Control size — `sm` (20px), `md` (24px, default, WCAG compliant), `lg` (28px). */
|
|
7
12
|
size?: 'sm' | 'md' | 'lg';
|
|
8
13
|
}
|
|
9
14
|
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
11
15
|
export { RadioGroup, RadioGroupItem };
|
|
12
16
|
//# sourceMappingURL=radio.d.ts.map
|
package/dist/ui/radio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/ui/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,mBAAmB,MAAM,+BAA+B,CAAA;AAGpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/ui/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,mBAAmB,MAAM,+BAA+B,CAAA;AAGpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,mBAAmB,CAAA;AActE,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACtG,kIAAkI;IAClI,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED,QAAA,MAAM,UAAU,wFAqBd,CAAA;AAGF,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC;IAC1G,qFAAqF;IACrF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;AAcD,QAAA,MAAM,cAAc,+FAkClB,CAAA;AAGF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/ui/radio.js
CHANGED
|
@@ -1,49 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { at as e, ot as t, st as n } from "../_chunks/primitives.js";
|
|
3
3
|
import { springs as r } from "./lib/motion.js";
|
|
4
4
|
import { cn as i } from "./lib/utils.js";
|
|
5
5
|
import { useFormField as a } from "./form.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { t as o } from "../_chunks/field-state.js";
|
|
7
|
+
import * as s from "react";
|
|
8
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
9
|
+
import { IconCircle as l } from "@tabler/icons-react";
|
|
10
|
+
import { motion as u } from "framer-motion";
|
|
10
11
|
//#region src/ui/radio.tsx
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
var d = s.createContext(void 0), f = {
|
|
13
|
+
error: "border-error-7",
|
|
14
|
+
warning: "border-warning-7",
|
|
15
|
+
success: "border-success-7"
|
|
16
|
+
}, p = s.forwardRef(({ className: e, state: t, ...r }, s) => {
|
|
17
|
+
let l = a(), u = o(t, l.state), f = r["aria-describedby"] ?? l.helperTextId, p = r["aria-required"] ?? l.required;
|
|
18
|
+
return /* @__PURE__ */ c(d.Provider, {
|
|
19
|
+
value: u,
|
|
20
|
+
children: /* @__PURE__ */ c(n, {
|
|
21
|
+
className: i("grid gap-ds-03", e),
|
|
22
|
+
"aria-invalid": u === "error" || void 0,
|
|
23
|
+
"aria-describedby": f,
|
|
24
|
+
"aria-required": p || void 0,
|
|
25
|
+
...r,
|
|
26
|
+
ref: s
|
|
27
|
+
})
|
|
20
28
|
});
|
|
21
29
|
});
|
|
22
|
-
|
|
23
|
-
var
|
|
30
|
+
p.displayName = n.displayName;
|
|
31
|
+
var m = {
|
|
24
32
|
sm: "h-5 w-5",
|
|
25
33
|
md: "h-6 w-6",
|
|
26
34
|
lg: "h-7 w-7"
|
|
27
|
-
},
|
|
35
|
+
}, h = {
|
|
28
36
|
sm: "h-1.5 w-1.5",
|
|
29
37
|
md: "h-ds-03 w-ds-03",
|
|
30
38
|
lg: "h-2.5 w-2.5"
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
}, g = s.forwardRef(({ className: n, size: a = "md", ...o }, p) => {
|
|
40
|
+
let g = s.useContext(d);
|
|
41
|
+
return /* @__PURE__ */ c(t, {
|
|
42
|
+
ref: p,
|
|
43
|
+
className: i("touch-target aspect-square rounded-pill", m[a], "border border-surface-border-strong bg-surface-raised-hover", "transition-colors duration-fast-01", "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-action-disabled", "hover:border-accent-7 hover:bg-surface-raised-active", "data-[state=checked]:border-accent-7", g && f[g], n),
|
|
44
|
+
...o,
|
|
45
|
+
children: /* @__PURE__ */ c(e, {
|
|
46
|
+
asChild: !0,
|
|
39
47
|
className: "flex items-center justify-center",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
children: /* @__PURE__ */ c(u.span, {
|
|
49
|
+
className: "flex items-center justify-center",
|
|
50
|
+
initial: { scale: 0 },
|
|
51
|
+
animate: { scale: 1 },
|
|
52
|
+
transition: r.snappy,
|
|
53
|
+
children: /* @__PURE__ */ c(l, { className: i(h[a], "fill-accent-9 text-accent-11") })
|
|
54
|
+
})
|
|
44
55
|
})
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
g.displayName = t.displayName;
|
|
48
59
|
//#endregion
|
|
49
|
-
export {
|
|
60
|
+
export { p as RadioGroup, g as RadioGroupItem };
|
package/dist/ui/radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","names":[],"sources":["../../src/ui/radio.tsx"],"sourcesContent":["'use client'\n\nimport * as RadioGroupPrimitive from '@primitives/react-radio-group'\nimport { IconCircle } from '@tabler/icons-react'\nimport {
|
|
1
|
+
{"version":3,"file":"radio.js","names":[],"sources":["../../src/ui/radio.tsx"],"sourcesContent":["'use client'\n\nimport * as RadioGroupPrimitive from '@primitives/react-radio-group'\nimport { IconCircle } from '@tabler/icons-react'\nimport { motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useFormField } from './form'\nimport { type FieldState, resolveFieldState } from './lib/field-state'\nimport { springs } from './lib/motion'\nimport { cn } from './lib/utils'\n\n// Thread the group's resolved state to items so they show the matching border tint.\nconst RadioStateContext = React.createContext<Exclude<FieldState, 'default'> | undefined>(undefined)\n\n/** Border tint per validation state, applied to each item. */\nconst stateBorderClasses: Record<Exclude<FieldState, 'default'>, string> = {\n error: 'border-error-7',\n warning: 'border-warning-7',\n success: 'border-success-7',\n}\n\nexport interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** Validation/feedback state for the whole group. `'error'` also sets `aria-invalid`. Inherited from `FormField` when omitted. */\n state?: FieldState\n}\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(({ className, state: stateProp, ...props }, ref) => {\n const fieldCtx = useFormField()\n const state = resolveFieldState(stateProp, fieldCtx.state)\n const ariaDescribedBy = props['aria-describedby'] ?? fieldCtx.helperTextId\n const ariaRequired = props['aria-required'] ?? fieldCtx.required\n\n return (\n <RadioStateContext.Provider value={state}>\n <RadioGroupPrimitive.Root\n className={cn('grid gap-ds-03', className)}\n aria-invalid={state === 'error' || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={ariaRequired || undefined}\n {...props}\n ref={ref}\n />\n </RadioStateContext.Provider>\n )\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nexport interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {\n /** Control size — `sm` (20px), `md` (24px, default, WCAG compliant), `lg` (28px). */\n size?: 'sm' | 'md' | 'lg'\n}\n\nconst radioSizeClasses = {\n sm: 'h-5 w-5',\n md: 'h-6 w-6',\n lg: 'h-7 w-7',\n} as const\n\nconst radioIndicatorClasses = {\n sm: 'h-1.5 w-1.5',\n md: 'h-ds-03 w-ds-03',\n lg: 'h-2.5 w-2.5',\n} as const\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, size = 'md', ...props }, ref) => {\n const state = React.useContext(RadioStateContext)\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'touch-target aspect-square rounded-pill',\n radioSizeClasses[size],\n 'border border-surface-border-strong bg-surface-raised-hover',\n 'transition-colors duration-fast-01',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-action-disabled',\n 'hover:border-accent-7 hover:bg-surface-raised-active',\n 'data-[state=checked]:border-accent-7',\n state && stateBorderClasses[state],\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator asChild className=\"flex items-center justify-center\">\n <motion.span\n className=\"flex items-center justify-center\"\n initial={{ scale: 0 }}\n animate={{ scale: 1 }}\n transition={springs.snappy}\n >\n <IconCircle className={cn(radioIndicatorClasses[size], 'fill-accent-9 text-accent-11')} />\n </motion.span>\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":";;;;;;;;;;;AAaA,IAAM,IAAoB,EAAM,cAA0D,KAAA,EAAU,EAG9F,IAAqE;CACzE,OAAO;CACP,SAAS;CACT,SAAS;CACV,EAOK,IAAa,EAAM,YAGtB,EAAE,cAAW,OAAO,GAAW,GAAG,KAAS,MAAQ;CACpD,IAAM,IAAW,GAAc,EACzB,IAAQ,EAAkB,GAAW,EAAS,MAAM,EACpD,IAAkB,EAAM,uBAAuB,EAAS,cACxD,IAAe,EAAM,oBAAoB,EAAS;AAExD,QACE,kBAAC,EAAkB,UAAnB;EAA4B,OAAO;YACjC,kBAAC,GAAD;GACE,WAAW,EAAG,kBAAkB,EAAU;GAC1C,gBAAc,MAAU,WAAW,KAAA;GACnC,oBAAkB;GAClB,iBAAe,KAAgB,KAAA;GAC/B,GAAI;GACC;GACL,CAAA;EACyB,CAAA;EAE/B;AACF,EAAW,cAAA,EAAuC;AAOlD,IAAM,IAAmB;CACvB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,EAEK,IAAwB;CAC5B,IAAI;CACJ,IAAI;CACJ,IAAI;CACL,EAEK,IAAiB,EAAM,YAG1B,EAAE,cAAW,UAAO,MAAM,GAAG,KAAS,MAAQ;CAC/C,IAAM,IAAQ,EAAM,WAAW,EAAkB;AACjD,QACE,kBAAC,GAAD;EACO;EACL,WAAW,EACT,2CACA,EAAiB,IACjB,+DACA,sCACA,6GACA,gEACA,wDACA,wCACA,KAAS,EAAmB,IAC5B,EACD;EACD,GAAI;YAEJ,kBAAC,GAAD;GAA+B,SAAA;GAAQ,WAAU;aAC/C,kBAAC,EAAO,MAAR;IACE,WAAU;IACV,SAAS,EAAE,OAAO,GAAG;IACrB,SAAS,EAAE,OAAO,GAAG;IACrB,YAAY,EAAQ;cAEpB,kBAAC,GAAD,EAAY,WAAW,EAAG,EAAsB,IAAO,+BAA+B,EAAI,CAAA;IAC9E,CAAA;GACgB,CAAA;EACP,CAAA;EAE7B;AACF,EAAe,cAAA,EAAuC"}
|
package/dist/ui/select.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.Selec
|
|
|
28
28
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
29
29
|
export declare const selectTriggerVariants: (props?: ({
|
|
30
30
|
variant?: "outline" | "default" | "ghost" | null | undefined;
|
|
31
|
-
|
|
31
|
+
state?: "default" | "success" | "error" | "warning" | null | undefined;
|
|
32
32
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
33
33
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
34
34
|
/**
|
package/dist/ui/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAE3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AAEzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,eAAO,MAAM,qBAAqB;;;;8EA2BjC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EACnF,YAAY,CAAC,OAAO,qBAAqB,CAAC;CAAG;AAEjD,QAAA,MAAM,aAAa,8FAyBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAc1B,CAAA;AAIF,QAAA,MAAM,aAAa,8JAoCjB,CAAA;AAGF,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JAmBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
|
package/dist/ui/select.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { $ as e, G as t, J as n, K as r, Q as i,
|
|
2
|
+
import { $ as e, G as t, J as n, K as r, Q as i, W as a, X as o, Y as s, Z as c, et as l, it as u, nt as d, q as f, rt as p, tt as m } from "../_chunks/primitives.js";
|
|
3
3
|
import { springs as h, tweens as g } from "./lib/motion.js";
|
|
4
4
|
import { t as _ } from "../_chunks/vendor-utils.js";
|
|
5
5
|
import { cn as v } from "./lib/utils.js";
|
|
6
6
|
import { Icon as y } from "./icon.js";
|
|
7
7
|
import { useFormField as b } from "./form.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { t as x } from "../_chunks/field-state.js";
|
|
9
|
+
import * as S from "react";
|
|
10
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
|
+
import { IconCheck as T, IconChevronDown as E, IconChevronUp as D } from "@tabler/icons-react";
|
|
12
|
+
import { motion as O } from "framer-motion";
|
|
12
13
|
//#region src/ui/select.tsx
|
|
13
|
-
var
|
|
14
|
+
var k = i, A = t, j = p, M = _("flex w-full items-center justify-between whitespace-nowrap rounded-control placeholder:text-surface-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-action-disabled [&>span]:line-clamp-1 [&>span]:min-w-0", {
|
|
14
15
|
variants: {
|
|
15
16
|
variant: {
|
|
16
17
|
default: "border border-surface-border-strong bg-surface-raised-hover focus-visible:border-accent-7",
|
|
17
18
|
outline: "border border-surface-border-strong bg-transparent focus-visible:border-accent-7",
|
|
18
19
|
ghost: "border border-transparent bg-transparent hover:bg-surface-raised-hover focus-visible:border-accent-7"
|
|
19
20
|
},
|
|
20
|
-
|
|
21
|
+
state: {
|
|
21
22
|
default: "",
|
|
22
23
|
error: "border-error-7 text-error-11 focus-visible:ring-error-9",
|
|
23
24
|
success: "border-success-7",
|
|
@@ -32,59 +33,59 @@ var O = e, k = r, A = u, j = _("flex w-full items-center justify-between whitesp
|
|
|
32
33
|
},
|
|
33
34
|
defaultVariants: {
|
|
34
35
|
variant: "default",
|
|
35
|
-
|
|
36
|
+
state: "default",
|
|
36
37
|
size: "md"
|
|
37
38
|
}
|
|
38
|
-
}),
|
|
39
|
-
let
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
ref:
|
|
42
|
-
className: v(
|
|
39
|
+
}), N = S.forwardRef(({ className: e, children: t, variant: n, state: i, size: a, ...o }, s) => {
|
|
40
|
+
let c = b(), l = x(i ?? void 0, c.state), u = o["aria-describedby"] ?? c.helperTextId, f = o["aria-required"] ?? c.required;
|
|
41
|
+
return /* @__PURE__ */ w(d, {
|
|
42
|
+
ref: s,
|
|
43
|
+
className: v(M({
|
|
43
44
|
variant: n,
|
|
44
|
-
|
|
45
|
-
size:
|
|
45
|
+
state: l ?? "default",
|
|
46
|
+
size: a
|
|
46
47
|
}), e),
|
|
47
|
-
"aria-invalid":
|
|
48
|
-
"aria-describedby":
|
|
49
|
-
"aria-required":
|
|
50
|
-
...
|
|
51
|
-
children: [t, /* @__PURE__ */
|
|
48
|
+
"aria-invalid": l === "error" || void 0,
|
|
49
|
+
"aria-describedby": u,
|
|
50
|
+
"aria-required": f || void 0,
|
|
51
|
+
...o,
|
|
52
|
+
children: [t, /* @__PURE__ */ C(r, {
|
|
52
53
|
asChild: !0,
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
icon:
|
|
54
|
+
children: /* @__PURE__ */ C(y, {
|
|
55
|
+
icon: E,
|
|
55
56
|
size: "sm",
|
|
56
57
|
className: "opacity-50"
|
|
57
58
|
})
|
|
58
59
|
})]
|
|
59
60
|
});
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
-
var
|
|
62
|
+
N.displayName = d.displayName;
|
|
63
|
+
var P = S.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ C(l, {
|
|
63
64
|
ref: n,
|
|
64
65
|
className: v("flex cursor-default items-center justify-center py-ds-02", e),
|
|
65
66
|
...t,
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
icon:
|
|
67
|
+
children: /* @__PURE__ */ C(y, {
|
|
68
|
+
icon: D,
|
|
68
69
|
size: "sm"
|
|
69
70
|
})
|
|
70
71
|
}));
|
|
71
|
-
|
|
72
|
-
var
|
|
73
|
-
ref:
|
|
74
|
-
className: v("flex cursor-default items-center justify-center py-ds-02",
|
|
75
|
-
...
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
icon:
|
|
72
|
+
P.displayName = l.displayName;
|
|
73
|
+
var F = S.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ C(e, {
|
|
74
|
+
ref: r,
|
|
75
|
+
className: v("flex cursor-default items-center justify-center py-ds-02", t),
|
|
76
|
+
...n,
|
|
77
|
+
children: /* @__PURE__ */ C(y, {
|
|
78
|
+
icon: E,
|
|
78
79
|
size: "sm"
|
|
79
80
|
})
|
|
80
81
|
}));
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
ref:
|
|
84
|
-
position:
|
|
82
|
+
F.displayName = e.displayName;
|
|
83
|
+
var I = S.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, i) => /* @__PURE__ */ C(c, { children: /* @__PURE__ */ C(a, {
|
|
84
|
+
ref: i,
|
|
85
|
+
position: n,
|
|
85
86
|
asChild: !0,
|
|
86
|
-
...
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
...r,
|
|
88
|
+
children: /* @__PURE__ */ w(O.div, {
|
|
88
89
|
initial: {
|
|
89
90
|
opacity: 0,
|
|
90
91
|
scale: .95
|
|
@@ -97,45 +98,45 @@ var F = x.forwardRef(({ className: e, children: n, position: r = "popper", ...a
|
|
|
97
98
|
...h.snappy,
|
|
98
99
|
opacity: g.fade
|
|
99
100
|
},
|
|
100
|
-
className: v("relative z-popover max-h-96 min-w-[8rem] overflow-hidden rounded-overlay bg-surface-overlay text-surface-fg shadow-floating",
|
|
101
|
+
className: v("relative z-popover max-h-96 min-w-[8rem] overflow-hidden rounded-overlay bg-surface-overlay text-surface-fg shadow-floating", n === "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", e),
|
|
101
102
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
className: v("p-ds-02",
|
|
105
|
-
children:
|
|
103
|
+
/* @__PURE__ */ C(P, {}),
|
|
104
|
+
/* @__PURE__ */ C(u, {
|
|
105
|
+
className: v("p-ds-02", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
106
|
+
children: t
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ C(F, {})
|
|
108
109
|
]
|
|
109
110
|
})
|
|
110
111
|
}) }));
|
|
111
|
-
|
|
112
|
-
var
|
|
112
|
+
I.displayName = a.displayName;
|
|
113
|
+
var L = S.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ C(o, {
|
|
113
114
|
ref: n,
|
|
114
115
|
className: v("px-ds-03 py-ds-02b text-ds-md font-semibold", e),
|
|
115
116
|
...t
|
|
116
117
|
}));
|
|
117
|
-
|
|
118
|
-
var
|
|
118
|
+
L.displayName = o.displayName;
|
|
119
|
+
var R = S.forwardRef(({ className: e, children: t, ...r }, i) => /* @__PURE__ */ w(f, {
|
|
119
120
|
ref: i,
|
|
120
121
|
className: v("relative flex w-full cursor-default select-none items-center rounded-control py-ds-02b pl-ds-03 pr-ds-07 text-ds-md outline-hidden transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled", e),
|
|
121
122
|
...r,
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ C("span", {
|
|
123
124
|
className: "absolute right-ds-03 flex h-ico-sm w-ico-sm items-center justify-center",
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
-
icon:
|
|
125
|
+
children: /* @__PURE__ */ C(n, { children: /* @__PURE__ */ C(y, {
|
|
126
|
+
icon: T,
|
|
126
127
|
size: "sm"
|
|
127
128
|
}) })
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ C(s, {
|
|
129
130
|
className: "min-w-0 line-clamp-1",
|
|
130
131
|
children: t
|
|
131
132
|
})]
|
|
132
133
|
}));
|
|
133
|
-
|
|
134
|
-
var
|
|
134
|
+
R.displayName = f.displayName;
|
|
135
|
+
var z = S.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ C(m, {
|
|
135
136
|
ref: n,
|
|
136
137
|
className: v("-mx-ds-01 my-ds-02 h-px bg-surface-border", e),
|
|
137
138
|
...t
|
|
138
139
|
}));
|
|
139
|
-
|
|
140
|
+
z.displayName = m.displayName;
|
|
140
141
|
//#endregion
|
|
141
|
-
export {
|
|
142
|
+
export { k as Select, I as SelectContent, A as SelectGroup, R as SelectItem, L as SelectLabel, F as SelectScrollDownButton, P as SelectScrollUpButton, z as SelectSeparator, N as SelectTrigger, j as SelectValue, M as selectTriggerVariants };
|
package/dist/ui/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":[],"sources":["../../src/ui/select.tsx"],"sourcesContent":["'use client'\n\nimport * as SelectPrimitive from '@primitives/react-select'\nimport { IconCheck, IconChevronDown, IconChevronUp } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useFormField } from './form'\nimport { Icon } from './icon'\nimport { springs, tweens } from './lib/motion'\nimport { cn } from './lib/utils'\n\n/**\n * Select root — manages open/close state and selected value.\n *\n * **Important:** `size` is NOT a prop on `Select`. Set it on `SelectTrigger` instead.\n * Passing `size` directly to `Select` produces no TypeScript error but has no effect.\n *\n * @example\n * // CORRECT — size goes on SelectTrigger:\n * <Select onValueChange={setValue}>\n * <SelectTrigger size=\"lg\">\n * <SelectValue placeholder=\"Choose...\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"a\">Option A</SelectItem>\n * <SelectItem value=\"b\">Option B</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * // WRONG — size on Select root is silently ignored (no TypeScript error):\n * // <Select size=\"lg\">...</Select>\n */\nconst Select = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nexport const selectTriggerVariants = cva(\n 'flex w-full items-center justify-between whitespace-nowrap rounded-control placeholder:text-surface-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-action-disabled [&>span]:line-clamp-1 [&>span]:min-w-0',\n {\n variants: {\n variant: {\n default:\n 'border border-surface-border-strong bg-surface-raised-hover focus-visible:border-accent-7',\n outline:\n 'border border-surface-border-strong bg-transparent focus-visible:border-accent-7',\n ghost:\n 'border border-transparent bg-transparent hover:bg-surface-raised-hover focus-visible:border-accent-7',\n },\n color: {\n default: '',\n error: 'border-error-7 text-error-11 focus-visible:ring-error-9',\n success: 'border-success-7',\n warning: 'border-warning-7',\n },\n size: {\n xs: 'h-ds-xs-plus text-ds-sm px-ds-02',\n sm: 'h-ds-sm text-ds-sm px-ds-03',\n md: 'h-ds-md text-ds-md px-ds-04',\n lg: 'h-ds-lg text-ds-md px-ds-05',\n },\n },\n defaultVariants: { variant: 'default', color: 'default', size: 'md' },\n },\n)\n\n/**\n * Props for SelectTrigger. Use `size` here (not on the `Select` root).\n *\n * @example\n * <SelectTrigger size=\"lg\" className=\"w-[200px]\">\n * <SelectValue placeholder=\"Select an option\" />\n * </SelectTrigger>\n */\nexport interface SelectTriggerProps\n extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'color'>,\n VariantProps<typeof selectTriggerVariants> {}\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, variant, color, size, ...props }, ref) => {\n const fieldCtx = useFormField()\n const isError =\n color === 'error' ||\n (fieldCtx.state === 'error' && color == null)\n const ariaDescribedBy = props['aria-describedby'] ?? fieldCtx.helperTextId\n const ariaRequired = props['aria-required'] ?? fieldCtx.required\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ variant, color: isError && !color ? 'error' : color, size }), className)}\n aria-invalid={isError || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={ariaRequired || undefined}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <Icon icon={IconChevronDown} size=\"sm\" className=\"opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-ds-02',\n className,\n )}\n {...props}\n >\n <Icon icon={IconChevronUp} size=\"sm\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-ds-02',\n className,\n )}\n {...props}\n >\n <Icon icon={IconChevronDown} size=\"sm\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n asChild\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ ...springs.snappy, opacity: tweens.fade }}\n className={cn(\n 'relative z-popover max-h-96 min-w-[8rem] overflow-hidden rounded-overlay bg-surface-overlay text-surface-fg shadow-floating',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-ds-02',\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 </motion.div>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-ds-03 py-ds-02b text-ds-md font-semibold', className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center rounded-control py-ds-02b pl-ds-03 pr-ds-07 text-ds-md outline-hidden transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-ds-03 flex h-ico-sm w-ico-sm items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Icon icon={IconCheck} size=\"sm\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"min-w-0 line-clamp-1\">{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-ds-01 my-ds-02 h-px bg-surface-border', className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";;;;;;;;;;;;AAkCA,IAAM,IAAS,GAET,IAAc,GAEd,IAAc,GAEP,IAAwB,EACnC,+TACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,SACE;GACF,OACE;GACH;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,SAAS;GACT,SAAS;GACV;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EAAE,SAAS;EAAW,OAAO;EAAW,MAAM;EAAM;CACtE,CACF,EAcK,IAAgB,EAAM,YAGzB,EAAE,cAAW,aAAU,YAAS,UAAO,SAAM,GAAG,KAAS,MAAQ;CAClE,IAAM,IAAW,GAAc,EACzB,IACJ,MAAU,WACT,EAAS,UAAU,WAAW,KAAS,MACpC,IAAkB,EA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,GAAD,EAAwB,CAAA;GACxB,kBAAC,GAAD;IACE,WAAW,EACT,WACA,MAAa,YACX,0FACH;IAEA;IACwB,CAAA;GAC3B,kBAAC,GAAD,EAA0B,CAAA;GACf;;CACW,CAAA,EACH,CAAA,CACzB;AACF,EAAc,cAAA,EAAsC;AAEpD,IAAM,IAAc,EAAM,YAGvB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,GAAD;CACO;CACL,WAAW,EAAG,+CAA+C,EAAU;CACvE,GAAI;CACJ,CAAA,CACF;AACF,EAAY,cAAA,EAAoC;AAEhD,IAAM,IAAa,EAAM,YAGtB,EAAE,cAAW,aAAU,GAAG,KAAS,MACpC,kBAAC,GAAD;CACO;CACL,WAAW,EACT,oVACA,EACD;CACD,GAAI;WANN,CAQE,kBAAC,QAAD;EAAM,WAAU;YACd,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAM,MAAM;GAAW,MAAK;GAAO,CAAA,EACL,CAAA;EAC3B,CAAA,EACP,kBAAC,GAAD;EAA0B,WAAU;EAAwB;EAAoC,CAAA,CAC3E;GACvB;AACF,EAAW,cAAA,EAAmC;AAE9C,IAAM,IAAkB,EAAM,YAG3B,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,GAAD;CACO;CACL,WAAW,EAAG,6CAA6C,EAAU;CACrE,GAAI;CACJ,CAAA,CACF;AACF,EAAgB,cAAA,EAAwC"}
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../src/ui/select.tsx"],"sourcesContent":["'use client'\n\nimport * as SelectPrimitive from '@primitives/react-select'\nimport { IconCheck, IconChevronDown, IconChevronUp } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { motion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { useFormField } from './form'\nimport { Icon } from './icon'\nimport { type FieldState, resolveFieldState } from './lib/field-state'\nimport { springs, tweens } from './lib/motion'\nimport { cn } from './lib/utils'\n\n/**\n * Select root — manages open/close state and selected value.\n *\n * **Important:** `size` is NOT a prop on `Select`. Set it on `SelectTrigger` instead.\n * Passing `size` directly to `Select` produces no TypeScript error but has no effect.\n *\n * @example\n * // CORRECT — size goes on SelectTrigger:\n * <Select onValueChange={setValue}>\n * <SelectTrigger size=\"lg\">\n * <SelectValue placeholder=\"Choose...\" />\n * </SelectTrigger>\n * <SelectContent>\n * <SelectItem value=\"a\">Option A</SelectItem>\n * <SelectItem value=\"b\">Option B</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * // WRONG — size on Select root is silently ignored (no TypeScript error):\n * // <Select size=\"lg\">...</Select>\n */\nconst Select = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nexport const selectTriggerVariants = cva(\n 'flex w-full items-center justify-between whitespace-nowrap rounded-control placeholder:text-surface-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-action-disabled [&>span]:line-clamp-1 [&>span]:min-w-0',\n {\n variants: {\n variant: {\n default:\n 'border border-surface-border-strong bg-surface-raised-hover focus-visible:border-accent-7',\n outline:\n 'border border-surface-border-strong bg-transparent focus-visible:border-accent-7',\n ghost:\n 'border border-transparent bg-transparent hover:bg-surface-raised-hover focus-visible:border-accent-7',\n },\n state: {\n default: '',\n error: 'border-error-7 text-error-11 focus-visible:ring-error-9',\n success: 'border-success-7',\n warning: 'border-warning-7',\n },\n size: {\n xs: 'h-ds-xs-plus text-ds-sm px-ds-02',\n sm: 'h-ds-sm text-ds-sm px-ds-03',\n md: 'h-ds-md text-ds-md px-ds-04',\n lg: 'h-ds-lg text-ds-md px-ds-05',\n },\n },\n defaultVariants: { variant: 'default', state: 'default', size: 'md' },\n },\n)\n\n/**\n * Props for SelectTrigger. Use `size` here (not on the `Select` root).\n *\n * @example\n * <SelectTrigger size=\"lg\" className=\"w-[200px]\">\n * <SelectValue placeholder=\"Select an option\" />\n * </SelectTrigger>\n */\nexport interface SelectTriggerProps\n extends Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'color'>,\n VariantProps<typeof selectTriggerVariants> {}\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, variant, state: stateProp, size, ...props }, ref) => {\n const fieldCtx = useFormField()\n // Explicit `state` prop wins over FormField context (shared precedence).\n const state = resolveFieldState((stateProp ?? undefined) as FieldState | undefined, fieldCtx.state)\n const ariaDescribedBy = props['aria-describedby'] ?? fieldCtx.helperTextId\n const ariaRequired = props['aria-required'] ?? fieldCtx.required\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ variant, state: state ?? 'default', size }), className)}\n aria-invalid={state === 'error' || undefined}\n aria-describedby={ariaDescribedBy}\n aria-required={ariaRequired || undefined}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <Icon icon={IconChevronDown} size=\"sm\" className=\"opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n})\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-ds-02',\n className,\n )}\n {...props}\n >\n <Icon icon={IconChevronUp} size=\"sm\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-ds-02',\n className,\n )}\n {...props}\n >\n <Icon icon={IconChevronDown} size=\"sm\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n asChild\n {...props}\n >\n <motion.div\n initial={{ opacity: 0, scale: 0.95 }}\n animate={{ opacity: 1, scale: 1 }}\n transition={{ ...springs.snappy, opacity: tweens.fade }}\n className={cn(\n 'relative z-popover max-h-96 min-w-[8rem] overflow-hidden rounded-overlay bg-surface-overlay text-surface-fg shadow-floating',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-ds-02',\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 </motion.div>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-ds-03 py-ds-02b text-ds-md font-semibold', className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default select-none items-center rounded-control py-ds-02b pl-ds-03 pr-ds-07 text-ds-md outline-hidden transition-colors duration-fast-01 ease-productive-standard hover:bg-surface-raised focus:bg-surface-raised focus:text-surface-fg data-[disabled]:pointer-events-none data-[disabled]:opacity-action-disabled',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-ds-03 flex h-ico-sm w-ico-sm items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Icon icon={IconCheck} size=\"sm\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText className=\"min-w-0 line-clamp-1\">{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-ds-01 my-ds-02 h-px bg-surface-border', className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";;;;;;;;;;;;;AAmCA,IAAM,IAAS,GAET,IAAc,GAEd,IAAc,GAEP,IAAwB,EACnC,+TACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,SACE;GACF,OACE;GACH;EACD,OAAO;GACL,SAAS;GACT,OAAO;GACP,SAAS;GACT,SAAS;GACV;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EAAE,SAAS;EAAW,OAAO;EAAW,MAAM;EAAM;CACtE,C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,OAAO;GAAM;EACpC,SAAS;GAAE,SAAS;GAAG,OAAO;GAAG;EACjC,YAAY;GAAE,GAAG,EAAQ;GAAQ,SAAS,EAAO;GAAM;EACvD,WAAW,EACT,+HACA,MAAa,YACX,mIACF,EACD;YATH;GAWE,kBAAC,GAAD,EAAwB,CAAA;GACxB,kBAAC,GAAD;IACE,WAAW,EACT,WACA,MAAa,YACX,0FACH;IAEA;IACwB,CAAA;GAC3B,kBAAC,GAAD,EAA0B,CAAA;GACf;;CACW,CAAA,EACH,CAAA,CACzB;AACF,EAAc,cAAA,EAAsC;AAEpD,IAAM,IAAc,EAAM,YAGvB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,GAAD;CACO;CACL,WAAW,EAAG,+CAA+C,EAAU;CACvE,GAAI;CACJ,CAAA,CACF;AACF,EAAY,cAAA,EAAoC;AAEhD,IAAM,IAAa,EAAM,YAGtB,EAAE,cAAW,aAAU,GAAG,KAAS,MACpC,kBAAC,GAAD;CACO;CACL,WAAW,EACT,oVACA,EACD;CACD,GAAI;WANN,CAQE,kBAAC,QAAD;EAAM,WAAU;YACd,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAM,MAAM;GAAW,MAAK;GAAO,CAAA,EACL,CAAA;EAC3B,CAAA,EACP,kBAAC,GAAD;EAA0B,WAAU;EAAwB;EAAoC,CAAA,CAC3E;GACvB;AACF,EAAW,cAAA,EAAmC;AAE9C,IAAM,IAAkB,EAAM,YAG3B,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,GAAD;CACO;CACL,WAAW,EAAG,6CAA6C,EAAU;CACrE,GAAI;CACJ,CAAA,CACF;AACF,EAAgB,cAAA,EAAwC"}
|
package/dist/ui/separator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { ct as e } from "../_chunks/primitives.js";
|
|
3
3
|
import { cn as t } from "./lib/utils.js";
|
|
4
4
|
import * as n from "react";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
@@ -8,7 +8,7 @@ var i = n.forwardRef(({ className: n, orientation: i = "horizontal", decorative:
|
|
|
8
8
|
ref: c,
|
|
9
9
|
decorative: a,
|
|
10
10
|
orientation: i,
|
|
11
|
-
className: t("shrink-0 bg-surface-border", i === "horizontal" ? "h-
|
|
11
|
+
className: t("shrink-0 bg-surface-border", i === "horizontal" ? "h-px w-full" : "h-full w-px", n),
|
|
12
12
|
...s
|
|
13
13
|
}));
|
|
14
14
|
i.displayName = e.displayName;
|
package/dist/ui/separator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":[],"sources":["../../src/ui/separator.tsx"],"sourcesContent":["'use client'\n\nimport * as SeparatorPrimitive from '@primitives/react-separator'\nimport * as React from 'react'\n\nimport { cn } from './lib/utils'\n\nexport interface SeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {\n /**\n * @deprecated Separator is always a solid hairline. The `gradient` /\n * `gradient-left` / `gradient-right` variants were decorative (and never\n * rendered in production — the interpolated class couldn't be emitted by the\n * Tailwind 4 scanner). They now render solid; the `variant` prop is removed in\n * 0.45.0.\n */\n variant?: 'default' | 'gradient' | 'gradient-left' | 'gradient-right'\n}\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n SeparatorProps\n>(\n (\n // `variant` accepted for back-compat but no longer rendered (see @deprecated above).\n { className, orientation = 'horizontal', decorative = true, variant: _variant, ...props },\n ref,\n ) => {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-surface-border',\n orientation === 'horizontal' ? 'h-
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../src/ui/separator.tsx"],"sourcesContent":["'use client'\n\nimport * as SeparatorPrimitive from '@primitives/react-separator'\nimport * as React from 'react'\n\nimport { cn } from './lib/utils'\n\nexport interface SeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {\n /**\n * @deprecated Separator is always a solid hairline. The `gradient` /\n * `gradient-left` / `gradient-right` variants were decorative (and never\n * rendered in production — the interpolated class couldn't be emitted by the\n * Tailwind 4 scanner). They now render solid; the `variant` prop is removed in\n * 0.45.0.\n */\n variant?: 'default' | 'gradient' | 'gradient-left' | 'gradient-right'\n}\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n SeparatorProps\n>(\n (\n // `variant` accepted for back-compat but no longer rendered (see @deprecated above).\n { className, orientation = 'horizontal', decorative = true, variant: _variant, ...props },\n ref,\n ) => {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-surface-border',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className,\n )}\n {...props}\n />\n )\n },\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"],"mappings":";;;;;;AAmBA,IAAM,IAAY,EAAM,YAMpB,EAAE,cAAW,iBAAc,cAAc,gBAAa,IAAM,SAAS,GAAU,GAAG,KAClF,MAGE,kBAAC,GAAD;CACO;CACO;CACC;CACb,WAAW,EACT,8BACA,MAAgB,eAAe,gBAAgB,eAC/C,EACD;CACD,GAAI;CACJ,CAAA,CAGP;AACD,EAAU,cAAA,EAAsC"}
|
package/dist/ui/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/ui/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/ui/sheet.tsx"],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