@seekalfred/primitives 0.2.0 → 0.4.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/README.md +975 -13
- package/dist/accordion/accordion.d.ts +107 -0
- package/dist/accordion/accordion.js +84 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +2 -0
- package/dist/alert/alert.d.ts +68 -0
- package/dist/alert/alert.js +67 -0
- package/dist/alert/alert.js.map +1 -0
- package/dist/alert/index.d.ts +2 -0
- package/dist/alert/index.js +2 -0
- package/dist/alert-dialog/alert-dialog.d.ts +53 -0
- package/dist/alert-dialog/alert-dialog.js +16 -0
- package/dist/alert-dialog/alert-dialog.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +2 -0
- package/dist/alert-dialog/index.js +2 -0
- package/dist/avatar/avatar.d.ts +50 -0
- package/dist/avatar/avatar.js +91 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +2 -0
- package/dist/badge/badge.d.ts +47 -0
- package/dist/badge/badge.js +189 -0
- package/dist/badge/badge.js.map +1 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +2 -0
- package/dist/breadcrumb/breadcrumb.d.ts +98 -0
- package/dist/breadcrumb/breadcrumb.js +93 -0
- package/dist/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +2 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/button/button.d.ts +1 -1
- package/dist/button/button.js +7 -0
- package/dist/button/button.js.map +1 -1
- package/dist/calendar/calendar.d.ts +154 -0
- package/dist/calendar/calendar.js +282 -0
- package/dist/calendar/calendar.js.map +1 -0
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.js +2 -0
- package/dist/card/card.d.ts +93 -0
- package/dist/card/card.js +105 -0
- package/dist/card/card.js.map +1 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +2 -0
- package/dist/checkbox/checkbox.d.ts +63 -0
- package/dist/checkbox/checkbox.js +94 -0
- package/dist/checkbox/checkbox.js.map +1 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/dialog/dialog.d.ts +140 -0
- package/dist/dialog/dialog.js +127 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +2 -0
- package/dist/index.d.ts +30 -1
- package/dist/index.js +30 -1
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +2 -0
- package/dist/input/input.d.ts +80 -0
- package/dist/input/input.js +195 -0
- package/dist/input/input.js.map +1 -0
- package/dist/label/index.d.ts +2 -0
- package/dist/label/index.js +2 -0
- package/dist/label/label.d.ts +41 -0
- package/dist/label/label.js +44 -0
- package/dist/label/label.js.map +1 -0
- package/dist/lib/field-surface.js +40 -0
- package/dist/lib/field-surface.js.map +1 -0
- package/dist/lib/selection-control.js +57 -0
- package/dist/lib/selection-control.js.map +1 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/menu.d.ts +98 -0
- package/dist/menu/menu.js +99 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover/popover.d.ts +50 -0
- package/dist/popover/popover.js +46 -0
- package/dist/popover/popover.js.map +1 -0
- package/dist/progress/index.d.ts +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/progress.d.ts +82 -0
- package/dist/progress/progress.js +82 -0
- package/dist/progress/progress.js.map +1 -0
- package/dist/radio-group/index.d.ts +2 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/radio-group/radio-group.d.ts +53 -0
- package/dist/radio-group/radio-group.js +65 -0
- package/dist/radio-group/radio-group.js.map +1 -0
- package/dist/scroll-area/index.d.ts +2 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area/scroll-area.d.ts +74 -0
- package/dist/scroll-area/scroll-area.js +63 -0
- package/dist/scroll-area/scroll-area.js.map +1 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +2 -0
- package/dist/select/select.d.ts +105 -0
- package/dist/select/select.js +149 -0
- package/dist/select/select.js.map +1 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/separator.d.ts +42 -0
- package/dist/separator/separator.js +49 -0
- package/dist/separator/separator.js.map +1 -0
- package/dist/sheet/index.d.ts +2 -0
- package/dist/sheet/index.js +2 -0
- package/dist/sheet/sheet.d.ts +96 -0
- package/dist/sheet/sheet.js +98 -0
- package/dist/sheet/sheet.js.map +1 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/skeleton.d.ts +33 -0
- package/dist/skeleton/skeleton.js +42 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/slider.d.ts +70 -0
- package/dist/slider/slider.js +92 -0
- package/dist/slider/slider.js.map +1 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/spinner.d.ts +75 -0
- package/dist/spinner/spinner.js +68 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/switch.d.ts +50 -0
- package/dist/switch/switch.js +66 -0
- package/dist/switch/switch.js.map +1 -0
- package/dist/table/index.d.ts +2 -0
- package/dist/table/index.js +2 -0
- package/dist/table/table.d.ts +288 -0
- package/dist/table/table.js +513 -0
- package/dist/table/table.js.map +1 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/tabs.d.ts +79 -0
- package/dist/tabs/tabs.js +103 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +2 -0
- package/dist/textarea/textarea.d.ts +27 -0
- package/dist/textarea/textarea.js +37 -0
- package/dist/textarea/textarea.js.map +1 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/toast.d.ts +93 -0
- package/dist/toast/toast.js +145 -0
- package/dist/toast/toast.js.map +1 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/tooltip.d.ts +70 -0
- package/dist/tooltip/tooltip.js +65 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/package.json +125 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
import { Accordion, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, AccordionTrigger, AccordionTriggerProps } from "./accordion/accordion.js";
|
|
2
|
+
import { Dialog, DialogFooter, DialogFooterProps, DialogProps, DialogTrigger, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants } from "./dialog/dialog.js";
|
|
3
|
+
import { AlertDialog, AlertDialogProps } from "./alert-dialog/alert-dialog.js";
|
|
4
|
+
import { Alert, AlertProps, alertVariants } from "./alert/alert.js";
|
|
5
|
+
import { Avatar, AvatarProps, avatarVariants } from "./avatar/avatar.js";
|
|
6
|
+
import { Badge, BadgeProps, badgeVariants } from "./badge/badge.js";
|
|
7
|
+
import { BreadcrumbItem, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants } from "./breadcrumb/breadcrumb.js";
|
|
1
8
|
import { Button, ButtonProps, buttonVariants } from "./button/button.js";
|
|
9
|
+
import { Calendar, CalendarProps, CalendarRange, CalendarRangeProps, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants } from "./calendar/calendar.js";
|
|
10
|
+
import { Card, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants } from "./card/card.js";
|
|
11
|
+
import { Checkbox, CheckboxProps, checkboxBoxVariants, checkboxVariants } from "./checkbox/checkbox.js";
|
|
12
|
+
import { Input, InputProps, inputVariants } from "./input/input.js";
|
|
13
|
+
import { Label, LabelProps, labelVariants } from "./label/label.js";
|
|
2
14
|
import { cn } from "./lib/cn.js";
|
|
3
|
-
|
|
15
|
+
import { Menu, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants } from "./menu/menu.js";
|
|
16
|
+
import { Popover, PopoverProps, PopoverTrigger, popoverVariants } from "./popover/popover.js";
|
|
17
|
+
import { Progress, ProgressProps, progressFillVariants, progressTrackVariants, progressVariants } from "./progress/progress.js";
|
|
18
|
+
import { Radio, RadioGroup, RadioGroupProps, RadioProps, radioGroupVariants, radioVariants } from "./radio-group/radio-group.js";
|
|
19
|
+
import { ScrollArea, ScrollAreaProps, scrollAreaVariants } from "./scroll-area/scroll-area.js";
|
|
20
|
+
import { Select, SelectItem, SelectItemProps, SelectProps, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants } from "./select/select.js";
|
|
21
|
+
import { Separator, SeparatorProps, separatorVariants } from "./separator/separator.js";
|
|
22
|
+
import { Sheet, SheetProps, sheetOverlayVariants, sheetPanelVariants } from "./sheet/sheet.js";
|
|
23
|
+
import { Skeleton, SkeletonProps, skeletonVariants } from "./skeleton/skeleton.js";
|
|
24
|
+
import { Slider, SliderProps, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider/slider.js";
|
|
25
|
+
import { Spinner, SpinnerProps, spinnerVariants } from "./spinner/spinner.js";
|
|
26
|
+
import { Switch, SwitchProps, switchThumbVariants, switchTrackVariants } from "./switch/switch.js";
|
|
27
|
+
import { Column, RowKey, Table, TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants } from "./table/table.js";
|
|
28
|
+
import { Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps, tabListVariants, tabPanelVariants, tabVariants, tabsVariants } from "./tabs/tabs.js";
|
|
29
|
+
import { Textarea, TextareaProps, textareaVariants } from "./textarea/textarea.js";
|
|
30
|
+
import { ToastContent, ToastRegion, ToastRegionProps, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants } from "./toast/toast.js";
|
|
31
|
+
import { Tooltip, TooltipProps, TooltipTrigger, TooltipTriggerProps, tooltipVariants } from "./tooltip/tooltip.js";
|
|
32
|
+
export { Accordion, AccordionItem, type AccordionItemProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDialog, type AlertDialogProps, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, BreadcrumbItem, type BreadcrumbItemProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, CalendarRange, type CalendarRangeProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, type Column, Dialog, DialogFooter, type DialogFooterProps, type DialogProps, DialogTrigger, Input, type InputProps, Label, type LabelProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, MenuTrigger, Popover, type PopoverProps, PopoverTrigger, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RowKey, ScrollArea, type ScrollAreaProps, Select, SelectItem, type SelectItemProps, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Table, type TableProps, Tabs, type TabsProps, Textarea, type TextareaProps, type ToastContent, ToastRegion, type ToastRegionProps, Tooltip, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, alertVariants, avatarVariants, badgeVariants, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants, buttonVariants, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants, checkboxBoxVariants, checkboxVariants, cn, createColumns, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants, inputVariants, labelVariants, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants, popoverVariants, progressFillVariants, progressTrackVariants, progressVariants, radioGroupVariants, radioVariants, scrollAreaVariants, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants, separatorVariants, sheetOverlayVariants, sheetPanelVariants, skeletonVariants, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants, spinnerVariants, switchThumbVariants, switchTrackVariants, tabListVariants, tabPanelVariants, tabVariants, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants, tabsVariants, textareaVariants, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants, tooltipVariants };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
import { cn } from "./lib/cn.js";
|
|
2
|
+
import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger } from "./accordion/accordion.js";
|
|
3
|
+
import { Dialog, DialogFooter, DialogTrigger, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants } from "./dialog/dialog.js";
|
|
4
|
+
import { AlertDialog } from "./alert-dialog/alert-dialog.js";
|
|
5
|
+
import { Alert, alertVariants } from "./alert/alert.js";
|
|
6
|
+
import { Avatar, avatarVariants } from "./avatar/avatar.js";
|
|
7
|
+
import { Badge, badgeVariants } from "./badge/badge.js";
|
|
8
|
+
import { BreadcrumbItem, Breadcrumbs, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants } from "./breadcrumb/breadcrumb.js";
|
|
2
9
|
import { Button, buttonVariants } from "./button/button.js";
|
|
3
|
-
|
|
10
|
+
import { Calendar, CalendarRange, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants } from "./calendar/calendar.js";
|
|
11
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants } from "./card/card.js";
|
|
12
|
+
import { Checkbox, checkboxBoxVariants, checkboxVariants } from "./checkbox/checkbox.js";
|
|
13
|
+
import { Input, inputVariants } from "./input/input.js";
|
|
14
|
+
import { Label, labelVariants } from "./label/label.js";
|
|
15
|
+
import { Menu, MenuItem, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants } from "./menu/menu.js";
|
|
16
|
+
import { Popover, PopoverTrigger, popoverVariants } from "./popover/popover.js";
|
|
17
|
+
import { Progress, progressFillVariants, progressTrackVariants, progressVariants } from "./progress/progress.js";
|
|
18
|
+
import { Radio, RadioGroup, radioGroupVariants, radioVariants } from "./radio-group/radio-group.js";
|
|
19
|
+
import { ScrollArea, scrollAreaVariants } from "./scroll-area/scroll-area.js";
|
|
20
|
+
import { Select, SelectItem, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants } from "./select/select.js";
|
|
21
|
+
import { Separator, separatorVariants } from "./separator/separator.js";
|
|
22
|
+
import { Sheet, sheetOverlayVariants, sheetPanelVariants } from "./sheet/sheet.js";
|
|
23
|
+
import { Skeleton, skeletonVariants } from "./skeleton/skeleton.js";
|
|
24
|
+
import { Slider, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider/slider.js";
|
|
25
|
+
import { Spinner, spinnerVariants } from "./spinner/spinner.js";
|
|
26
|
+
import { Switch, switchThumbVariants, switchTrackVariants } from "./switch/switch.js";
|
|
27
|
+
import { Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants } from "./table/table.js";
|
|
28
|
+
import { Tab, TabList, TabPanel, Tabs, tabListVariants, tabPanelVariants, tabVariants, tabsVariants } from "./tabs/tabs.js";
|
|
29
|
+
import { Textarea, textareaVariants } from "./textarea/textarea.js";
|
|
30
|
+
import { ToastRegion, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants } from "./toast/toast.js";
|
|
31
|
+
import { Tooltip, TooltipTrigger, tooltipVariants } from "./tooltip/tooltip.js";
|
|
32
|
+
export { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, Avatar, Badge, BreadcrumbItem, Breadcrumbs, Button, Calendar, CalendarRange, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogFooter, DialogTrigger, Input, Label, Menu, MenuItem, MenuSeparator, MenuTrigger, Popover, PopoverTrigger, Progress, Radio, RadioGroup, ScrollArea, Select, SelectItem, Separator, Sheet, Skeleton, Slider, Spinner, Switch, Tab, TabList, TabPanel, Table, Tabs, Textarea, ToastRegion, Tooltip, TooltipTrigger, alertVariants, avatarVariants, badgeVariants, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbsVariants, buttonVariants, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants, checkboxBoxVariants, checkboxVariants, cn, createColumns, dialogDescriptionVariants, dialogFooterVariants, dialogOverlayVariants, dialogPanelVariants, dialogTitleVariants, inputVariants, labelVariants, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants, popoverVariants, progressFillVariants, progressTrackVariants, progressVariants, radioGroupVariants, radioVariants, scrollAreaVariants, selectItemVariants, selectPopoverVariants, selectTriggerVariants, selectVariants, separatorVariants, sheetOverlayVariants, sheetPanelVariants, skeletonVariants, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants, spinnerVariants, switchThumbVariants, switchTrackVariants, tabListVariants, tabPanelVariants, tabVariants, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants, tabsVariants, textareaVariants, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants, tooltipVariants };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { InputProps } from "react-aria-components";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/input/input.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Input, ported from the legacy shadcn component onto React Aria's Input.
|
|
6
|
+
*
|
|
7
|
+
* Census: 25 files, 51 uses -- the busiest control in the app after Button.
|
|
8
|
+
* Props are `onChange` 36, `value` 35, `placeholder` 33, `id` 23, `type` 21.
|
|
9
|
+
*
|
|
10
|
+
* EVERY ONE OF THOSE 51 CALL SITES MIGRATES UNCHANGED. React Aria's `Input`
|
|
11
|
+
* takes NATIVE props -- `disabled`, `aria-invalid`, `onChange` with a real
|
|
12
|
+
* event -- not the `isDisabled`/`onChange(value)` shape the rest of React
|
|
13
|
+
* Aria uses. It reads `InputContext` when one is present, so the same
|
|
14
|
+
* component is a bare styled input today and composes inside a `TextField`
|
|
15
|
+
* the moment one is wrapped around it. There is no rename to schedule.
|
|
16
|
+
*
|
|
17
|
+
* That is also why this is not `TextField`. Wrapping 51 call sites in a
|
|
18
|
+
* field they do not have, to get a `onChange(value: string)` they did not
|
|
19
|
+
* ask for, would be the migration doing work on the app's behalf.
|
|
20
|
+
*
|
|
21
|
+
* `border-input` becomes `border-border`: in the legacy theme `--input` is
|
|
22
|
+
* character-for-character `--border` on light (`oklch(0.922 0 0)`), and the
|
|
23
|
+
* dark values differ only in alpha. A fourth token role that turns out to
|
|
24
|
+
* be an existing one, after `popover`, `accent` and the scrim.
|
|
25
|
+
*/
|
|
26
|
+
export declare const inputVariants: (props?: ({
|
|
27
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
28
|
+
hasStartIcon?: boolean | null | undefined;
|
|
29
|
+
hasEndIcon?: boolean | null | undefined;
|
|
30
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
31
|
+
/**
|
|
32
|
+
* A single-line text field.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <Input type="email" placeholder="you@example.com" value={v} onChange={e => set(e.target.value)} />
|
|
36
|
+
* <Input aria-label="Search" startIcon={<SearchIcon aria-hidden />} />
|
|
37
|
+
*/
|
|
38
|
+
interface InputProps$1 extends Omit<InputProps, "className" | "style" | "size"> {
|
|
39
|
+
/** Extra classes. Merged last, so they win conflicts with ours. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Control scale. Height and inline padding come from the same
|
|
43
|
+
* `--density-control-*` tokens as Button, so a field and a button on one
|
|
44
|
+
* rung are the same height.
|
|
45
|
+
*
|
|
46
|
+
* Type does not scale with it: the field stays at 16px everywhere, because
|
|
47
|
+
* iOS Safari zooms the viewport when a focused input's text is smaller.
|
|
48
|
+
*
|
|
49
|
+
* This REPLACES the native `size` attribute, which React Aria inherits from
|
|
50
|
+
* `InputHTMLAttributes` as a character count. No call site in the census
|
|
51
|
+
* used it; set a width with `className` instead.
|
|
52
|
+
*
|
|
53
|
+
* @default "md"
|
|
54
|
+
*/
|
|
55
|
+
size?: "sm" | "md" | "lg";
|
|
56
|
+
/**
|
|
57
|
+
* Decorative glyph at the leading edge of the field.
|
|
58
|
+
*
|
|
59
|
+
* Mark it `aria-hidden` -- the field's label carries the accessible name,
|
|
60
|
+
* and a second name source only makes it announce twice. It is sized at
|
|
61
|
+
* `--icon-sm` unless it carries a `size-*` class of its own, positioned
|
|
62
|
+
* from `--density-control-pad-md`, and the field's leading padding grows to
|
|
63
|
+
* match so the value cannot run underneath it.
|
|
64
|
+
*
|
|
65
|
+
* The slot is `pointer-events: none`, so a click on the glyph focuses the
|
|
66
|
+
* field. That makes it decorative by construction: an interactive
|
|
67
|
+
* adornment -- a password reveal, a clear button -- is NOT this prop.
|
|
68
|
+
*
|
|
69
|
+
* Two named slots rather than one `icon` plus a position prop, matching
|
|
70
|
+
* Button: a search field can legitimately carry a leading glyph AND a
|
|
71
|
+
* trailing unit, which one slot cannot express.
|
|
72
|
+
*/
|
|
73
|
+
startIcon?: ReactNode;
|
|
74
|
+
/** Decorative glyph at the trailing edge. Same rules as {@link InputProps.startIcon}. */
|
|
75
|
+
endIcon?: ReactNode;
|
|
76
|
+
}
|
|
77
|
+
declare function Input$1({ className, size, startIcon, endIcon, ...props }: InputProps$1): import("react").JSX.Element;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { Input$1 as Input, InputProps$1 as InputProps };
|
|
80
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { fieldSurfaceVariants } from "../lib/field-surface.js";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { Input } from "react-aria-components";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/input/input.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Input, ported from the legacy shadcn component onto React Aria's Input.
|
|
10
|
+
*
|
|
11
|
+
* Census: 25 files, 51 uses -- the busiest control in the app after Button.
|
|
12
|
+
* Props are `onChange` 36, `value` 35, `placeholder` 33, `id` 23, `type` 21.
|
|
13
|
+
*
|
|
14
|
+
* EVERY ONE OF THOSE 51 CALL SITES MIGRATES UNCHANGED. React Aria's `Input`
|
|
15
|
+
* takes NATIVE props -- `disabled`, `aria-invalid`, `onChange` with a real
|
|
16
|
+
* event -- not the `isDisabled`/`onChange(value)` shape the rest of React
|
|
17
|
+
* Aria uses. It reads `InputContext` when one is present, so the same
|
|
18
|
+
* component is a bare styled input today and composes inside a `TextField`
|
|
19
|
+
* the moment one is wrapped around it. There is no rename to schedule.
|
|
20
|
+
*
|
|
21
|
+
* That is also why this is not `TextField`. Wrapping 51 call sites in a
|
|
22
|
+
* field they do not have, to get a `onChange(value: string)` they did not
|
|
23
|
+
* ask for, would be the migration doing work on the app's behalf.
|
|
24
|
+
*
|
|
25
|
+
* `border-input` becomes `border-border`: in the legacy theme `--input` is
|
|
26
|
+
* character-for-character `--border` on light (`oklch(0.922 0 0)`), and the
|
|
27
|
+
* dark values differ only in alpha. A fourth token role that turns out to
|
|
28
|
+
* be an existing one, after `popover`, `accent` and the scrim.
|
|
29
|
+
*/
|
|
30
|
+
const inputVariants = cva([
|
|
31
|
+
fieldSurfaceVariants(),
|
|
32
|
+
"text-base",
|
|
33
|
+
"file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
34
|
+
"file:text-foreground"
|
|
35
|
+
], {
|
|
36
|
+
variants: {
|
|
37
|
+
/**
|
|
38
|
+
* Height and inline padding from the control scale, so `data-density`
|
|
39
|
+
* moves a whole form at once. Same three names and the same tokens as
|
|
40
|
+
* Button, because they sit in the same row: Button's `sm` is the app's
|
|
41
|
+
* second most common at 167 call sites, and while the field was locked
|
|
42
|
+
* to `md` the pair was 10px out of alignment with no supported fix.
|
|
43
|
+
*
|
|
44
|
+
* Type does NOT scale, which is the one place this axis deliberately
|
|
45
|
+
* departs from Button's. iOS Safari zooms the viewport when a focused
|
|
46
|
+
* field's text is under 16px, so `text-base` stays pinned in the base
|
|
47
|
+
* at every rung -- see the note there. Shrinking the box is a layout
|
|
48
|
+
* choice; shrinking the type is a bug on a phone.
|
|
49
|
+
*/
|
|
50
|
+
size: {
|
|
51
|
+
sm: "h-(--density-control-h-sm) px-(--density-control-pad-sm)",
|
|
52
|
+
md: "h-(--density-control-h-md) px-(--density-control-pad-md)",
|
|
53
|
+
lg: "h-(--density-control-h-lg) px-(--density-control-pad-lg)"
|
|
54
|
+
},
|
|
55
|
+
hasStartIcon: { true: "" },
|
|
56
|
+
hasEndIcon: { true: "" }
|
|
57
|
+
},
|
|
58
|
+
compoundVariants: [
|
|
59
|
+
{
|
|
60
|
+
size: "sm",
|
|
61
|
+
hasStartIcon: true,
|
|
62
|
+
class: "ps-[calc(var(--density-control-pad-sm)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
size: "md",
|
|
66
|
+
hasStartIcon: true,
|
|
67
|
+
class: "ps-[calc(var(--density-control-pad-md)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
size: "lg",
|
|
71
|
+
hasStartIcon: true,
|
|
72
|
+
class: "ps-[calc(var(--density-control-pad-lg)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
size: "sm",
|
|
76
|
+
hasEndIcon: true,
|
|
77
|
+
class: "pe-[calc(var(--density-control-pad-sm)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
size: "md",
|
|
81
|
+
hasEndIcon: true,
|
|
82
|
+
class: "pe-[calc(var(--density-control-pad-md)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
size: "lg",
|
|
86
|
+
hasEndIcon: true,
|
|
87
|
+
class: "pe-[calc(var(--density-control-pad-lg)_+_var(--icon-sm)_+_var(--density-control-gap))]"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
defaultVariants: { size: "md" }
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* An affix slot.
|
|
94
|
+
*
|
|
95
|
+
* `pointer-events-none` is load-bearing, not cosmetic: the slot is painted on
|
|
96
|
+
* top of the field, so without it the glyph swallows the click that was meant
|
|
97
|
+
* to focus the input. Which also fixes the slot's scope -- these are
|
|
98
|
+
* DECORATIVE marks. An interactive trailing control (a password reveal, a
|
|
99
|
+
* clear button) needs its own pointer events and its own accessible name, and
|
|
100
|
+
* the census found no call site for one, so it is not built here.
|
|
101
|
+
*
|
|
102
|
+
* Logical properties throughout. The product app's eighteen hand-rolled
|
|
103
|
+
* adornments are all `absolute left-*`, with `absolute start-*` at zero
|
|
104
|
+
* occurrences, so every one of them puts the glyph on the wrong side under
|
|
105
|
+
* RTL and lets the text run over it.
|
|
106
|
+
*/
|
|
107
|
+
const affixVariants = cva([
|
|
108
|
+
"pointer-events-none absolute inset-y-0 flex items-center",
|
|
109
|
+
"text-muted-foreground",
|
|
110
|
+
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-sm)"
|
|
111
|
+
], {
|
|
112
|
+
variants: {
|
|
113
|
+
side: {
|
|
114
|
+
start: "",
|
|
115
|
+
end: ""
|
|
116
|
+
},
|
|
117
|
+
size: {
|
|
118
|
+
sm: "",
|
|
119
|
+
md: "",
|
|
120
|
+
lg: ""
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
compoundVariants: [
|
|
124
|
+
{
|
|
125
|
+
side: "start",
|
|
126
|
+
size: "sm",
|
|
127
|
+
class: "start-(--density-control-pad-sm)"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
side: "start",
|
|
131
|
+
size: "md",
|
|
132
|
+
class: "start-(--density-control-pad-md)"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
side: "start",
|
|
136
|
+
size: "lg",
|
|
137
|
+
class: "start-(--density-control-pad-lg)"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
side: "end",
|
|
141
|
+
size: "sm",
|
|
142
|
+
class: "end-(--density-control-pad-sm)"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
side: "end",
|
|
146
|
+
size: "md",
|
|
147
|
+
class: "end-(--density-control-pad-md)"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
side: "end",
|
|
151
|
+
size: "lg",
|
|
152
|
+
class: "end-(--density-control-pad-lg)"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
defaultVariants: { size: "md" }
|
|
156
|
+
});
|
|
157
|
+
function Input$1({ className, size = "md", startIcon, endIcon, ...props }) {
|
|
158
|
+
const input = /* @__PURE__ */ jsx(Input, {
|
|
159
|
+
...props,
|
|
160
|
+
"data-slot": "input",
|
|
161
|
+
className: cn(inputVariants({
|
|
162
|
+
size,
|
|
163
|
+
hasStartIcon: startIcon !== void 0,
|
|
164
|
+
hasEndIcon: endIcon !== void 0
|
|
165
|
+
}), className)
|
|
166
|
+
});
|
|
167
|
+
if (startIcon === void 0 && endIcon === void 0) return input;
|
|
168
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
169
|
+
"data-slot": "input-wrapper",
|
|
170
|
+
className: "relative block w-full",
|
|
171
|
+
children: [
|
|
172
|
+
input,
|
|
173
|
+
startIcon === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
174
|
+
"data-slot": "input-start-icon",
|
|
175
|
+
className: affixVariants({
|
|
176
|
+
side: "start",
|
|
177
|
+
size
|
|
178
|
+
}),
|
|
179
|
+
children: startIcon
|
|
180
|
+
}),
|
|
181
|
+
endIcon === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
182
|
+
"data-slot": "input-end-icon",
|
|
183
|
+
className: affixVariants({
|
|
184
|
+
side: "end",
|
|
185
|
+
size
|
|
186
|
+
}),
|
|
187
|
+
children: endIcon
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
export { Input$1 as Input, inputVariants };
|
|
194
|
+
|
|
195
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":["Input","AriaInput"],"sources":["../../src/input/input.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport type { ReactNode } from \"react\";\nimport { Input as AriaInput, type InputProps as AriaInputProps } from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { fieldSurfaceVariants } from \"../lib/field-surface.js\";\n\n/**\n * Input, ported from the legacy shadcn component onto React Aria's Input.\n *\n * Census: 25 files, 51 uses -- the busiest control in the app after Button.\n * Props are `onChange` 36, `value` 35, `placeholder` 33, `id` 23, `type` 21.\n *\n * EVERY ONE OF THOSE 51 CALL SITES MIGRATES UNCHANGED. React Aria's `Input`\n * takes NATIVE props -- `disabled`, `aria-invalid`, `onChange` with a real\n * event -- not the `isDisabled`/`onChange(value)` shape the rest of React\n * Aria uses. It reads `InputContext` when one is present, so the same\n * component is a bare styled input today and composes inside a `TextField`\n * the moment one is wrapped around it. There is no rename to schedule.\n *\n * That is also why this is not `TextField`. Wrapping 51 call sites in a\n * field they do not have, to get a `onChange(value: string)` they did not\n * ask for, would be the migration doing work on the app's behalf.\n *\n * `border-input` becomes `border-border`: in the legacy theme `--input` is\n * character-for-character `--border` on light (`oklch(0.922 0 0)`), and the\n * dark values differ only in alpha. A fourth token role that turns out to\n * be an existing one, after `popover`, `accent` and the scrim.\n */\nexport const inputVariants = cva(\n [\n fieldSurfaceVariants(),\n\n // text-base always, not the legacy `text-base md:text-sm`. 16px is the\n // threshold below which iOS Safari zooms the viewport on focus, and the\n // legacy dropped to 14px at exactly the widths where that stops being a\n // phone -- which reads as a deliberate fix but leaves the field a\n // different size on either side of a breakpoint for no visual reason.\n \"text-base\",\n\n // type=\"file\" has one call site, which is not zero. Enough to keep it\n // from rendering as an unstyled user-agent button.\n \"file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium\",\n \"file:text-foreground\",\n ],\n {\n variants: {\n /**\n * Height and inline padding from the control scale, so `data-density`\n * moves a whole form at once. Same three names and the same tokens as\n * Button, because they sit in the same row: Button's `sm` is the app's\n * second most common at 167 call sites, and while the field was locked\n * to `md` the pair was 10px out of alignment with no supported fix.\n *\n * Type does NOT scale, which is the one place this axis deliberately\n * departs from Button's. iOS Safari zooms the viewport when a focused\n * field's text is under 16px, so `text-base` stays pinned in the base\n * at every rung -- see the note there. Shrinking the box is a layout\n * choice; shrinking the type is a bug on a phone.\n */\n size: {\n sm: \"h-(--density-control-h-sm) px-(--density-control-pad-sm)\",\n md: \"h-(--density-control-h-md) px-(--density-control-pad-md)\",\n lg: \"h-(--density-control-h-lg) px-(--density-control-pad-lg)\",\n },\n // Declared empty and filled by the compound variants below: the affix\n // inset depends on BOTH whether a slot is used and which rung it is on.\n hasStartIcon: { true: \"\" },\n hasEndIcon: { true: \"\" },\n },\n compoundVariants: [\n // The affix slots float ABOVE the field rather than sitting beside it\n // in a flex row, so the only thing keeping the value from running\n // underneath a glyph is this padding. It is the same three tokens that\n // place the glyph -- inline padding, icon box, control gap -- so the\n // text and the glyph move together across density AND size. A\n // hand-tuned `pl-9` at the call site can do neither, and the product\n // app has eighteen of those.\n {\n size: \"sm\",\n hasStartIcon: true,\n class:\n \"ps-[calc(var(--density-control-pad-sm)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n {\n size: \"md\",\n hasStartIcon: true,\n class:\n \"ps-[calc(var(--density-control-pad-md)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n {\n size: \"lg\",\n hasStartIcon: true,\n class:\n \"ps-[calc(var(--density-control-pad-lg)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n {\n size: \"sm\",\n hasEndIcon: true,\n class:\n \"pe-[calc(var(--density-control-pad-sm)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n {\n size: \"md\",\n hasEndIcon: true,\n class:\n \"pe-[calc(var(--density-control-pad-md)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n {\n size: \"lg\",\n hasEndIcon: true,\n class:\n \"pe-[calc(var(--density-control-pad-lg)_+_var(--icon-sm)_+_var(--density-control-gap))]\",\n },\n ],\n defaultVariants: { size: \"md\" },\n },\n);\n\n/**\n * An affix slot.\n *\n * `pointer-events-none` is load-bearing, not cosmetic: the slot is painted on\n * top of the field, so without it the glyph swallows the click that was meant\n * to focus the input. Which also fixes the slot's scope -- these are\n * DECORATIVE marks. An interactive trailing control (a password reveal, a\n * clear button) needs its own pointer events and its own accessible name, and\n * the census found no call site for one, so it is not built here.\n *\n * Logical properties throughout. The product app's eighteen hand-rolled\n * adornments are all `absolute left-*`, with `absolute start-*` at zero\n * occurrences, so every one of them puts the glyph on the wrong side under\n * RTL and lets the text run over it.\n */\nconst affixVariants = cva(\n [\n \"pointer-events-none absolute inset-y-0 flex items-center\",\n \"text-muted-foreground\",\n // Sized like Button's icon slots, and skipped when the caller sized the\n // glyph themselves. An svg with neither a width attribute nor a resolved\n // class renders at 0x0 and every position assertion still passes.\n \"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-sm)\",\n ],\n {\n variants: {\n side: { start: \"\", end: \"\" },\n size: { sm: \"\", md: \"\", lg: \"\" },\n },\n // The glyph's inset is the field's own inline padding, so it lines up with\n // where the value would have started. That makes it a pair of axes, not\n // one: a small field at the medium inset puts the glyph under the text.\n compoundVariants: [\n { side: \"start\", size: \"sm\", class: \"start-(--density-control-pad-sm)\" },\n { side: \"start\", size: \"md\", class: \"start-(--density-control-pad-md)\" },\n { side: \"start\", size: \"lg\", class: \"start-(--density-control-pad-lg)\" },\n { side: \"end\", size: \"sm\", class: \"end-(--density-control-pad-sm)\" },\n { side: \"end\", size: \"md\", class: \"end-(--density-control-pad-md)\" },\n { side: \"end\", size: \"lg\", class: \"end-(--density-control-pad-lg)\" },\n ],\n defaultVariants: { size: \"md\" },\n },\n);\n\n/**\n * A single-line text field.\n *\n * @example\n * <Input type=\"email\" placeholder=\"you@example.com\" value={v} onChange={e => set(e.target.value)} />\n * <Input aria-label=\"Search\" startIcon={<SearchIcon aria-hidden />} />\n */\nexport interface InputProps extends Omit<AriaInputProps, \"className\" | \"style\" | \"size\"> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n /**\n * Control scale. Height and inline padding come from the same\n * `--density-control-*` tokens as Button, so a field and a button on one\n * rung are the same height.\n *\n * Type does not scale with it: the field stays at 16px everywhere, because\n * iOS Safari zooms the viewport when a focused input's text is smaller.\n *\n * This REPLACES the native `size` attribute, which React Aria inherits from\n * `InputHTMLAttributes` as a character count. No call site in the census\n * used it; set a width with `className` instead.\n *\n * @default \"md\"\n */\n size?: \"sm\" | \"md\" | \"lg\";\n /**\n * Decorative glyph at the leading edge of the field.\n *\n * Mark it `aria-hidden` -- the field's label carries the accessible name,\n * and a second name source only makes it announce twice. It is sized at\n * `--icon-sm` unless it carries a `size-*` class of its own, positioned\n * from `--density-control-pad-md`, and the field's leading padding grows to\n * match so the value cannot run underneath it.\n *\n * The slot is `pointer-events: none`, so a click on the glyph focuses the\n * field. That makes it decorative by construction: an interactive\n * adornment -- a password reveal, a clear button -- is NOT this prop.\n *\n * Two named slots rather than one `icon` plus a position prop, matching\n * Button: a search field can legitimately carry a leading glyph AND a\n * trailing unit, which one slot cannot express.\n */\n startIcon?: ReactNode;\n /** Decorative glyph at the trailing edge. Same rules as {@link InputProps.startIcon}. */\n endIcon?: ReactNode;\n}\n\nexport function Input({ className, size = \"md\", startIcon, endIcon, ...props }: InputProps) {\n const input = (\n <AriaInput\n {...props}\n data-slot=\"input\"\n className={cn(\n inputVariants({\n size,\n hasStartIcon: startIcon !== undefined,\n hasEndIcon: endIcon !== undefined,\n }),\n className,\n )}\n />\n );\n\n // With neither slot used there is no wrapper AT ALL, so the DOM is\n // byte-identical to what shipped before this prop existed. That is what\n // keeps this additive for the 97 call sites that pass no glyph, and\n // NoIconsLeaveDomUnchanged is the assertion holding it true.\n if (startIcon === undefined && endIcon === undefined) return input;\n\n // An overlay, not a flex row. Moving the border onto this wrapper would\n // take the painted surface off [data-slot=\"input\"] -- the selector the\n // escape hatch is built on -- and would force the focus ring onto\n // :focus-within and the invalid border onto :has(), when React Aria\n // already puts data-focus-visible and data-invalid on the input itself.\n return (\n <span data-slot=\"input-wrapper\" className=\"relative block w-full\">\n {input}\n {startIcon === undefined ? null : (\n <span data-slot=\"input-start-icon\" className={affixVariants({ side: \"start\", size })}>\n {startIcon}\n </span>\n )}\n {endIcon === undefined ? null : (\n <span data-slot=\"input-end-icon\" className={affixVariants({ side: \"end\", size })}>\n {endIcon}\n </span>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,gBAAgB,IAC3B;CACE,qBAAqB;CAOrB;CAIA;CACA;AACF,GACA;CACE,UAAU;;;;;;;;;;;;;;EAcR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;EAGA,cAAc,EAAE,MAAM,GAAG;EACzB,YAAY,EAAE,MAAM,GAAG;CACzB;CACA,kBAAkB;EAQhB;GACE,MAAM;GACN,cAAc;GACd,OACE;EACJ;EACA;GACE,MAAM;GACN,cAAc;GACd,OACE;EACJ;EACA;GACE,MAAM;GACN,cAAc;GACd,OACE;EACJ;EACA;GACE,MAAM;GACN,YAAY;GACZ,OACE;EACJ;EACA;GACE,MAAM;GACN,YAAY;GACZ,OACE;EACJ;EACA;GACE,MAAM;GACN,YAAY;GACZ,OACE;EACJ;CACF;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CACF;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAgB,IACpB;CACE;CACA;CAIA;AACF,GACA;CACE,UAAU;EACR,MAAM;GAAE,OAAO;GAAI,KAAK;EAAG;EAC3B,MAAM;GAAE,IAAI;GAAI,IAAI;GAAI,IAAI;EAAG;CACjC;CAIA,kBAAkB;EAChB;GAAE,MAAM;GAAS,MAAM;GAAM,OAAO;EAAmC;EACvE;GAAE,MAAM;GAAS,MAAM;GAAM,OAAO;EAAmC;EACvE;GAAE,MAAM;GAAS,MAAM;GAAM,OAAO;EAAmC;EACvE;GAAE,MAAM;GAAO,MAAM;GAAM,OAAO;EAAiC;EACnE;GAAE,MAAM;GAAO,MAAM;GAAM,OAAO;EAAiC;EACnE;GAAE,MAAM;GAAO,MAAM;GAAM,OAAO;EAAiC;CACrE;CACA,iBAAiB,EAAE,MAAM,KAAK;AAChC,CACF;AAiDA,SAAgBA,QAAM,EAAE,WAAW,OAAO,MAAM,WAAW,SAAS,GAAG,SAAqB;CAC1F,MAAM,QACJ,oBAACC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAW,GACT,cAAc;GACZ;GACA,cAAc,cAAc,KAAA;GAC5B,YAAY,YAAY,KAAA;EAC1B,CAAC,GACD,SACF;CACD,CAAA;CAOH,IAAI,cAAc,KAAA,KAAa,YAAY,KAAA,GAAW,OAAO;CAO7D,OACE,qBAAC,QAAD;EAAM,aAAU;EAAgB,WAAU;EAA1C,UAAA;GACG;GACA,cAAc,KAAA,IAAY,OACzB,oBAAC,QAAD;IAAM,aAAU;IAAmB,WAAW,cAAc;KAAE,MAAM;KAAS;IAAK,CAAC;IAChF,UAAA;GACG,CAAA;GAEP,YAAY,KAAA,IAAY,OACvB,oBAAC,QAAD;IAAM,aAAU;IAAiB,WAAW,cAAc;KAAE,MAAM;KAAO;IAAK,CAAC;IAC5E,UAAA;GACG,CAAA;EAEJ;;AAEV"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LabelProps } from "react-aria-components";
|
|
2
|
+
//#region src/label/label.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Label, ported from the legacy Radix Label onto React Aria's.
|
|
5
|
+
*
|
|
6
|
+
* Census: 11 files, 39 uses. 26 pass `htmlFor`, 19 pass `className`, and
|
|
7
|
+
* nothing else recurs -- so the surface really is "a styled <label>".
|
|
8
|
+
*
|
|
9
|
+
* Two legacy rules are NOT ported, and both for the same reason: they
|
|
10
|
+
* depend on markup this component cannot see.
|
|
11
|
+
*
|
|
12
|
+
* - `peer-disabled:cursor-not-allowed peer-disabled:opacity-50` requires the
|
|
13
|
+
* consumer to have put `peer` on a sibling input. Nothing in this library
|
|
14
|
+
* does, and a rule that silently does nothing unless the caller happens to
|
|
15
|
+
* add a class is worse than no rule.
|
|
16
|
+
* - `group-data-[disabled=true]:*` requires an ancestor marked `group` with
|
|
17
|
+
* `data-disabled="true"`. React Aria fields set `data-disabled` on their
|
|
18
|
+
* own wrapper and supply it through LabelContext, so when TextField lands
|
|
19
|
+
* the disabled treatment comes from the field rather than from a class
|
|
20
|
+
* the caller remembered.
|
|
21
|
+
*
|
|
22
|
+
* Every string in the cva block below is a STATIC literal.
|
|
23
|
+
*/
|
|
24
|
+
export declare const labelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
25
|
+
/**
|
|
26
|
+
* A form label.
|
|
27
|
+
*
|
|
28
|
+
* Inside a React Aria field (`TextField`, `Checkbox`, ...) the association
|
|
29
|
+
* is automatic through context. Standalone, pass `htmlFor`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <Label htmlFor="email">Email</Label>
|
|
33
|
+
*/
|
|
34
|
+
interface LabelProps$1 extends Omit<LabelProps, "className" | "style"> {
|
|
35
|
+
/** Extra classes. Merged last, so they win conflicts with ours. */
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
declare function Label$1({ className, ...props }: LabelProps$1): import("react").JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Label$1 as Label, LabelProps$1 as LabelProps };
|
|
41
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Label } from "react-aria-components";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/label/label.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Label, ported from the legacy Radix Label onto React Aria's.
|
|
9
|
+
*
|
|
10
|
+
* Census: 11 files, 39 uses. 26 pass `htmlFor`, 19 pass `className`, and
|
|
11
|
+
* nothing else recurs -- so the surface really is "a styled <label>".
|
|
12
|
+
*
|
|
13
|
+
* Two legacy rules are NOT ported, and both for the same reason: they
|
|
14
|
+
* depend on markup this component cannot see.
|
|
15
|
+
*
|
|
16
|
+
* - `peer-disabled:cursor-not-allowed peer-disabled:opacity-50` requires the
|
|
17
|
+
* consumer to have put `peer` on a sibling input. Nothing in this library
|
|
18
|
+
* does, and a rule that silently does nothing unless the caller happens to
|
|
19
|
+
* add a class is worse than no rule.
|
|
20
|
+
* - `group-data-[disabled=true]:*` requires an ancestor marked `group` with
|
|
21
|
+
* `data-disabled="true"`. React Aria fields set `data-disabled` on their
|
|
22
|
+
* own wrapper and supply it through LabelContext, so when TextField lands
|
|
23
|
+
* the disabled treatment comes from the field rather than from a class
|
|
24
|
+
* the caller remembered.
|
|
25
|
+
*
|
|
26
|
+
* Every string in the cva block below is a STATIC literal.
|
|
27
|
+
*/
|
|
28
|
+
const labelVariants = cva([
|
|
29
|
+
"inline-flex items-center gap-2",
|
|
30
|
+
"font-sans text-sm leading-(--leading-none) font-medium text-foreground",
|
|
31
|
+
"select-none",
|
|
32
|
+
"box-border"
|
|
33
|
+
]);
|
|
34
|
+
function Label$1({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
36
|
+
...props,
|
|
37
|
+
"data-slot": "label",
|
|
38
|
+
className: cn(labelVariants(), className)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Label$1 as Label, labelVariants };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","names":["Label","AriaLabel"],"sources":["../../src/label/label.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { Label as AriaLabel, type LabelProps as AriaLabelProps } from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Label, ported from the legacy Radix Label onto React Aria's.\n *\n * Census: 11 files, 39 uses. 26 pass `htmlFor`, 19 pass `className`, and\n * nothing else recurs -- so the surface really is \"a styled <label>\".\n *\n * Two legacy rules are NOT ported, and both for the same reason: they\n * depend on markup this component cannot see.\n *\n * - `peer-disabled:cursor-not-allowed peer-disabled:opacity-50` requires the\n * consumer to have put `peer` on a sibling input. Nothing in this library\n * does, and a rule that silently does nothing unless the caller happens to\n * add a class is worse than no rule.\n * - `group-data-[disabled=true]:*` requires an ancestor marked `group` with\n * `data-disabled=\"true\"`. React Aria fields set `data-disabled` on their\n * own wrapper and supply it through LabelContext, so when TextField lands\n * the disabled treatment comes from the field rather than from a class\n * the caller remembered.\n *\n * Every string in the cva block below is a STATIC literal.\n */\nexport const labelVariants = cva([\n \"inline-flex items-center gap-2\",\n // leading-* AFTER text-*: tailwind-merge treats a later text-* as owning\n // line-height and silently strips a leading-* that precedes it.\n \"font-sans text-sm leading-(--leading-none) font-medium text-foreground\",\n \"select-none\",\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may load none.\n // A bare <label> inherits the host page's serif; the Accordion shipped its\n // panel exactly that way.\n \"box-border\",\n]);\n\n/**\n * A form label.\n *\n * Inside a React Aria field (`TextField`, `Checkbox`, ...) the association\n * is automatic through context. Standalone, pass `htmlFor`.\n *\n * @example\n * <Label htmlFor=\"email\">Email</Label>\n */\nexport interface LabelProps extends Omit<AriaLabelProps, \"className\" | \"style\"> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\nexport function Label({ className, ...props }: LabelProps) {\n return <AriaLabel {...props} data-slot=\"label\" className={cn(labelVariants(), className)} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAa,gBAAgB,IAAI;CAC/B;CAGA;CACA;CAIA;AACF,CAAC;AAgBD,SAAgBA,QAAM,EAAE,WAAW,GAAG,SAAqB;CACzD,OAAO,oBAACC,OAAD;EAAW,GAAI;EAAO,aAAU;EAAQ,WAAW,GAAG,cAAc,GAAG,SAAS;CAAI,CAAA;AAC7F"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/lib/field-surface.ts
|
|
3
|
+
/**
|
|
4
|
+
* The shared surface of a text entry control.
|
|
5
|
+
*
|
|
6
|
+
* Extracted at the Rule of Two, and for a reason the legacy demonstrates:
|
|
7
|
+
* its `input.tsx` and `textarea.tsx` styled the same surface twice and had
|
|
8
|
+
* already drifted. The input is `bg-transparent`, the textarea is
|
|
9
|
+
* `bg-background`. The input focuses with `focus-visible:border-ring` plus a
|
|
10
|
+
* 3px ring; the textarea uses a 2px ring with an offset. The input has
|
|
11
|
+
* `aria-invalid` treatment, the textarea has none. None of those differences
|
|
12
|
+
* is a decision anyone made -- they are two files edited at different times.
|
|
13
|
+
*
|
|
14
|
+
* Everything that must look identical between an Input and a Textarea lives
|
|
15
|
+
* here. Only the box geometry differs, and that is the caller's variant.
|
|
16
|
+
*
|
|
17
|
+
* Every string is a STATIC literal. Tailwind scans source text, so a class
|
|
18
|
+
* assembled at runtime is invisible to it and would never be emitted.
|
|
19
|
+
*/
|
|
20
|
+
const fieldSurfaceVariants = cva([
|
|
21
|
+
"w-full min-w-0",
|
|
22
|
+
"box-border font-sans",
|
|
23
|
+
"rounded-md border-(length:--border-width) border-border",
|
|
24
|
+
"bg-background text-foreground",
|
|
25
|
+
"shadow-surface",
|
|
26
|
+
"placeholder:text-muted-foreground",
|
|
27
|
+
"selection:bg-primary selection:text-primary-foreground",
|
|
28
|
+
"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
|
|
29
|
+
"outline-none",
|
|
30
|
+
"data-[focus-visible]:outline-solid",
|
|
31
|
+
"data-[focus-visible]:outline-(length:--focus-ring-width)",
|
|
32
|
+
"data-[focus-visible]:outline-offset-(--focus-ring-offset)",
|
|
33
|
+
"data-[focus-visible]:outline-(--color-ring)",
|
|
34
|
+
"data-[invalid]:border-destructive-strong",
|
|
35
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)"
|
|
36
|
+
]);
|
|
37
|
+
//#endregion
|
|
38
|
+
export { fieldSurfaceVariants };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=field-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-surface.js","names":[],"sources":["../../src/lib/field-surface.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\n/**\n * The shared surface of a text entry control.\n *\n * Extracted at the Rule of Two, and for a reason the legacy demonstrates:\n * its `input.tsx` and `textarea.tsx` styled the same surface twice and had\n * already drifted. The input is `bg-transparent`, the textarea is\n * `bg-background`. The input focuses with `focus-visible:border-ring` plus a\n * 3px ring; the textarea uses a 2px ring with an offset. The input has\n * `aria-invalid` treatment, the textarea has none. None of those differences\n * is a decision anyone made -- they are two files edited at different times.\n *\n * Everything that must look identical between an Input and a Textarea lives\n * here. Only the box geometry differs, and that is the caller's variant.\n *\n * Every string is a STATIC literal. Tailwind scans source text, so a class\n * assembled at runtime is invisible to it and would never be emitted.\n */\nexport const fieldSurfaceVariants = cva([\n \"w-full min-w-0\",\n\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may load none.\n // A bare <input> keeps the user-agent border, background and Arial face,\n // and content-box would add the padding on top of the width.\n \"box-border font-sans\",\n\n \"rounded-md border-(length:--border-width) border-border\",\n \"bg-background text-foreground\",\n \"shadow-surface\",\n\n // --color-muted-foreground is 5.25:1 on the page, so the placeholder is\n // legible rather than the usual near-invisible grey. It is still text and\n // the contrast contract holds it to the 4.5 floor.\n \"placeholder:text-muted-foreground\",\n \"selection:bg-primary selection:text-primary-foreground\",\n\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n\n // outline-solid is load-bearing. `outline-none` sets BOTH\n // outline-style:none and --tw-outline-style:none, and the width utility\n // resolves its style from that same variable -- so a focus rule can apply\n // a width and a colour while faithfully re-applying none, and paint\n // nothing. Button shipped exactly that.\n //\n // An outline, not the legacy `ring-[3px]` box-shadow: box-shadows are\n // discarded under forced-colors, taking the only focus indication with\n // them, and axe has no focus-indicator rule to notice.\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n\n // React Aria sets data-invalid from the native `aria-invalid` attribute,\n // so this costs no API surface and works both bare and inside a\n // TextField. destructive-strong rather than destructive: the fill token\n // is 2.44:1-class and cannot describe a boundary (WCAG 1.4.11).\n //\n // The border CHANGES COLOUR only. Colour alone is not a state cue\n // (WCAG 1.4.1), which is why an invalid field must also carry a message --\n // that is the consumer's job, and the migration table says so.\n \"data-[invalid]:border-destructive-strong\",\n\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAa,uBAAuB,IAAI;CACtC;CAKA;CAEA;CACA;CACA;CAKA;CACA;CAEA;CAWA;CACA;CACA;CACA;CACA;CAUA;CAEA;AACF,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/lib/selection-control.ts
|
|
3
|
+
/**
|
|
4
|
+
* The parts every selection control shares: Checkbox, Radio and Switch.
|
|
5
|
+
*
|
|
6
|
+
* Extracted at the Rule of Three, and for the reason this migration keeps
|
|
7
|
+
* running into -- the legacy shipped `input.tsx` and `textarea.tsx` styling
|
|
8
|
+
* one surface twice, and `dialog.tsx` and `alert-dialog.tsx` doing the same,
|
|
9
|
+
* and both pairs had already drifted in ways nobody decided. Three controls
|
|
10
|
+
* with the same label geometry and the same focus ring is where that starts.
|
|
11
|
+
*
|
|
12
|
+
* React Aria renders all three as a `<label>` wrapping a visually-hidden
|
|
13
|
+
* real input, and puts the state on the LABEL -- so the visible box or track
|
|
14
|
+
* has to reach its own state through `group-*`.
|
|
15
|
+
*
|
|
16
|
+
* Every string is a STATIC literal. Tailwind scans source text, so a class
|
|
17
|
+
* assembled at runtime is invisible to it and would never be emitted.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The label that wraps the control and its text.
|
|
21
|
+
*
|
|
22
|
+
* `group` is load-bearing: React Aria puts `data-selected`,
|
|
23
|
+
* `data-focus-visible` and the rest on this element, and CSS cannot look
|
|
24
|
+
* upward from the box to them.
|
|
25
|
+
*/
|
|
26
|
+
const selectionLabelVariants = cva([
|
|
27
|
+
"group inline-flex items-center gap-2",
|
|
28
|
+
"min-h-6 min-w-6 justify-center",
|
|
29
|
+
"box-border font-sans text-sm leading-(--leading-normal) text-foreground",
|
|
30
|
+
"cursor-pointer select-none",
|
|
31
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)"
|
|
32
|
+
]);
|
|
33
|
+
/**
|
|
34
|
+
* The focus ring, drawn on the VISIBLE control rather than the input.
|
|
35
|
+
*
|
|
36
|
+
* React Aria's input is visually hidden, and an outline on a clipped 1px
|
|
37
|
+
* element is invisible.
|
|
38
|
+
*
|
|
39
|
+
* `outline-solid` is load-bearing, not decoration. `outline-none` sets both
|
|
40
|
+
* `outline-style: none` and `--tw-outline-style: none`, and the width
|
|
41
|
+
* utility resolves its style from that same variable -- so a focus rule can
|
|
42
|
+
* apply a width and a colour while faithfully re-applying none, and paint
|
|
43
|
+
* nothing at all. Button shipped exactly that: keyboard-focusable with no
|
|
44
|
+
* visible ring, and every automated gate stayed green because axe has no
|
|
45
|
+
* focus-indicator rule.
|
|
46
|
+
*/
|
|
47
|
+
const selectionRingVariants = cva([
|
|
48
|
+
"outline-none",
|
|
49
|
+
"group-data-[focus-visible]:outline-solid",
|
|
50
|
+
"group-data-[focus-visible]:outline-(length:--focus-ring-width)",
|
|
51
|
+
"group-data-[focus-visible]:outline-offset-(--focus-ring-offset)",
|
|
52
|
+
"group-data-[focus-visible]:outline-(--color-ring)"
|
|
53
|
+
]);
|
|
54
|
+
//#endregion
|
|
55
|
+
export { selectionLabelVariants, selectionRingVariants };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=selection-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-control.js","names":[],"sources":["../../src/lib/selection-control.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\n\n/**\n * The parts every selection control shares: Checkbox, Radio and Switch.\n *\n * Extracted at the Rule of Three, and for the reason this migration keeps\n * running into -- the legacy shipped `input.tsx` and `textarea.tsx` styling\n * one surface twice, and `dialog.tsx` and `alert-dialog.tsx` doing the same,\n * and both pairs had already drifted in ways nobody decided. Three controls\n * with the same label geometry and the same focus ring is where that starts.\n *\n * React Aria renders all three as a `<label>` wrapping a visually-hidden\n * real input, and puts the state on the LABEL -- so the visible box or track\n * has to reach its own state through `group-*`.\n *\n * Every string is a STATIC literal. Tailwind scans source text, so a class\n * assembled at runtime is invisible to it and would never be emitted.\n */\n\n/**\n * The label that wraps the control and its text.\n *\n * `group` is load-bearing: React Aria puts `data-selected`,\n * `data-focus-visible` and the rest on this element, and CSS cannot look\n * upward from the box to them.\n */\nexport const selectionLabelVariants = cva([\n \"group inline-flex items-center gap-2\",\n\n // WCAG 2.2 target-size (2.5.8) wants 24x24 CSS pixels. The controls are\n // 16-20px, which is conventional, so the LABEL carries the target: with\n // text it is large anyway, and without -- a table row selector -- this\n // minimum is the only thing keeping it hittable.\n //\n // Measured, not assumed: axe's target-size rule did NOT fire on a 16px\n // control during the Checkbox sabotage run. Only the explicit assertion\n // caught it.\n \"min-h-6 min-w-6 justify-center\",\n\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may load none.\n // An unstyled <label> inherits the host page's serif; the Accordion\n // shipped its panel exactly that way.\n \"box-border font-sans text-sm leading-(--leading-normal) text-foreground\",\n\n \"cursor-pointer select-none\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n]);\n\n/**\n * The focus ring, drawn on the VISIBLE control rather than the input.\n *\n * React Aria's input is visually hidden, and an outline on a clipped 1px\n * element is invisible.\n *\n * `outline-solid` is load-bearing, not decoration. `outline-none` sets both\n * `outline-style: none` and `--tw-outline-style: none`, and the width\n * utility resolves its style from that same variable -- so a focus rule can\n * apply a width and a colour while faithfully re-applying none, and paint\n * nothing at all. Button shipped exactly that: keyboard-focusable with no\n * visible ring, and every automated gate stayed green because axe has no\n * focus-indicator rule.\n */\nexport const selectionRingVariants = cva([\n \"outline-none\",\n \"group-data-[focus-visible]:outline-solid\",\n \"group-data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"group-data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"group-data-[focus-visible]:outline-(--color-ring)\",\n]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,yBAAyB,IAAI;CACxC;CAUA;CAKA;CAEA;CACA;AACF,CAAC;;;;;;;;;;;;;;;AAgBD,MAAa,wBAAwB,IAAI;CACvC;CACA;CACA;CACA;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Menu, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants } from "./menu.js";
|
|
2
|
+
export { Menu, MenuItem, type MenuItemProps, type MenuProps, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Menu, MenuItem, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants } from "./menu.js";
|
|
2
|
+
export { Menu, MenuItem, MenuSeparator, MenuTrigger, menuItemVariants, menuPopoverVariants, menuSeparatorVariants, menuVariants };
|