@tea-ui/core 0.1.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.
Files changed (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/dist/card.d.ts +60 -0
  4. package/dist/card.js +116 -0
  5. package/dist/card.js.map +1 -0
  6. package/dist/feedback/alert.d.ts +57 -0
  7. package/dist/feedback/alert.js +104 -0
  8. package/dist/feedback/alert.js.map +1 -0
  9. package/dist/feedback/badge.d.ts +34 -0
  10. package/dist/feedback/badge.js +62 -0
  11. package/dist/feedback/badge.js.map +1 -0
  12. package/dist/feedback/index.d.ts +13 -0
  13. package/dist/feedback/index.js +62 -0
  14. package/dist/feedback/index.js.map +1 -0
  15. package/dist/feedback/progress.d.ts +25 -0
  16. package/dist/feedback/progress.js +49 -0
  17. package/dist/feedback/progress.js.map +1 -0
  18. package/dist/feedback/skeleton.d.ts +38 -0
  19. package/dist/feedback/skeleton.js +49 -0
  20. package/dist/feedback/skeleton.js.map +1 -0
  21. package/dist/feedback/spinner.d.ts +31 -0
  22. package/dist/feedback/spinner.js +55 -0
  23. package/dist/feedback/spinner.js.map +1 -0
  24. package/dist/feedback/status.d.ts +63 -0
  25. package/dist/feedback/status.js +156 -0
  26. package/dist/feedback/status.js.map +1 -0
  27. package/dist/feedback/toast.d.ts +72 -0
  28. package/dist/feedback/toast.js +211 -0
  29. package/dist/feedback/toast.js.map +1 -0
  30. package/dist/format/index.d.ts +63 -0
  31. package/dist/format/index.js +84 -0
  32. package/dist/format/index.js.map +1 -0
  33. package/dist/index.d.ts +43 -0
  34. package/dist/index.js +163 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/inputs/button-group.d.ts +70 -0
  37. package/dist/inputs/button-group.js +59 -0
  38. package/dist/inputs/button-group.js.map +1 -0
  39. package/dist/inputs/button.d.ts +52 -0
  40. package/dist/inputs/button.js +84 -0
  41. package/dist/inputs/button.js.map +1 -0
  42. package/dist/inputs/checkbox.d.ts +48 -0
  43. package/dist/inputs/checkbox.js +74 -0
  44. package/dist/inputs/checkbox.js.map +1 -0
  45. package/dist/inputs/combobox.d.ts +77 -0
  46. package/dist/inputs/combobox.js +273 -0
  47. package/dist/inputs/combobox.js.map +1 -0
  48. package/dist/inputs/field.d.ts +220 -0
  49. package/dist/inputs/field.js +183 -0
  50. package/dist/inputs/field.js.map +1 -0
  51. package/dist/inputs/icon-button.d.ts +44 -0
  52. package/dist/inputs/icon-button.js +30 -0
  53. package/dist/inputs/icon-button.js.map +1 -0
  54. package/dist/inputs/index.d.ts +22 -0
  55. package/dist/inputs/index.js +92 -0
  56. package/dist/inputs/index.js.map +1 -0
  57. package/dist/inputs/input-group.d.ts +77 -0
  58. package/dist/inputs/input-group.js +76 -0
  59. package/dist/inputs/input-group.js.map +1 -0
  60. package/dist/inputs/input.d.ts +58 -0
  61. package/dist/inputs/input.js +68 -0
  62. package/dist/inputs/input.js.map +1 -0
  63. package/dist/inputs/label.d.ts +47 -0
  64. package/dist/inputs/label.js +29 -0
  65. package/dist/inputs/label.js.map +1 -0
  66. package/dist/inputs/number-input.d.ts +62 -0
  67. package/dist/inputs/number-input.js +86 -0
  68. package/dist/inputs/number-input.js.map +1 -0
  69. package/dist/inputs/password-input.d.ts +66 -0
  70. package/dist/inputs/password-input.js +73 -0
  71. package/dist/inputs/password-input.js.map +1 -0
  72. package/dist/inputs/radio.d.ts +66 -0
  73. package/dist/inputs/radio.js +96 -0
  74. package/dist/inputs/radio.js.map +1 -0
  75. package/dist/inputs/search-input.d.ts +66 -0
  76. package/dist/inputs/search-input.js +76 -0
  77. package/dist/inputs/search-input.js.map +1 -0
  78. package/dist/inputs/select.d.ts +65 -0
  79. package/dist/inputs/select.js +139 -0
  80. package/dist/inputs/select.js.map +1 -0
  81. package/dist/inputs/slider.d.ts +67 -0
  82. package/dist/inputs/slider.js +107 -0
  83. package/dist/inputs/slider.js.map +1 -0
  84. package/dist/inputs/switch.d.ts +42 -0
  85. package/dist/inputs/switch.js +69 -0
  86. package/dist/inputs/switch.js.map +1 -0
  87. package/dist/inputs/textarea.d.ts +51 -0
  88. package/dist/inputs/textarea.js +82 -0
  89. package/dist/inputs/textarea.js.map +1 -0
  90. package/dist/inputs/toggle.d.ts +57 -0
  91. package/dist/inputs/toggle.js +91 -0
  92. package/dist/inputs/toggle.js.map +1 -0
  93. package/dist/internal/index.d.ts +5 -0
  94. package/dist/internal/index.js +19 -0
  95. package/dist/internal/index.js.map +1 -0
  96. package/dist/internal/refs.d.ts +31 -0
  97. package/dist/internal/refs.js +34 -0
  98. package/dist/internal/refs.js.map +1 -0
  99. package/dist/internal/slot.d.ts +76 -0
  100. package/dist/internal/slot.js +40 -0
  101. package/dist/internal/slot.js.map +1 -0
  102. package/dist/internal/use-controllable-state.d.ts +25 -0
  103. package/dist/internal/use-controllable-state.js +38 -0
  104. package/dist/internal/use-controllable-state.js.map +1 -0
  105. package/dist/layout/index.d.ts +131 -0
  106. package/dist/layout/index.js +212 -0
  107. package/dist/layout/index.js.map +1 -0
  108. package/dist/navigation/index.d.ts +114 -0
  109. package/dist/navigation/index.js +523 -0
  110. package/dist/navigation/index.js.map +1 -0
  111. package/dist/overlays/alert-dialog.d.ts +75 -0
  112. package/dist/overlays/alert-dialog.js +163 -0
  113. package/dist/overlays/alert-dialog.js.map +1 -0
  114. package/dist/overlays/dialog.d.ts +44 -0
  115. package/dist/overlays/dialog.js +121 -0
  116. package/dist/overlays/dialog.js.map +1 -0
  117. package/dist/overlays/drawer.d.ts +49 -0
  118. package/dist/overlays/drawer.js +125 -0
  119. package/dist/overlays/drawer.js.map +1 -0
  120. package/dist/overlays/dropdown-menu.d.ts +53 -0
  121. package/dist/overlays/dropdown-menu.js +192 -0
  122. package/dist/overlays/dropdown-menu.js.map +1 -0
  123. package/dist/overlays/index.d.ts +10 -0
  124. package/dist/overlays/index.js +169 -0
  125. package/dist/overlays/index.js.map +1 -0
  126. package/dist/overlays/popover.d.ts +58 -0
  127. package/dist/overlays/popover.js +105 -0
  128. package/dist/overlays/popover.js.map +1 -0
  129. package/dist/styles.css +2 -0
  130. package/dist/typography/index.d.ts +79 -0
  131. package/dist/typography/index.js +280 -0
  132. package/dist/typography/index.js.map +1 -0
  133. package/package.json +60 -0
@@ -0,0 +1,114 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { Accordion as Accordion$1, Collapsible as Collapsible$1, NavigationMenu as NavigationMenu$1, Tabs as Tabs$1, Toolbar as Toolbar$1 } from 'radix-ui';
4
+ export { useControllableState } from '../internal/use-controllable-state.js';
5
+
6
+ /**
7
+ * Tabs are for **peer views of the same subject**. If the things being switched
8
+ * between are not peers, they are navigation, and they belong in a sidebar —
9
+ * promoting peers into the top level is how information architecture collapses.
10
+ *
11
+ * The active indicator is a weight change as well as a colour change. A tab
12
+ * that is only distinguished by hue is unreadable to a user with a colour
13
+ * vision deficiency and invisible in a screenshot printed in greyscale.
14
+ */
15
+ interface TabsProps extends Omit<React.ComponentPropsWithoutRef<typeof Tabs$1.Root>, "children"> {
16
+ children: React.ReactNode;
17
+ }
18
+ declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
19
+ declare const TabsList: React.ForwardRefExoticComponent<Omit<Tabs$1.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
+ declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<Tabs$1.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
21
+ declare const TabsContent: React.ForwardRefExoticComponent<Omit<Tabs$1.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
+ interface CollapsibleProps extends Omit<React.ComponentPropsWithoutRef<typeof Collapsible$1.Root>, "defaultValue"> {
23
+ defaultOpen?: boolean | undefined;
24
+ }
25
+ /** Progressive disclosure. The trigger owns `aria-expanded` and `aria-controls`. */
26
+ declare const Collapsible: React.ForwardRefExoticComponent<CollapsibleProps & React.RefAttributes<HTMLDivElement>>;
27
+ declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<Collapsible$1.CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
28
+ declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<Collapsible$1.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
29
+ interface AccordionProps extends Omit<React.ComponentProps<"div">, "children" | "color" | "dir"> {
30
+ type?: "single" | "multiple" | undefined;
31
+ /** Single type only: allow closing the open item. */
32
+ collapsible?: boolean | undefined;
33
+ defaultValue?: string | string[] | undefined;
34
+ value?: string | string[] | undefined;
35
+ onValueChange?: ((value: never) => void) | undefined;
36
+ children: React.ReactNode;
37
+ }
38
+ /**
39
+ * An accordion is a list of questions with answers that belong together. If the
40
+ * sections are unrelated, they are `<Collapsible>`s, not one accordion — a
41
+ * single-value accordion forces the user to close one answer to read the next,
42
+ * which only makes sense when the answers are alternatives.
43
+ */
44
+ declare const Accordion: React.ForwardRefExoticComponent<Omit<AccordionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
+ declare const AccordionItem: React.ForwardRefExoticComponent<Omit<Accordion$1.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
46
+ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<Accordion$1.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
47
+ declare const AccordionContent: React.ForwardRefExoticComponent<Omit<Accordion$1.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
48
+ /**
49
+ * A breadcrumb shows *where you are*; a back button shows *where you were*.
50
+ * Below three levels of hierarchy you need both, and neither alone.
51
+ */
52
+ declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
53
+ declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
54
+ interface BreadcrumbLinkProps extends React.ComponentProps<"a"> {
55
+ asChild?: boolean | undefined;
56
+ }
57
+ declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<BreadcrumbLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
58
+ /** The current page. `aria-current` is what makes it announceable, not the style. */
59
+ declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
60
+ /** Decorative by definition — the `<ol>` already conveys the hierarchy. */
61
+ declare const BreadcrumbSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
62
+ declare const paginationLinkVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
63
+ interface PaginationProps extends Omit<React.ComponentProps<"nav">, "onChange"> {
64
+ /** Current page, 1-based. */
65
+ page: number;
66
+ /** How many pages exist in total. */
67
+ pageCount: number;
68
+ onPageChange: (page: number) => void;
69
+ /** Optional element describing what is being paginated. */
70
+ itemLabel?: string | undefined;
71
+ className?: string | undefined;
72
+ }
73
+ declare function Pagination({ page, pageCount, onPageChange, itemLabel, className, ...props }: PaginationProps): React.ReactElement;
74
+ /**
75
+ * The first focusable element on every page. Neither source product had one.
76
+ *
77
+ * It is visually hidden until focused, and it is genuinely useful rather than
78
+ * ceremonial: a keyboard user arriving on a page with a 20-item sidebar would
79
+ * otherwise have to tab through all of it on every single page.
80
+ */
81
+ interface SkipLinkProps extends React.ComponentProps<"a"> {
82
+ /** The id of the main region to jump to. */
83
+ targetId: string;
84
+ }
85
+ declare function SkipLink({ targetId, className, children, ...props }: SkipLinkProps): React.ReactElement;
86
+ interface StepperProps extends Omit<React.ComponentProps<"ol">, "children"> {
87
+ /** Zero-based index of the current step. */
88
+ current: number;
89
+ children: React.ReactNode;
90
+ }
91
+ declare const Stepper: React.ForwardRefExoticComponent<Omit<StepperProps, "ref"> & React.RefAttributes<HTMLOListElement>>;
92
+ interface StepProps extends React.ComponentProps<"li"> {
93
+ /** Index of this step. */
94
+ index: number;
95
+ /** Index of the current step. */
96
+ current: number;
97
+ /** Show a state label such as "Abgeschlossen". */
98
+ stateLabel?: string | undefined;
99
+ }
100
+ declare function Step({ index, current, stateLabel, className, children, ...props }: StepProps): React.ReactElement;
101
+ declare function StepIndicator({ className, ...props }: React.ComponentProps<"span">): React.ReactElement;
102
+ declare function StepSeparator({ className, ...props }: React.ComponentProps<"span">): React.ReactElement;
103
+ declare const Toolbar: React.ForwardRefExoticComponent<Omit<Toolbar$1.ToolbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
104
+ declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
105
+ declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenu$1.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
106
+ declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenu$1.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
107
+ declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenu$1.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
108
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenu$1.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
109
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenu$1.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
110
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenu$1.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & {
111
+ asChild?: boolean | undefined;
112
+ } & React.RefAttributes<HTMLAnchorElement>>;
113
+
114
+ export { Accordion, AccordionContent, AccordionItem, type AccordionProps, AccordionTrigger, Breadcrumb, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbPage, BreadcrumbSeparator, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, Pagination, type PaginationProps, SkipLink, type SkipLinkProps, Step, StepIndicator, type StepProps, StepSeparator, Stepper, type StepperProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Toolbar, ToolbarButton, paginationLinkVariants };
@@ -0,0 +1,523 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Slot } from "radix-ui";
4
+ import {
5
+ Accordion as AccordionPrimitive,
6
+ Collapsible as CollapsiblePrimitive,
7
+ NavigationMenu as NavigationMenuPrimitive,
8
+ Tabs as TabsPrimitive,
9
+ Toolbar as ToolbarPrimitive
10
+ } from "radix-ui";
11
+ import { ChevronDown, ChevronsLeft, ChevronsRight } from "@tea-ui/icons";
12
+ import { cn, cva } from "@tea-ui/utils";
13
+ import { COPY } from "@tea-ui/ux-standards";
14
+ import { dataSlot, useControllableState } from "../internal/index.js";
15
+ import { Button } from "../inputs/button.js";
16
+ const Tabs = React.forwardRef(function Tabs2({ children, ...props }, ref) {
17
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props, ...dataSlot("tabs"), children });
18
+ });
19
+ const TabsList = React.forwardRef(function TabsList2({ className, ...props }, ref) {
20
+ return /* @__PURE__ */ jsx(
21
+ TabsPrimitive.List,
22
+ {
23
+ ref,
24
+ className: cn(
25
+ "inline-flex items-center gap-0 border-b border-line",
26
+ "data-[orientation=vertical]:flex-col data-[orientation=vertical]:border-b-0 data-[orientation=vertical]:border-e",
27
+ className
28
+ ),
29
+ ...dataSlot("tabs", "list"),
30
+ ...props
31
+ }
32
+ );
33
+ });
34
+ const TabsTrigger = React.forwardRef(function TabsTrigger2({ className, ...props }, ref) {
35
+ return /* @__PURE__ */ jsx(
36
+ TabsPrimitive.Trigger,
37
+ {
38
+ ref,
39
+ className: cn(
40
+ "relative control-h border-0 bg-transparent px-3 text-ui text-fg-muted",
41
+ "border-b-2 border-transparent transition-colors duration-fast ease-standard",
42
+ "hover:text-fg",
43
+ "data-[state=active]:border-primary data-[state=active]:text-primary data-[state=active]:font-medium",
44
+ "data-[orientation=vertical]:w-full data-[orientation=vertical]:border-e-0 data-[orientation=vertical]:border-s-2 data-[orientation=vertical]:text-start",
45
+ className
46
+ ),
47
+ "data-tea-touch": true,
48
+ ...dataSlot("tabs", "trigger"),
49
+ ...props
50
+ }
51
+ );
52
+ });
53
+ const TabsContent = React.forwardRef(function TabsContent2({ className, ...props }, ref) {
54
+ return /* @__PURE__ */ jsx(
55
+ TabsPrimitive.Content,
56
+ {
57
+ ref,
58
+ className: cn("focus-visible:outline-none", className),
59
+ tabIndex: 0,
60
+ ...dataSlot("tabs", "content"),
61
+ ...props
62
+ }
63
+ );
64
+ });
65
+ const Collapsible = React.forwardRef(function Collapsible2({ defaultOpen = false, ...props }, ref) {
66
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { ref, defaultOpen, ...dataSlot("collapsible"), ...props });
67
+ });
68
+ const CollapsibleTrigger = React.forwardRef(function CollapsibleTrigger2({ className, children, ...props }, ref) {
69
+ return /* @__PURE__ */ jsxs(
70
+ CollapsiblePrimitive.CollapsibleTrigger,
71
+ {
72
+ ref,
73
+ className: cn(
74
+ "group flex w-full items-center justify-between gap-2 text-start text-ui font-medium text-fg",
75
+ className
76
+ ),
77
+ "data-tea-touch": true,
78
+ ...dataSlot("collapsible", "trigger"),
79
+ ...props,
80
+ children: [
81
+ children,
82
+ /* @__PURE__ */ jsx(
83
+ ChevronDown,
84
+ {
85
+ size: 16,
86
+ "aria-hidden": "true",
87
+ className: "shrink-0 text-fg-muted transition-transform duration-fast group-data-[state=open]:rotate-180"
88
+ }
89
+ )
90
+ ]
91
+ }
92
+ );
93
+ });
94
+ const CollapsibleContent = React.forwardRef(function CollapsibleContent2({ className, ...props }, ref) {
95
+ return /* @__PURE__ */ jsx(
96
+ CollapsiblePrimitive.CollapsibleContent,
97
+ {
98
+ ref,
99
+ className: cn(
100
+ "overflow-hidden",
101
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top",
102
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top",
103
+ className
104
+ ),
105
+ ...dataSlot("collapsible", "content"),
106
+ ...props
107
+ }
108
+ );
109
+ });
110
+ const AccordionRootPrimitive = AccordionPrimitive.Root;
111
+ const Accordion = React.forwardRef(function Accordion2({ type = "single", collapsible = true, defaultValue, value, onValueChange, className, children, ...props }, ref) {
112
+ return /* @__PURE__ */ jsx(
113
+ AccordionRootPrimitive,
114
+ {
115
+ ref,
116
+ type,
117
+ collapsible: type === "single" ? collapsible : void 0,
118
+ defaultValue,
119
+ value,
120
+ onValueChange,
121
+ className: cn("border-t border-line", className),
122
+ ...dataSlot("accordion"),
123
+ ...props,
124
+ children
125
+ }
126
+ );
127
+ });
128
+ const AccordionItem = React.forwardRef(function AccordionItem2({ className, ...props }, ref) {
129
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ref, className: cn("border-b border-line", className), ...dataSlot("accordion", "item"), ...props });
130
+ });
131
+ const AccordionTrigger = React.forwardRef(function AccordionTrigger2({ className, children, ...props }, ref) {
132
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
133
+ AccordionPrimitive.Trigger,
134
+ {
135
+ ref,
136
+ className: cn(
137
+ "group flex flex-1 items-center justify-between gap-3 py-3 text-start text-ui font-medium text-fg",
138
+ className
139
+ ),
140
+ "data-tea-touch": true,
141
+ ...dataSlot("accordion", "trigger"),
142
+ ...props,
143
+ children: [
144
+ children,
145
+ /* @__PURE__ */ jsx(
146
+ ChevronDown,
147
+ {
148
+ size: 16,
149
+ "aria-hidden": "true",
150
+ className: "shrink-0 text-fg-muted transition-transform duration-fast group-data-[state=open]:rotate-180"
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ ) });
156
+ });
157
+ const AccordionContent = React.forwardRef(function AccordionContent2({ className, children, ...props }, ref) {
158
+ return /* @__PURE__ */ jsx(
159
+ AccordionPrimitive.Content,
160
+ {
161
+ ref,
162
+ className: cn(
163
+ "overflow-hidden text-ui text-fg-muted",
164
+ "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top",
165
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top",
166
+ className
167
+ ),
168
+ ...dataSlot("accordion", "content"),
169
+ ...props,
170
+ children: /* @__PURE__ */ jsx("div", { className: "pb-3 pe-8", children })
171
+ }
172
+ );
173
+ });
174
+ const Breadcrumb = React.forwardRef(function Breadcrumb2({ className, children, ...props }, ref) {
175
+ return /* @__PURE__ */ jsx("nav", { ref, "aria-label": COPY.navigation.breadcrumb, className: cn(className), ...dataSlot("breadcrumb"), ...props, children: /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap items-center gap-1 text-micro text-fg-muted", children }) });
176
+ });
177
+ const BreadcrumbItem = React.forwardRef(
178
+ function BreadcrumbItem2({ className, ...props }, ref) {
179
+ return /* @__PURE__ */ jsx("li", { ref, className: cn("flex items-center gap-1", className), ...dataSlot("breadcrumb", "item"), ...props });
180
+ }
181
+ );
182
+ const BreadcrumbLink = React.forwardRef(
183
+ function BreadcrumbLink2({ className, asChild = false, children, ...props }, ref) {
184
+ const Component = asChild ? Slot.Root : "a";
185
+ return /* @__PURE__ */ jsx(
186
+ Component,
187
+ {
188
+ ref,
189
+ className: cn("transition-colors hover:text-fg", className),
190
+ ...dataSlot("breadcrumb", "link"),
191
+ ...props,
192
+ children
193
+ }
194
+ );
195
+ }
196
+ );
197
+ const BreadcrumbPage = React.forwardRef(
198
+ function BreadcrumbPage2({ className, ...props }, ref) {
199
+ return /* @__PURE__ */ jsx(
200
+ "span",
201
+ {
202
+ ref,
203
+ "aria-current": "page",
204
+ className: cn("font-medium text-fg", className),
205
+ ...dataSlot("breadcrumb", "page"),
206
+ ...props
207
+ }
208
+ );
209
+ }
210
+ );
211
+ const BreadcrumbSeparator = React.forwardRef(
212
+ function BreadcrumbSeparator2({ className, children, ...props }, ref) {
213
+ return /* @__PURE__ */ jsx("li", { ref, "aria-hidden": "true", className: cn("text-fg-subtle", className), ...dataSlot("breadcrumb", "separator"), ...props, children: children ?? "/" });
214
+ }
215
+ );
216
+ const paginationLinkVariants = cva(
217
+ "inline-flex min-w-8 items-center justify-center gap-1 border border-line px-2 text-ui text-fg-muted transition-colors hover:border-line-strong hover:text-fg aria-[current=page]:border-primary aria-[current=page]:text-primary"
218
+ );
219
+ function Pagination({
220
+ page,
221
+ pageCount,
222
+ onPageChange,
223
+ itemLabel,
224
+ className,
225
+ ...props
226
+ }) {
227
+ const go = (next) => onPageChange(Math.min(pageCount, Math.max(1, next)));
228
+ return /* @__PURE__ */ jsxs(
229
+ "nav",
230
+ {
231
+ "aria-label": COPY.a11y.page,
232
+ className: cn("flex flex-wrap items-center justify-between gap-3", className),
233
+ ...dataSlot("pagination"),
234
+ ...props,
235
+ children: [
236
+ /* @__PURE__ */ jsx(PaginationSummary, { page, pageCount, itemLabel }),
237
+ /* @__PURE__ */ jsxs("ul", { className: "flex items-center gap-1", children: [
238
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(PaginationPrevious, { page, onPageChange: go }) }),
239
+ pageWindow(page, pageCount).map(
240
+ (entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx("li", { "aria-hidden": "true", className: "px-1 text-fg-subtle", children: "\u2026" }, `gap-${index}`) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(PaginationLink, { page: entry, onPageChange: go }) }, entry)
241
+ ),
242
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(PaginationNext, { page, pageCount, onPageChange: go }) })
243
+ ] })
244
+ ]
245
+ }
246
+ );
247
+ }
248
+ function PaginationSummary({
249
+ page,
250
+ pageCount,
251
+ itemLabel
252
+ }) {
253
+ return /* @__PURE__ */ jsxs("p", { className: "text-micro text-fg-muted", children: [
254
+ COPY.a11y.page,
255
+ " ",
256
+ page,
257
+ " ",
258
+ COPY.a11y.of,
259
+ " ",
260
+ pageCount,
261
+ itemLabel ? ` \xB7 ${itemLabel}` : null
262
+ ] });
263
+ }
264
+ function PaginationLink({ page, onPageChange }) {
265
+ return /* @__PURE__ */ jsx(
266
+ "button",
267
+ {
268
+ type: "button",
269
+ onClick: () => onPageChange(page),
270
+ "aria-current": "page",
271
+ "aria-label": `${COPY.a11y.page} ${page}`,
272
+ className: paginationLinkVariants(),
273
+ "data-tea-touch": true,
274
+ children: page
275
+ }
276
+ );
277
+ }
278
+ function PaginationPrevious({
279
+ page,
280
+ onPageChange
281
+ }) {
282
+ return /* @__PURE__ */ jsx(
283
+ "button",
284
+ {
285
+ type: "button",
286
+ onClick: () => onPageChange(page - 1),
287
+ disabled: page <= 1,
288
+ "aria-label": COPY.actions.back,
289
+ className: cn(paginationLinkVariants(), "disabled:pointer-events-none disabled:opacity-50"),
290
+ "data-tea-touch": true,
291
+ children: /* @__PURE__ */ jsx(ChevronsLeft, { size: 14, "aria-hidden": "true" })
292
+ }
293
+ );
294
+ }
295
+ function PaginationNext({
296
+ page,
297
+ pageCount,
298
+ onPageChange
299
+ }) {
300
+ return /* @__PURE__ */ jsx(
301
+ "button",
302
+ {
303
+ type: "button",
304
+ onClick: () => onPageChange(page + 1),
305
+ disabled: page >= pageCount,
306
+ "aria-label": COPY.actions.next,
307
+ className: cn(paginationLinkVariants(), "disabled:pointer-events-none disabled:opacity-50"),
308
+ "data-tea-touch": true,
309
+ children: /* @__PURE__ */ jsx(ChevronsRight, { size: 14, "aria-hidden": "true" })
310
+ }
311
+ );
312
+ }
313
+ function pageWindow(page, pageCount) {
314
+ if (pageCount <= 7) return Array.from({ length: pageCount }, (_, index) => index + 1);
315
+ const entries = [1];
316
+ const start = Math.max(2, page - 1);
317
+ const end = Math.min(pageCount - 1, page + 1);
318
+ if (start > 2) entries.push("ellipsis");
319
+ for (let index = start; index <= end; index += 1) entries.push(index);
320
+ if (end < pageCount - 1) entries.push("ellipsis");
321
+ entries.push(pageCount);
322
+ return entries;
323
+ }
324
+ function SkipLink({ targetId, className, children, ...props }) {
325
+ return /* @__PURE__ */ jsx(
326
+ "a",
327
+ {
328
+ href: `#${targetId}`,
329
+ className: cn(
330
+ "sr-only z-max focus:not-sr-only",
331
+ "focus:fixed focus:start-3 focus:top-3 focus:border focus:border-primary focus:bg-primary focus:px-3 focus:py-2 focus:text-ui focus:font-medium focus:text-primary-fg",
332
+ className
333
+ ),
334
+ ...dataSlot("skip-link"),
335
+ ...props,
336
+ children: children ?? COPY.navigation.skipToContent
337
+ }
338
+ );
339
+ }
340
+ const Stepper = React.forwardRef(function Stepper2({ current, children, className, ...props }, ref) {
341
+ return /* @__PURE__ */ jsx(
342
+ "ol",
343
+ {
344
+ ref,
345
+ className: cn("flex w-full items-center gap-2", className),
346
+ "data-current-step": current,
347
+ ...dataSlot("stepper"),
348
+ ...props,
349
+ children
350
+ }
351
+ );
352
+ });
353
+ function Step({ index, current, stateLabel, className, children, ...props }) {
354
+ const state = index < current ? "complete" : index === current ? "current" : "upcoming";
355
+ return /* @__PURE__ */ jsxs(
356
+ "li",
357
+ {
358
+ "aria-current": state === "current" ? "step" : void 0,
359
+ "data-state": state,
360
+ className: cn("flex min-w-0 flex-1 items-center gap-2", className),
361
+ ...dataSlot("stepper", "step"),
362
+ ...props,
363
+ children: [
364
+ children,
365
+ stateLabel ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: stateLabel }) : null
366
+ ]
367
+ }
368
+ );
369
+ }
370
+ function StepIndicator({ className, ...props }) {
371
+ return /* @__PURE__ */ jsx(
372
+ "span",
373
+ {
374
+ "aria-hidden": "true",
375
+ className: cn(
376
+ "flex size-6 shrink-0 items-center justify-center border border-line text-micro font-semibold text-fg-muted",
377
+ "group-data-[state=complete]:border-positive group-data-[state=complete]:bg-positive-subtle group-data-[state=complete]:text-positive",
378
+ "group-data-[state=current]:border-primary group-data-[state=current]:text-primary",
379
+ className
380
+ ),
381
+ ...dataSlot("stepper", "indicator"),
382
+ ...props
383
+ }
384
+ );
385
+ }
386
+ function StepSeparator({ className, ...props }) {
387
+ return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("h-px flex-1 bg-line", className), ...dataSlot("stepper", "separator"), ...props });
388
+ }
389
+ const Toolbar = React.forwardRef(function Toolbar2({ className, ...props }, ref) {
390
+ return /* @__PURE__ */ jsx(
391
+ ToolbarPrimitive.Root,
392
+ {
393
+ ref,
394
+ className: cn("flex items-center gap-2 border-b border-line px-3 py-2", className),
395
+ "data-tea-touch": true,
396
+ ...dataSlot("toolbar"),
397
+ ...props
398
+ }
399
+ );
400
+ });
401
+ const ToolbarButton = React.forwardRef(
402
+ function ToolbarButton2({ className, type = "button", ...props }, ref) {
403
+ return /* @__PURE__ */ jsx(Button, { ref, type, variant: "ghost", size: "sm", className, ...props });
404
+ }
405
+ );
406
+ const NavigationMenu = React.forwardRef(function NavigationMenu2({ className, children, ...props }, ref) {
407
+ return /* @__PURE__ */ jsxs(
408
+ NavigationMenuPrimitive.Root,
409
+ {
410
+ ref,
411
+ className: cn("relative flex items-center", className),
412
+ ...dataSlot("navigation-menu"),
413
+ ...props,
414
+ children: [
415
+ children,
416
+ /* @__PURE__ */ jsx(NavigationMenuViewport, {})
417
+ ]
418
+ }
419
+ );
420
+ });
421
+ const NavigationMenuList = React.forwardRef(function NavigationMenuList2({ className, ...props }, ref) {
422
+ return /* @__PURE__ */ jsx(
423
+ NavigationMenuPrimitive.List,
424
+ {
425
+ ref,
426
+ className: cn("flex items-center gap-1", className),
427
+ ...dataSlot("navigation-menu", "list"),
428
+ ...props
429
+ }
430
+ );
431
+ });
432
+ const NavigationMenuItem = NavigationMenuPrimitive.Item;
433
+ const NavigationMenuTrigger = React.forwardRef(function NavigationMenuTrigger2({ className, children, ...props }, ref) {
434
+ return /* @__PURE__ */ jsxs(
435
+ NavigationMenuPrimitive.Trigger,
436
+ {
437
+ ref,
438
+ className: cn("group control-h px-3 text-ui text-fg-muted hover:text-fg", className),
439
+ "data-tea-touch": true,
440
+ ...dataSlot("navigation-menu", "trigger"),
441
+ ...props,
442
+ children: [
443
+ children,
444
+ /* @__PURE__ */ jsx(ChevronDown, { size: 14, "aria-hidden": "true", className: "ms-1 transition-transform group-data-[state=open]:rotate-180" })
445
+ ]
446
+ }
447
+ );
448
+ });
449
+ const NavigationMenuContent = React.forwardRef(function NavigationMenuContent2({ className, ...props }, ref) {
450
+ return /* @__PURE__ */ jsx(
451
+ NavigationMenuPrimitive.Content,
452
+ {
453
+ ref,
454
+ className: cn("p-2", className),
455
+ ...dataSlot("navigation-menu", "content"),
456
+ ...props
457
+ }
458
+ );
459
+ });
460
+ const NavigationMenuLink = React.forwardRef(function NavigationMenuLink2({ className, asChild = false, ...props }, ref) {
461
+ return /* @__PURE__ */ jsx(
462
+ NavigationMenuPrimitive.Link,
463
+ {
464
+ ref,
465
+ asChild,
466
+ className: cn(
467
+ "block select-none rounded-none p-2 text-ui text-fg no-underline outline-none transition-colors",
468
+ "data-[active]:bg-accent-subtle data-[active]:text-fg",
469
+ "focus-visible:bg-accent-subtle",
470
+ className
471
+ ),
472
+ ...dataSlot("navigation-menu", "link"),
473
+ ...props
474
+ }
475
+ );
476
+ });
477
+ function NavigationMenuViewport() {
478
+ return /* @__PURE__ */ jsx(
479
+ NavigationMenuPrimitive.Viewport,
480
+ {
481
+ className: cn(
482
+ "absolute start-0 top-full z-dropdown mt-1 w-[min(40rem,90vw)] origin-top border border-line bg-surface-2 p-2 shadow-overlay",
483
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
484
+ ),
485
+ ...dataSlot("navigation-menu", "viewport")
486
+ }
487
+ );
488
+ }
489
+ export {
490
+ Accordion,
491
+ AccordionContent,
492
+ AccordionItem,
493
+ AccordionTrigger,
494
+ Breadcrumb,
495
+ BreadcrumbItem,
496
+ BreadcrumbLink,
497
+ BreadcrumbPage,
498
+ BreadcrumbSeparator,
499
+ Collapsible,
500
+ CollapsibleContent,
501
+ CollapsibleTrigger,
502
+ NavigationMenu,
503
+ NavigationMenuContent,
504
+ NavigationMenuItem,
505
+ NavigationMenuLink,
506
+ NavigationMenuList,
507
+ NavigationMenuTrigger,
508
+ Pagination,
509
+ SkipLink,
510
+ Step,
511
+ StepIndicator,
512
+ StepSeparator,
513
+ Stepper,
514
+ Tabs,
515
+ TabsContent,
516
+ TabsList,
517
+ TabsTrigger,
518
+ Toolbar,
519
+ ToolbarButton,
520
+ paginationLinkVariants,
521
+ useControllableState
522
+ };
523
+ //# sourceMappingURL=index.js.map