@thesage/ui 1.1.0 → 1.3.1
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/.claude/CLAUDE.md +3 -3
- package/LICENSE +21 -0
- package/README.md +3 -4
- package/dist/dates.js +15 -5
- package/dist/dates.js.map +1 -1
- package/dist/dates.mjs +15 -5
- package/dist/dates.mjs.map +1 -1
- package/dist/{fontThemes-Cum0S1DI.d.mts → fontThemes-Dh8mtXES.d.mts} +27 -1
- package/dist/{fontThemes-Cum0S1DI.d.ts → fontThemes-Dh8mtXES.d.ts} +27 -1
- package/dist/forms.js +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +1 -1
- package/dist/forms.mjs.map +1 -1
- package/dist/{hooks-CobTQpCg.d.mts → hooks-1b8WaQf1.d.mts} +2 -2
- package/dist/{hooks-DHPlUx3T.d.ts → hooks-CKW8vE9H.d.ts} +2 -2
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +3 -375
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +3 -375
- package/dist/hooks.mjs.map +1 -1
- package/dist/index-DscTIrZ2.d.mts +29 -0
- package/dist/index-DscTIrZ2.d.ts +29 -0
- package/dist/index.d.mts +62 -36
- package/dist/index.d.ts +62 -36
- package/dist/index.js +617 -331
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +634 -348
- package/dist/index.mjs.map +1 -1
- package/dist/providers-aJW1AKg6.d.mts +30 -0
- package/dist/providers-qfyBVcPW.d.ts +30 -0
- package/dist/providers.d.mts +2 -1
- package/dist/providers.d.ts +2 -1
- package/dist/providers.js +226 -375
- package/dist/providers.js.map +1 -1
- package/dist/providers.mjs +226 -375
- package/dist/providers.mjs.map +1 -1
- package/dist/tables.js +5 -5
- package/dist/tables.js.map +1 -1
- package/dist/tables.mjs +5 -5
- package/dist/tables.mjs.map +1 -1
- package/dist/tokens.d.mts +165 -3
- package/dist/tokens.d.ts +165 -3
- package/dist/tokens.js +219 -1
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +217 -1
- package/dist/tokens.mjs.map +1 -1
- package/dist/{utils-xrpHqxXR.d.ts → utils-CIIM7dAC.d.ts} +1 -1
- package/dist/{utils-DlJKRVzQ.d.mts → utils-Cs04sxth.d.mts} +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +22 -10
- package/dist/index-L8R3gyuQ.d.mts +0 -23
- package/dist/index-L8R3gyuQ.d.ts +0 -23
- package/dist/providers-Dv3LFGtJ.d.mts +0 -17
- package/dist/providers-Dv3LFGtJ.d.ts +0 -17
package/.claude/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @thesage/ui — AI Context
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 99 accessible React components | Radix UI + Tailwind CSS | 3 themes | TypeScript strict mode | MIT
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -213,12 +213,12 @@ For gaps SDE doesn't cover, these libraries integrate well:
|
|
|
213
213
|
|
|
214
214
|
## Full API Reference
|
|
215
215
|
|
|
216
|
-
For complete props, variants, and examples for all
|
|
216
|
+
For complete props, variants, and examples for all 99 components:
|
|
217
217
|
- Web: https://thesage.dev/llms-full.txt
|
|
218
218
|
- MCP Server: `npx @thesage/mcp` (tools: list_components, search_components, get_component)
|
|
219
219
|
|
|
220
220
|
## Resources
|
|
221
221
|
|
|
222
222
|
- Docs: https://thesage.dev/docs
|
|
223
|
-
- GitHub: https://github.com/shalomormsby/
|
|
223
|
+
- GitHub: https://github.com/shalomormsby/sage-design-engine
|
|
224
224
|
- NPM: https://www.npmjs.com/package/@thesage/ui
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Shalom Ormsby
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thesage/ui)
|
|
6
|
-
[](https://github.com/shalomormsby/
|
|
6
|
+
[](https://github.com/shalomormsby/sage-design-engine/blob/main/LICENSE)
|
|
7
7
|
[](https://www.npmjs.com/package/@thesage/ui)
|
|
8
8
|
|
|
9
9
|
**Sage — Make it Lovable.**
|
|
10
10
|
|
|
11
11
|
Components that feel alive. Themes with real personality. Motion your users control. Designed for humans. Fluent with AI.
|
|
12
12
|
|
|
13
|
-
[Documentation](https://thesage.dev) | [Components](https://thesage.dev/components) | [GitHub](https://github.com/shalomormsby/
|
|
13
|
+
[Documentation](https://thesage.dev) | [Components](https://thesage.dev/components) | [GitHub](https://github.com/shalomormsby/sage-design-engine)
|
|
14
14
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
**Sage Design Engine** is a component library and design system built on **Radix UI** primitives and **Tailwind CSS**.
|
|
19
|
+
**Sage Design Engine** is a component library and design system built on **Radix UI** primitives and **Tailwind CSS**. 99 accessible components across 11 functional categories, three distinct themes with runtime switching, and a user-controlled motion system — all wired through a 4-layer design token architecture.
|
|
20
20
|
|
|
21
21
|
## Features
|
|
22
22
|
|
|
@@ -62,7 +62,6 @@ pnpm add @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities
|
|
|
62
62
|
```js
|
|
63
63
|
/** @type {import('tailwindcss').Config} */
|
|
64
64
|
module.exports = {
|
|
65
|
-
presets: [require('@thesage/config/tailwind')],
|
|
66
65
|
content: [
|
|
67
66
|
"./src/**/*.{ts,tsx}",
|
|
68
67
|
"./node_modules/@thesage/ui/dist/**/*.{js,ts,jsx,tsx}"
|
package/dist/dates.js
CHANGED
|
@@ -56,12 +56,12 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
56
56
|
{
|
|
57
57
|
variants: {
|
|
58
58
|
variant: {
|
|
59
|
-
default: "bg-primary text-primary-foreground shadow",
|
|
60
|
-
primary: "bg-primary text-primary-foreground shadow",
|
|
59
|
+
default: "bg-primary text-primary-foreground shadow-sm",
|
|
60
|
+
primary: "bg-primary text-primary-foreground shadow-sm",
|
|
61
61
|
// Alias for default
|
|
62
|
-
destructive: "bg-destructive text-destructive-foreground shadow-
|
|
63
|
-
outline: "border border-input bg-transparent shadow-
|
|
64
|
-
secondary: "bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-
|
|
62
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs",
|
|
63
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-primary hover:text-primary-foreground hover:border-primary",
|
|
64
|
+
secondary: "bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-xs hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground",
|
|
65
65
|
ghost: "hover:text-accent-foreground",
|
|
66
66
|
link: "text-primary underline-offset-4 hover:underline"
|
|
67
67
|
},
|
|
@@ -170,6 +170,7 @@ var PopoverContent = ({
|
|
|
170
170
|
className,
|
|
171
171
|
align = "center",
|
|
172
172
|
sideOffset = 4,
|
|
173
|
+
style,
|
|
173
174
|
...props
|
|
174
175
|
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
175
176
|
PopoverPrimitive.Content,
|
|
@@ -181,6 +182,15 @@ var PopoverContent = ({
|
|
|
181
182
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
182
183
|
className
|
|
183
184
|
),
|
|
185
|
+
style: {
|
|
186
|
+
backgroundColor: "var(--color-popover, #ffffff)",
|
|
187
|
+
color: "var(--color-popover-foreground, #0a0a0a)",
|
|
188
|
+
border: "1px solid var(--color-border, #d4d4d4)",
|
|
189
|
+
borderRadius: "var(--radius, 0.5rem)",
|
|
190
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
191
|
+
zIndex: 50,
|
|
192
|
+
...style
|
|
193
|
+
},
|
|
184
194
|
...props
|
|
185
195
|
}
|
|
186
196
|
) });
|
package/dist/dates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dates.ts","../src/components/data-display/Calendar.tsx","../src/lib/utils.ts","../src/components/actions/Button.tsx","../src/components/layout/DatePicker.tsx","../src/components/overlays/Popover.tsx"],"sourcesContent":["export * from './components/data-display/Calendar';\nexport * from './components/layout/DatePicker';\n","\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"../../lib/utils\"\nimport { buttonVariants } from \"../actions/Button\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ ...props }) => {\n if (props.orientation === \"left\") {\n return <ChevronLeft className=\"h-4 w-4\" />\n }\n return <ChevronRight className=\"h-4 w-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 sage-interactive [&_svg]:transition-transform [&_svg]:duration-300 hover:[&_svg]:translate-x-1',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow',\n primary: 'bg-primary text-primary-foreground shadow', // Alias for default\n destructive: 'bg-destructive text-destructive-foreground shadow-sm',\n outline: 'border border-input bg-transparent shadow-sm hover:bg-primary hover:text-primary-foreground hover:border-primary',\n secondary: 'bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-sm hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground',\n ghost: 'hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = (\n {\n ref,\n className,\n variant,\n size,\n asChild = false,\n children,\n ...props\n }: ButtonProps & {\n ref?: React.Ref<HTMLButtonElement>;\n }\n) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <span className=\"relative z-20 flex items-center justify-center gap-2\">\n {children}\n </span>\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants };\n","\"use client\"\n\nimport * as React from \"react\"\nimport { format } from \"date-fns\"\nimport { Calendar as CalendarIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../actions/Button\"\nimport { Calendar } from \"../data-display/Calendar\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../overlays/Popover\"\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n className?: string\n disabled?: boolean\n}\n\nexport function DatePicker({\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n className,\n disabled = false,\n}: DatePickerProps) {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, \"PPP\") : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={onDateChange}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n )\n}\n","\"use client\";\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = (\n {\n ref,\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n }: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n ref?: React.Ref<React.ElementRef<typeof PopoverPrimitive.Content>>;\n }\n) => (<PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n</PopoverPrimitive.Portal>)\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,0BAA0C;AAC1C,8BAA0B;;;ACJ1B,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AACxC,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC/B;;;ACJA,sCAAuC;AAEvC,wBAAqB;AA0DL;AAxDhB,IAAM,qBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACI,UAAU;AAAA,MACN,SAAS;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACV;AAAA,MAC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,UAAU;AAAA,QACV,UAAU;AAAA,QACV,cAAY;AAAA;AAAA,IACd,GACF;AAAA,KACF;AAEJ;","names":["import_jsx_runtime","props","import_lucide_react","import_jsx_runtime","import_jsx_runtime","CalendarIcon"]}
|
|
1
|
+
{"version":3,"sources":["../src/dates.ts","../src/components/data-display/Calendar.tsx","../src/lib/utils.ts","../src/components/actions/Button.tsx","../src/components/layout/DatePicker.tsx","../src/components/overlays/Popover.tsx"],"sourcesContent":["export * from './components/data-display/Calendar';\nexport * from './components/layout/DatePicker';\n","\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"../../lib/utils\"\nimport { buttonVariants } from \"../actions/Button\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ ...props }) => {\n if (props.orientation === \"left\") {\n return <ChevronLeft className=\"h-4 w-4\" />\n }\n return <ChevronRight className=\"h-4 w-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 sage-interactive [&_svg]:transition-transform [&_svg]:duration-300 hover:[&_svg]:translate-x-1',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-sm',\n primary: 'bg-primary text-primary-foreground shadow-sm', // Alias for default\n destructive: 'bg-destructive text-destructive-foreground shadow-xs',\n outline: 'border border-input bg-transparent shadow-xs hover:bg-primary hover:text-primary-foreground hover:border-primary',\n secondary: 'bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-xs hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground',\n ghost: 'hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = (\n {\n ref,\n className,\n variant,\n size,\n asChild = false,\n children,\n ...props\n }: ButtonProps & {\n ref?: React.Ref<HTMLButtonElement>;\n }\n) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <span className=\"relative z-20 flex items-center justify-center gap-2\">\n {children}\n </span>\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants };\n","\"use client\"\n\nimport * as React from \"react\"\nimport { format } from \"date-fns\"\nimport { Calendar as CalendarIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../actions/Button\"\nimport { Calendar } from \"../data-display/Calendar\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../overlays/Popover\"\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n className?: string\n disabled?: boolean\n}\n\nexport function DatePicker({\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n className,\n disabled = false,\n}: DatePickerProps) {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, \"PPP\") : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={onDateChange}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n )\n}\n","\"use client\";\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = (\n {\n ref,\n className,\n align = \"center\",\n sideOffset = 4,\n style,\n ...props\n }: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n ref?: React.Ref<React.ElementRef<typeof PopoverPrimitive.Content>>;\n }\n) => (<PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n style={{\n backgroundColor: 'var(--color-popover, #ffffff)',\n color: 'var(--color-popover-foreground, #0a0a0a)',\n border: '1px solid var(--color-border, #d4d4d4)',\n borderRadius: 'var(--radius, 0.5rem)',\n boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n zIndex: 50,\n ...style,\n }}\n {...props}\n />\n</PopoverPrimitive.Portal>)\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,0BAA0C;AAC1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A;AACN,GACF;;;ADVQ,IAAAC,sBAAA;AAVD,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,WAAW;AACb,GAAoB;AAClB,SACE,8CAAC,WACC;AAAA,iDAAC,kBAAe,SAAO,MACrB;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAW;AAAA,UACT;AAAA,UACA,CAAC,QAAQ;AAAA,UACT;AAAA,QACF;AAAA,QACA;AAAA,QAEA;AAAA,uDAAC,qBAAAC,UAAA,EAAa,WAAU,gBAAe;AAAA,UACtC,WAAO,wBAAO,MAAM,KAAK,IAAI,6CAAC,UAAM,uBAAY;AAAA;AAAA;AAAA,IACnD,GACF;AAAA,IACA,6CAAC,kBAAe,WAAU,cACxB;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU;AAAA,QACV,UAAU;AAAA,QACV,cAAY;AAAA;AAAA,IACd,GACF;AAAA,KACF;AAEJ;","names":["import_jsx_runtime","props","import_lucide_react","import_jsx_runtime","import_jsx_runtime","CalendarIcon"]}
|
package/dist/dates.mjs
CHANGED
|
@@ -20,12 +20,12 @@ var buttonVariants = cva(
|
|
|
20
20
|
{
|
|
21
21
|
variants: {
|
|
22
22
|
variant: {
|
|
23
|
-
default: "bg-primary text-primary-foreground shadow",
|
|
24
|
-
primary: "bg-primary text-primary-foreground shadow",
|
|
23
|
+
default: "bg-primary text-primary-foreground shadow-sm",
|
|
24
|
+
primary: "bg-primary text-primary-foreground shadow-sm",
|
|
25
25
|
// Alias for default
|
|
26
|
-
destructive: "bg-destructive text-destructive-foreground shadow-
|
|
27
|
-
outline: "border border-input bg-transparent shadow-
|
|
28
|
-
secondary: "bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-
|
|
26
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs",
|
|
27
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-primary hover:text-primary-foreground hover:border-primary",
|
|
28
|
+
secondary: "bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-xs hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground",
|
|
29
29
|
ghost: "hover:text-accent-foreground",
|
|
30
30
|
link: "text-primary underline-offset-4 hover:underline"
|
|
31
31
|
},
|
|
@@ -134,6 +134,7 @@ var PopoverContent = ({
|
|
|
134
134
|
className,
|
|
135
135
|
align = "center",
|
|
136
136
|
sideOffset = 4,
|
|
137
|
+
style,
|
|
137
138
|
...props
|
|
138
139
|
}) => /* @__PURE__ */ jsx3(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
139
140
|
PopoverPrimitive.Content,
|
|
@@ -145,6 +146,15 @@ var PopoverContent = ({
|
|
|
145
146
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
146
147
|
className
|
|
147
148
|
),
|
|
149
|
+
style: {
|
|
150
|
+
backgroundColor: "var(--color-popover, #ffffff)",
|
|
151
|
+
color: "var(--color-popover-foreground, #0a0a0a)",
|
|
152
|
+
border: "1px solid var(--color-border, #d4d4d4)",
|
|
153
|
+
borderRadius: "var(--radius, 0.5rem)",
|
|
154
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
155
|
+
zIndex: 50,
|
|
156
|
+
...style
|
|
157
|
+
},
|
|
148
158
|
...props
|
|
149
159
|
}
|
|
150
160
|
) });
|
package/dist/dates.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/Calendar.tsx","../src/lib/utils.ts","../src/components/actions/Button.tsx","../src/components/layout/DatePicker.tsx","../src/components/overlays/Popover.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"../../lib/utils\"\nimport { buttonVariants } from \"../actions/Button\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ ...props }) => {\n if (props.orientation === \"left\") {\n return <ChevronLeft className=\"h-4 w-4\" />\n }\n return <ChevronRight className=\"h-4 w-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 sage-interactive [&_svg]:transition-transform [&_svg]:duration-300 hover:[&_svg]:translate-x-1',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow',\n primary: 'bg-primary text-primary-foreground shadow', // Alias for default\n destructive: 'bg-destructive text-destructive-foreground shadow-sm',\n outline: 'border border-input bg-transparent shadow-sm hover:bg-primary hover:text-primary-foreground hover:border-primary',\n secondary: 'bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-sm hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground',\n ghost: 'hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = (\n {\n ref,\n className,\n variant,\n size,\n asChild = false,\n children,\n ...props\n }: ButtonProps & {\n ref?: React.Ref<HTMLButtonElement>;\n }\n) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <span className=\"relative z-20 flex items-center justify-center gap-2\">\n {children}\n </span>\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants };\n","\"use client\"\n\nimport * as React from \"react\"\nimport { format } from \"date-fns\"\nimport { Calendar as CalendarIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../actions/Button\"\nimport { Calendar } from \"../data-display/Calendar\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../overlays/Popover\"\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n className?: string\n disabled?: boolean\n}\n\nexport function DatePicker({\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n className,\n disabled = false,\n}: DatePickerProps) {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, \"PPP\") : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={onDateChange}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n )\n}\n","\"use client\";\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = (\n {\n ref,\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n }: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n ref?: React.Ref<React.ElementRef<typeof PopoverPrimitive.Content>>;\n }\n) => (<PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n</PopoverPrimitive.Portal>)\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"],"mappings":";;;AAGA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,iBAAiB;;;ACJ1B,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AACxC,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC/B;;;ACJA,SAAS,WAA8B;AAEvC,SAAS,YAAY;AA0DL;AAxDhB,IAAM,iBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACI,UAAU;AAAA,MACN,SAAS;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACF,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACV;AAAA,IAC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U;AAAA,QACV,cAAY;AAAA;AAAA,IACd,GACF;AAAA,KACF;AAEJ;","names":["jsx","props","jsx","jsx","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/Calendar.tsx","../src/lib/utils.ts","../src/components/actions/Button.tsx","../src/components/layout/DatePicker.tsx","../src/components/overlays/Popover.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"../../lib/utils\"\nimport { buttonVariants } from \"../actions/Button\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ ...props }) => {\n if (props.orientation === \"left\") {\n return <ChevronLeft className=\"h-4 w-4\" />\n }\n return <ChevronRight className=\"h-4 w-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 sage-interactive [&_svg]:transition-transform [&_svg]:duration-300 hover:[&_svg]:translate-x-1',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground shadow-sm',\n primary: 'bg-primary text-primary-foreground shadow-sm', // Alias for default\n destructive: 'bg-destructive text-destructive-foreground shadow-xs',\n outline: 'border border-input bg-transparent shadow-xs hover:bg-primary hover:text-primary-foreground hover:border-primary',\n secondary: 'bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-xs hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground',\n ghost: 'hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = (\n {\n ref,\n className,\n variant,\n size,\n asChild = false,\n children,\n ...props\n }: ButtonProps & {\n ref?: React.Ref<HTMLButtonElement>;\n }\n) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <span className=\"relative z-20 flex items-center justify-center gap-2\">\n {children}\n </span>\n )}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants };\n","\"use client\"\n\nimport * as React from \"react\"\nimport { format } from \"date-fns\"\nimport { Calendar as CalendarIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../actions/Button\"\nimport { Calendar } from \"../data-display/Calendar\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../overlays/Popover\"\n\nexport interface DatePickerProps {\n date?: Date\n onDateChange?: (date: Date | undefined) => void\n placeholder?: string\n className?: string\n disabled?: boolean\n}\n\nexport function DatePicker({\n date,\n onDateChange,\n placeholder = \"Pick a date\",\n className,\n disabled = false,\n}: DatePickerProps) {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n disabled={disabled}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {date ? format(date, \"PPP\") : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n selected={date}\n onSelect={onDateChange}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n )\n}\n","\"use client\";\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = (\n {\n ref,\n className,\n align = \"center\",\n sideOffset = 4,\n style,\n ...props\n }: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n ref?: React.Ref<React.ElementRef<typeof PopoverPrimitive.Content>>;\n }\n) => (<PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n style={{\n backgroundColor: 'var(--color-popover, #ffffff)',\n color: 'var(--color-popover-foreground, #0a0a0a)',\n border: '1px solid var(--color-border, #d4d4d4)',\n borderRadius: 'var(--radius, 0.5rem)',\n boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n zIndex: 50,\n ...style,\n }}\n {...props}\n />\n</PopoverPrimitive.Portal>)\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"],"mappings":";;;AAGA,SAAS,aAAa,oBAAoB;AAC1C,SAAS,iBAAiB;;;ACJ1B,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AACxC,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC/B;;;ACJA,SAAS,WAA8B;AAEvC,SAAS,YAAY;A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,EACd;AAAA,EACA,WAAW;AACb,GAAoB;AAClB,SACE,qBAAC,WACC;AAAA,oBAAAA,KAAC,kBAAe,SAAO,MACrB;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAW;AAAA,UACT;AAAA,UACA,CAAC,QAAQ;AAAA,UACT;AAAA,QACF;AAAA,QACA;AAAA,QAEA;AAAA,0BAAAA,KAAC,gBAAa,WAAU,gBAAe;AAAA,UACtC,OAAO,OAAO,MAAM,KAAK,IAAI,gBAAAA,KAAC,UAAM,uBAAY;AAAA;AAAA;AAAA,IACnD,GACF;AAAA,IACA,gBAAAA,KAAC,kBAAe,WAAU,cACxB,0BAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU;AAAA,QACV,UAAU;AAAA,QACV,cAAY;AAAA;AAAA,IACd,GACF;AAAA,KACF;AAEJ;","names":["jsx","props","jsx","jsx","jsx"]}
|
|
@@ -67,6 +67,19 @@ declare const fontFamilies: {
|
|
|
67
67
|
readonly mono: "Code blocks, technical content";
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
readonly speedboat: {
|
|
71
|
+
readonly heading: "Montserrat";
|
|
72
|
+
readonly body: "Roboto";
|
|
73
|
+
readonly sans: "Roboto";
|
|
74
|
+
readonly mono: "Fira Code";
|
|
75
|
+
readonly description: "Moloco brand typography — Montserrat headings with Roboto body";
|
|
76
|
+
readonly usage: {
|
|
77
|
+
readonly heading: "Brand headings, section titles";
|
|
78
|
+
readonly body: "UI text, data labels, form content";
|
|
79
|
+
readonly sans: "All sans-serif needs";
|
|
80
|
+
readonly mono: "Code blocks, technical content";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
70
83
|
};
|
|
71
84
|
/**
|
|
72
85
|
* Type-safe theme names based on font families
|
|
@@ -477,6 +490,19 @@ declare const typographySystem: {
|
|
|
477
490
|
readonly mono: "Code blocks, technical content";
|
|
478
491
|
};
|
|
479
492
|
};
|
|
493
|
+
readonly speedboat: {
|
|
494
|
+
readonly heading: "Montserrat";
|
|
495
|
+
readonly body: "Roboto";
|
|
496
|
+
readonly sans: "Roboto";
|
|
497
|
+
readonly mono: "Fira Code";
|
|
498
|
+
readonly description: "Moloco brand typography — Montserrat headings with Roboto body";
|
|
499
|
+
readonly usage: {
|
|
500
|
+
readonly heading: "Brand headings, section titles";
|
|
501
|
+
readonly body: "UI text, data labels, form content";
|
|
502
|
+
readonly sans: "All sans-serif needs";
|
|
503
|
+
readonly mono: "Code blocks, technical content";
|
|
504
|
+
};
|
|
505
|
+
};
|
|
480
506
|
};
|
|
481
507
|
readonly sizes: {
|
|
482
508
|
readonly xs: {
|
|
@@ -839,4 +865,4 @@ declare function getFontThemeById(id: string): FontTheme | undefined;
|
|
|
839
865
|
*/
|
|
840
866
|
declare function generateScale(fontTheme: FontTheme): TypographyScale;
|
|
841
867
|
|
|
842
|
-
export {
|
|
868
|
+
export { semanticWeights as A, typePresets as B, typographySystem as C, type FontSize as F, type LetterSpacing as L, type TypeLevel as T, type FontTheme as a, type FontThemeCategory as b, type FontWeight as c, type LineHeight as d, type TypePreset as e, type TypographyScale as f, type TypographyTheme as g, fontFamilies as h, fontLoadingConfig as i, fontSizes as j, fontThemes as k, fontWeights as l, generateScale as m, getAccessibleFontThemes as n, getFontThemeById as o, getFontThemesByCategory as p, getFontThemesByMood as q, getFontThemesForUseCase as r, getFontVariable as s, getResponsiveFontSize as t, getThemeFontVariables as u, letterSpacing as v, lineHeights as w, semanticLetterSpacing as x, semanticLineHeights as y, semanticSizes as z };
|
|
@@ -67,6 +67,19 @@ declare const fontFamilies: {
|
|
|
67
67
|
readonly mono: "Code blocks, technical content";
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
readonly speedboat: {
|
|
71
|
+
readonly heading: "Montserrat";
|
|
72
|
+
readonly body: "Roboto";
|
|
73
|
+
readonly sans: "Roboto";
|
|
74
|
+
readonly mono: "Fira Code";
|
|
75
|
+
readonly description: "Moloco brand typography — Montserrat headings with Roboto body";
|
|
76
|
+
readonly usage: {
|
|
77
|
+
readonly heading: "Brand headings, section titles";
|
|
78
|
+
readonly body: "UI text, data labels, form content";
|
|
79
|
+
readonly sans: "All sans-serif needs";
|
|
80
|
+
readonly mono: "Code blocks, technical content";
|
|
81
|
+
};
|
|
82
|
+
};
|
|
70
83
|
};
|
|
71
84
|
/**
|
|
72
85
|
* Type-safe theme names based on font families
|
|
@@ -477,6 +490,19 @@ declare const typographySystem: {
|
|
|
477
490
|
readonly mono: "Code blocks, technical content";
|
|
478
491
|
};
|
|
479
492
|
};
|
|
493
|
+
readonly speedboat: {
|
|
494
|
+
readonly heading: "Montserrat";
|
|
495
|
+
readonly body: "Roboto";
|
|
496
|
+
readonly sans: "Roboto";
|
|
497
|
+
readonly mono: "Fira Code";
|
|
498
|
+
readonly description: "Moloco brand typography — Montserrat headings with Roboto body";
|
|
499
|
+
readonly usage: {
|
|
500
|
+
readonly heading: "Brand headings, section titles";
|
|
501
|
+
readonly body: "UI text, data labels, form content";
|
|
502
|
+
readonly sans: "All sans-serif needs";
|
|
503
|
+
readonly mono: "Code blocks, technical content";
|
|
504
|
+
};
|
|
505
|
+
};
|
|
480
506
|
};
|
|
481
507
|
readonly sizes: {
|
|
482
508
|
readonly xs: {
|
|
@@ -839,4 +865,4 @@ declare function getFontThemeById(id: string): FontTheme | undefined;
|
|
|
839
865
|
*/
|
|
840
866
|
declare function generateScale(fontTheme: FontTheme): TypographyScale;
|
|
841
867
|
|
|
842
|
-
export {
|
|
868
|
+
export { semanticWeights as A, typePresets as B, typographySystem as C, type FontSize as F, type LetterSpacing as L, type TypeLevel as T, type FontTheme as a, type FontThemeCategory as b, type FontWeight as c, type LineHeight as d, type TypePreset as e, type TypographyScale as f, type TypographyTheme as g, fontFamilies as h, fontLoadingConfig as i, fontSizes as j, fontThemes as k, fontWeights as l, generateScale as m, getAccessibleFontThemes as n, getFontThemeById as o, getFontThemesByCategory as p, getFontThemesByMood as q, getFontThemesForUseCase as r, getFontVariable as s, getResponsiveFontSize as t, getThemeFontVariables as u, letterSpacing as v, lineHeights as w, semanticLetterSpacing as x, semanticLineHeights as y, semanticSizes as z };
|
package/dist/forms.js
CHANGED
|
@@ -59,7 +59,7 @@ var import_class_variance_authority = require("class-variance-authority");
|
|
|
59
59
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
60
60
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
61
|
var labelVariants = (0, import_class_variance_authority.cva)(
|
|
62
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
62
|
+
"block mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
63
63
|
);
|
|
64
64
|
var Label = ({
|
|
65
65
|
ref,
|
package/dist/forms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/forms.ts","../src/components/forms/Form.tsx","../src/lib/utils.ts","../src/components/forms/Label.tsx"],"sourcesContent":["export * from './components/forms/Form';\n","\"use client\";\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Label } from \"./Label\"\n\nconst Form: typeof FormProvider = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n }\n) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nconst FormLabel = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nconst FormControl = (\n {\n ref,\n ...props\n }: React.ComponentPropsWithoutRef<typeof Slot> & {\n ref?: React.Ref<React.ElementRef<typeof Slot>>;\n }\n) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nconst FormDescription = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nconst FormMessage = (\n {\n ref,\n className,\n children,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => (<LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n/>)\n\nexport { Label, labelVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,YAAuB;AAEvB,wBAAqB;AACrB,6BAOO;;;ACXP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AACxC,aAAO,mCAAQ,kBA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EACH;AAEJ;","names":["import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/forms.ts","../src/components/forms/Form.tsx","../src/lib/utils.ts","../src/components/forms/Label.tsx"],"sourcesContent":["export * from './components/forms/Form';\n","\"use client\";\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Label } from \"./Label\"\n\nconst Form: typeof FormProvider = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n }\n) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nconst FormLabel = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nconst FormControl = (\n {\n ref,\n ...props\n }: React.ComponentPropsWithoutRef<typeof Slot> & {\n ref?: React.Ref<React.ElementRef<typeof Slot>>;\n }\n) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nconst FormDescription = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nconst FormMessage = (\n {\n ref,\n className,\n children,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"block mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => (<LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n/>)\n\nexport { Label, labelVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,YAAuB;AAEvB,wBAAqB;AACrB,6BAOO;;;ACXP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AACxC,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC/B;;;ACJA,sCAAuC;AACvC,qBAAgC;AAgB1B;AAbN,IAAM,oBAAgB;AAAA,EAClB;AACJ;AAEA,IAAM,QAAQ,CACV;AAAA,EACI;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAIE;AAAA,EAAgB;AAAA,EAAf;AAAA,IACH;AAAA,IACA,WAAW,GAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACR;;;AFeM,IAAAA,sBAAA;AArBN,IAAM,OAA4B;AASlC,IAAM,mBAAyB;AAAA,EAC7B,CAAC;AACH;AAEA,IAAM,YAAY,CAGhB;AAAA,EACA,GAAG;AACL,MAA4C;AAC1C,SACE,6CAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK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C,QACG,GAAG,iBAAiB,KACpB,GAAG,iBAAiB,IAAI,aAAa;AAAA,MAE3C,gBAAc,CAAC,CAAC;AAAA,MACf,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,kBAAkB,CACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAGG;AACH,QAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,cAAc,CAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAGG;AACH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI;AAE9C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,wCAAwC,SAAS;AAAA,MAC9D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["import_jsx_runtime"]}
|
package/dist/forms.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { cva } from "class-variance-authority";
|
|
|
21
21
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
22
22
|
import { jsx } from "react/jsx-runtime";
|
|
23
23
|
var labelVariants = cva(
|
|
24
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
24
|
+
"block mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
25
25
|
);
|
|
26
26
|
var Label = ({
|
|
27
27
|
ref,
|
package/dist/forms.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/forms/Form.tsx","../src/lib/utils.ts","../src/components/forms/Label.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Label } from \"./Label\"\n\nconst Form: typeof FormProvider = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n }\n) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nconst FormLabel = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nconst FormControl = (\n {\n ref,\n ...props\n }: React.ComponentPropsWithoutRef<typeof Slot> & {\n ref?: React.Ref<React.ElementRef<typeof Slot>>;\n }\n) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nconst FormDescription = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nconst FormMessage = (\n {\n ref,\n className,\n children,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => (<LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n/>)\n\nexport { Label, labelVariants }\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,OACK;;;ACXP,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AACxC,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC/B;;;ACJA,SAAS,WAA8B;AACvC,YAAY,oBAAoB;AAgB1B;AAbN,IAAM,gBAAgB;AAAA,EAClB;AACJ;AAEA,IAAM,QAAQ,CACV;AAAA,EACI;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAIE;AAAA,EAAgB;AAAA,EAAf;AAAA,IACH;AAAA,IACA,WAAW,GAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACR;;;AFeM,gBAAAA,YAAA;AArBN,IAAM,OAA4B;AASlC,IAAM,mBAAyB;AAAA,EAC7B,CAAC;AACH;AAEA,IAAM,YAAY,CAGhB;AAAA,EACA,GAAG;AACL,MAA4C;AAC1C,SACE,gBAAAA,KAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK,GACnD,0BAAAA,KAAC,cAAY,GAAG,OAAO,GACzB;AAEJ;AAEA,IAAM,eAAe,MAAM;AACzB,QAAM,eAAqB,iBAAW,gBAAgB;AACtD,QAAM,cAAoB,iBAAW,eAAe;AACpD,QAAM,EAAE,eAA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EA,IAAM,kBAAkB,CACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAGG;AACH,QAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,IAAM,cAAc,CAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAGG;AACH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI;AAE9C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,wCAAwC,SAAS;AAAA,MAC9D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["jsx"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/forms/Form.tsx","../src/lib/utils.ts","../src/components/forms/Label.tsx"],"sourcesContent":["\"use client\";\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Label } from \"./Label\"\n\nconst Form: typeof FormProvider = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nconst FormItem = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>;\n }\n) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n}\n\nconst FormLabel = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nconst FormControl = (\n {\n ref,\n ...props\n }: React.ComponentPropsWithoutRef<typeof Slot> & {\n ref?: React.Ref<React.ElementRef<typeof Slot>>;\n }\n) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nconst FormDescription = (\n {\n ref,\n className,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nconst FormMessage = (\n {\n ref,\n className,\n children,\n ...props\n }: React.HTMLAttributes<HTMLParagraphElement> & {\n ref?: React.Ref<HTMLParagraphElement>;\n }\n) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message) : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"block mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = (\n {\n ref,\n className,\n ...props\n }: React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants> & {\n ref?: React.Ref<React.ElementRef<typeof LabelPrimitive.Root>>;\n }\n) => (<LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n/>)\n\nexport { Label, labelVariants }\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,OACK;;;ACXP,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,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A;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,WAAW,GAAG,wCAAwC,SAAS;AAAA,MAC9D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["jsx"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ThemeName, C as ColorMode } from './index-
|
|
1
|
+
import { T as ThemeName, C as ColorMode } from './index-DscTIrZ2.mjs';
|
|
2
2
|
import { F as FieldValidation, a as FormErrors } from './validation-Bj1ye-v_.mjs';
|
|
3
3
|
|
|
4
4
|
interface ThemeHook {
|
|
@@ -222,4 +222,4 @@ declare namespace hooks {
|
|
|
222
222
|
export { type hooks_MotionPreference as MotionPreference, type hooks_ThemeHook as ThemeHook, type hooks_UseFormOptions as UseFormOptions, type hooks_UseFormReturn as UseFormReturn, hooks_useForm as useForm, hooks_useMotionPreference as useMotionPreference, hooks_useTheme as useTheme };
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export { type MotionPreference as M, type ThemeHook as T, type UseFormOptions as U,
|
|
225
|
+
export { type MotionPreference as M, type ThemeHook as T, type UseFormOptions as U, type UseFormReturn as a, useMotionPreference as b, useTheme as c, hooks as h, useForm as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ThemeName, C as ColorMode } from './index-
|
|
1
|
+
import { T as ThemeName, C as ColorMode } from './index-DscTIrZ2.js';
|
|
2
2
|
import { F as FieldValidation, a as FormErrors } from './validation-Bj1ye-v_.js';
|
|
3
3
|
|
|
4
4
|
interface ThemeHook {
|
|
@@ -222,4 +222,4 @@ declare namespace hooks {
|
|
|
222
222
|
export { type hooks_MotionPreference as MotionPreference, type hooks_ThemeHook as ThemeHook, type hooks_UseFormOptions as UseFormOptions, type hooks_UseFormReturn as UseFormReturn, hooks_useForm as useForm, hooks_useMotionPreference as useMotionPreference, hooks_useTheme as useTheme };
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export { type MotionPreference as M, type ThemeHook as T, type UseFormOptions as U,
|
|
225
|
+
export { type MotionPreference as M, type ThemeHook as T, type UseFormOptions as U, type UseFormReturn as a, useMotionPreference as b, useTheme as c, hooks as h, useForm as u };
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as MotionPreference, T as ThemeHook, U as UseFormOptions,
|
|
2
|
-
import './index-
|
|
1
|
+
export { M as MotionPreference, T as ThemeHook, U as UseFormOptions, a as UseFormReturn, u as useForm, b as useMotionPreference, c as useTheme } from './hooks-1b8WaQf1.mjs';
|
|
2
|
+
import './index-DscTIrZ2.mjs';
|
|
3
3
|
import './validation-Bj1ye-v_.mjs';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { M as MotionPreference, T as ThemeHook, U as UseFormOptions,
|
|
2
|
-
import './index-
|
|
1
|
+
export { M as MotionPreference, T as ThemeHook, U as UseFormOptions, a as UseFormReturn, u as useForm, b as useMotionPreference, c as useTheme } from './hooks-CKW8vE9H.js';
|
|
2
|
+
import './index-DscTIrZ2.js';
|
|
3
3
|
import './validation-Bj1ye-v_.js';
|