@tribepad/themis 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/elements/Accordion/index.js +1 -335
- package/dist/elements/Accordion/index.js.map +1 -1
- package/dist/elements/Accordion/index.mjs +1 -317
- package/dist/elements/Accordion/index.mjs.map +1 -1
- package/dist/elements/AlertDialog/AlertDialog.d.ts +43 -0
- package/dist/elements/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/dist/elements/AlertDialog/AlertDialog.styles.d.ts +15 -0
- package/dist/elements/AlertDialog/AlertDialog.styles.d.ts.map +1 -0
- package/dist/elements/AlertDialog/AlertDialog.types.d.ts +72 -0
- package/dist/elements/AlertDialog/AlertDialog.types.d.ts.map +1 -0
- package/dist/elements/AlertDialog/index.d.ts +25 -0
- package/dist/elements/AlertDialog/index.d.ts.map +1 -0
- package/dist/elements/AlertDialog/index.js +3 -0
- package/dist/elements/AlertDialog/index.js.map +1 -0
- package/dist/elements/AlertDialog/index.mjs +3 -0
- package/dist/elements/AlertDialog/index.mjs.map +1 -0
- package/dist/elements/Avatar/index.js +1 -468
- package/dist/elements/Avatar/index.js.map +1 -1
- package/dist/elements/Avatar/index.mjs +1 -456
- package/dist/elements/Avatar/index.mjs.map +1 -1
- package/dist/elements/Badge/index.js +1 -243
- package/dist/elements/Badge/index.js.map +1 -1
- package/dist/elements/Badge/index.mjs +1 -234
- package/dist/elements/Badge/index.mjs.map +1 -1
- package/dist/elements/Breadcrumbs/index.js +1 -821
- package/dist/elements/Breadcrumbs/index.js.map +1 -1
- package/dist/elements/Breadcrumbs/index.mjs +1 -810
- package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
- package/dist/elements/Button/Button.d.ts +26 -81
- package/dist/elements/Button/Button.d.ts.map +1 -1
- package/dist/elements/Button/Button.styles.d.ts +35 -0
- package/dist/elements/Button/Button.styles.d.ts.map +1 -0
- package/dist/elements/Button/Button.types.d.ts +20 -8
- package/dist/elements/Button/Button.types.d.ts.map +1 -1
- package/dist/elements/Button/index.js +1 -288
- package/dist/elements/Button/index.js.map +1 -1
- package/dist/elements/Button/index.mjs +1 -283
- package/dist/elements/Button/index.mjs.map +1 -1
- package/dist/elements/ButtonGroup/index.js +1 -237
- package/dist/elements/ButtonGroup/index.js.map +1 -1
- package/dist/elements/ButtonGroup/index.mjs +1 -222
- package/dist/elements/ButtonGroup/index.mjs.map +1 -1
- package/dist/elements/Card/index.js +1 -579
- package/dist/elements/Card/index.js.map +1 -1
- package/dist/elements/Card/index.mjs +1 -560
- package/dist/elements/Card/index.mjs.map +1 -1
- package/dist/elements/Carousel/Carousel.d.ts +1 -11
- package/dist/elements/Carousel/Carousel.d.ts.map +1 -1
- package/dist/elements/Carousel/LazyCarousel.d.ts +1 -1
- package/dist/elements/Carousel/LazyCarousel.d.ts.map +1 -1
- package/dist/elements/Carousel/index.js +1 -789
- package/dist/elements/Carousel/index.js.map +1 -1
- package/dist/elements/Carousel/index.mjs +1 -786
- package/dist/elements/Carousel/index.mjs.map +1 -1
- package/dist/elements/Chart/ChartContext.d.ts.map +1 -1
- package/dist/elements/Chart/index.js +1 -1842
- package/dist/elements/Chart/index.js.map +1 -1
- package/dist/elements/Chart/index.mjs +1 -1832
- package/dist/elements/Chart/index.mjs.map +1 -1
- package/dist/elements/Checkbox/index.js +1 -316
- package/dist/elements/Checkbox/index.js.map +1 -1
- package/dist/elements/Checkbox/index.mjs +1 -306
- package/dist/elements/Checkbox/index.mjs.map +1 -1
- package/dist/elements/CheckboxGroup/index.js +1 -455
- package/dist/elements/CheckboxGroup/index.js.map +1 -1
- package/dist/elements/CheckboxGroup/index.mjs +1 -439
- package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
- package/dist/elements/Combobox/Combobox.d.ts +56 -0
- package/dist/elements/Combobox/Combobox.d.ts.map +1 -0
- package/dist/elements/Combobox/Combobox.styles.d.ts +29 -0
- package/dist/elements/Combobox/Combobox.styles.d.ts.map +1 -0
- package/dist/elements/Combobox/Combobox.types.d.ts +67 -0
- package/dist/elements/Combobox/Combobox.types.d.ts.map +1 -0
- package/dist/elements/Combobox/index.d.ts +20 -0
- package/dist/elements/Combobox/index.d.ts.map +1 -0
- package/dist/elements/Combobox/index.js +3 -0
- package/dist/elements/Combobox/index.js.map +1 -0
- package/dist/elements/Combobox/index.mjs +3 -0
- package/dist/elements/Combobox/index.mjs.map +1 -0
- package/dist/elements/DatePicker/DatePicker.d.ts +1 -1
- package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/index.js +1 -903
- package/dist/elements/DatePicker/index.js.map +1 -1
- package/dist/elements/DatePicker/index.mjs +1 -853
- package/dist/elements/DatePicker/index.mjs.map +1 -1
- package/dist/elements/Dropdown/Dropdown.d.ts +7 -15
- package/dist/elements/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/elements/Dropdown/Dropdown.styles.d.ts +22 -0
- package/dist/elements/Dropdown/Dropdown.styles.d.ts.map +1 -0
- package/dist/elements/Dropdown/index.d.ts +1 -0
- package/dist/elements/Dropdown/index.d.ts.map +1 -1
- package/dist/elements/Dropdown/index.js +1 -193
- package/dist/elements/Dropdown/index.js.map +1 -1
- package/dist/elements/Dropdown/index.mjs +1 -184
- package/dist/elements/Dropdown/index.mjs.map +1 -1
- package/dist/elements/FileField/index.js +1 -1539
- package/dist/elements/FileField/index.js.map +1 -1
- package/dist/elements/FileField/index.mjs +1 -1507
- package/dist/elements/FileField/index.mjs.map +1 -1
- package/dist/elements/FormLayout/index.js +1 -170
- package/dist/elements/FormLayout/index.js.map +1 -1
- package/dist/elements/FormLayout/index.mjs +1 -167
- package/dist/elements/FormLayout/index.mjs.map +1 -1
- package/dist/elements/Modal/Modal.d.ts +9 -14
- package/dist/elements/Modal/Modal.d.ts.map +1 -1
- package/dist/elements/Modal/Modal.styles.d.ts +29 -0
- package/dist/elements/Modal/Modal.styles.d.ts.map +1 -0
- package/dist/elements/Modal/index.d.ts +1 -0
- package/dist/elements/Modal/index.d.ts.map +1 -1
- package/dist/elements/Modal/index.js +1 -232
- package/dist/elements/Modal/index.js.map +1 -1
- package/dist/elements/Modal/index.mjs +1 -220
- package/dist/elements/Modal/index.mjs.map +1 -1
- package/dist/elements/NumberField/index.js +1 -666
- package/dist/elements/NumberField/index.js.map +1 -1
- package/dist/elements/NumberField/index.mjs +1 -654
- package/dist/elements/NumberField/index.mjs.map +1 -1
- package/dist/elements/OTPInput/OTPInput.d.ts.map +1 -1
- package/dist/elements/OTPInput/index.js +1 -734
- package/dist/elements/OTPInput/index.js.map +1 -1
- package/dist/elements/OTPInput/index.mjs +1 -732
- package/dist/elements/OTPInput/index.mjs.map +1 -1
- package/dist/elements/Pagination/Pagination.d.ts +45 -0
- package/dist/elements/Pagination/Pagination.d.ts.map +1 -0
- package/dist/elements/Pagination/Pagination.styles.d.ts +10 -0
- package/dist/elements/Pagination/Pagination.styles.d.ts.map +1 -0
- package/dist/elements/Pagination/Pagination.types.d.ts +55 -0
- package/dist/elements/Pagination/Pagination.types.d.ts.map +1 -0
- package/dist/elements/Pagination/index.d.ts +21 -0
- package/dist/elements/Pagination/index.d.ts.map +1 -0
- package/dist/elements/Pagination/index.js +3 -0
- package/dist/elements/Pagination/index.js.map +1 -0
- package/dist/elements/Pagination/index.mjs +3 -0
- package/dist/elements/Pagination/index.mjs.map +1 -0
- package/dist/elements/Panel/index.js +1 -330
- package/dist/elements/Panel/index.js.map +1 -1
- package/dist/elements/Panel/index.mjs +1 -323
- package/dist/elements/Panel/index.mjs.map +1 -1
- package/dist/elements/PasswordField/PasswordField.d.ts +27 -0
- package/dist/elements/PasswordField/PasswordField.d.ts.map +1 -0
- package/dist/elements/PasswordField/PasswordField.styles.d.ts +32 -0
- package/dist/elements/PasswordField/PasswordField.styles.d.ts.map +1 -0
- package/dist/elements/PasswordField/PasswordField.types.d.ts +100 -0
- package/dist/elements/PasswordField/PasswordField.types.d.ts.map +1 -0
- package/dist/elements/PasswordField/index.css +2 -0
- package/dist/elements/PasswordField/index.css.map +1 -0
- package/dist/elements/PasswordField/index.d.ts +20 -0
- package/dist/elements/PasswordField/index.d.ts.map +1 -0
- package/dist/elements/PasswordField/index.js +3 -0
- package/dist/elements/PasswordField/index.js.map +1 -0
- package/dist/elements/PasswordField/index.mjs +3 -0
- package/dist/elements/PasswordField/index.mjs.map +1 -0
- package/dist/elements/Progress/index.js +1 -187
- package/dist/elements/Progress/index.js.map +1 -1
- package/dist/elements/Progress/index.mjs +1 -181
- package/dist/elements/Progress/index.mjs.map +1 -1
- package/dist/elements/RadioGroup/index.js +1 -369
- package/dist/elements/RadioGroup/index.js.map +1 -1
- package/dist/elements/RadioGroup/index.mjs +1 -359
- package/dist/elements/RadioGroup/index.mjs.map +1 -1
- package/dist/elements/Resizable/index.js +1 -1580
- package/dist/elements/Resizable/index.js.map +1 -1
- package/dist/elements/Resizable/index.mjs +1 -1566
- package/dist/elements/Resizable/index.mjs.map +1 -1
- package/dist/elements/SearchField/SearchField.d.ts +27 -0
- package/dist/elements/SearchField/SearchField.d.ts.map +1 -0
- package/dist/elements/SearchField/SearchField.styles.d.ts +32 -0
- package/dist/elements/SearchField/SearchField.styles.d.ts.map +1 -0
- package/dist/elements/SearchField/SearchField.types.d.ts +45 -0
- package/dist/elements/SearchField/SearchField.types.d.ts.map +1 -0
- package/dist/elements/SearchField/index.css +2 -0
- package/dist/elements/SearchField/index.css.map +1 -0
- package/dist/elements/SearchField/index.d.ts +21 -0
- package/dist/elements/SearchField/index.d.ts.map +1 -0
- package/dist/elements/SearchField/index.js +3 -0
- package/dist/elements/SearchField/index.js.map +1 -0
- package/dist/elements/SearchField/index.mjs +3 -0
- package/dist/elements/SearchField/index.mjs.map +1 -0
- package/dist/elements/Select/Select.d.ts +19 -48
- package/dist/elements/Select/Select.d.ts.map +1 -1
- package/dist/elements/Select/Select.styles.d.ts +55 -0
- package/dist/elements/Select/Select.styles.d.ts.map +1 -0
- package/dist/elements/Select/index.js +1 -589
- package/dist/elements/Select/index.js.map +1 -1
- package/dist/elements/Select/index.mjs +1 -582
- package/dist/elements/Select/index.mjs.map +1 -1
- package/dist/elements/Skeleton/index.js +1 -82
- package/dist/elements/Skeleton/index.js.map +1 -1
- package/dist/elements/Skeleton/index.mjs +1 -78
- package/dist/elements/Skeleton/index.mjs.map +1 -1
- package/dist/elements/Switch/index.js +1 -179
- package/dist/elements/Switch/index.js.map +1 -1
- package/dist/elements/Switch/index.mjs +1 -173
- package/dist/elements/Switch/index.mjs.map +1 -1
- package/dist/elements/Table/Table.d.ts +3 -24
- package/dist/elements/Table/Table.d.ts.map +1 -1
- package/dist/elements/Table/Table.styles.d.ts +24 -0
- package/dist/elements/Table/Table.styles.d.ts.map +1 -0
- package/dist/elements/Table/index.js +1 -595
- package/dist/elements/Table/index.js.map +1 -1
- package/dist/elements/Table/index.mjs +1 -578
- package/dist/elements/Table/index.mjs.map +1 -1
- package/dist/elements/Tabs/index.js +1 -337
- package/dist/elements/Tabs/index.js.map +1 -1
- package/dist/elements/Tabs/index.mjs +1 -320
- package/dist/elements/Tabs/index.mjs.map +1 -1
- package/dist/elements/TextField/TextField.d.ts +6 -42
- package/dist/elements/TextField/TextField.d.ts.map +1 -1
- package/dist/elements/TextField/TextField.hooks.d.ts +63 -0
- package/dist/elements/TextField/TextField.hooks.d.ts.map +1 -0
- package/dist/elements/TextField/TextField.icons.d.ts +19 -0
- package/dist/elements/TextField/TextField.icons.d.ts.map +1 -0
- package/dist/elements/TextField/TextField.styles.d.ts +37 -0
- package/dist/elements/TextField/TextField.styles.d.ts.map +1 -0
- package/dist/elements/TextField/TextField.types.d.ts +3 -0
- package/dist/elements/TextField/TextField.types.d.ts.map +1 -1
- package/dist/elements/TextField/index.css +1 -22
- package/dist/elements/TextField/index.css.map +1 -1
- package/dist/elements/TextField/index.js +1 -902
- package/dist/elements/TextField/index.js.map +1 -1
- package/dist/elements/TextField/index.mjs +1 -882
- package/dist/elements/TextField/index.mjs.map +1 -1
- package/dist/elements/TimeField/index.js +1 -254
- package/dist/elements/TimeField/index.js.map +1 -1
- package/dist/elements/TimeField/index.mjs +1 -238
- package/dist/elements/TimeField/index.mjs.map +1 -1
- package/dist/elements/Toast/Toast.d.ts +0 -22
- package/dist/elements/Toast/Toast.d.ts.map +1 -1
- package/dist/elements/Toast/index.js +1 -737
- package/dist/elements/Toast/index.js.map +1 -1
- package/dist/elements/Toast/index.mjs +1 -724
- package/dist/elements/Toast/index.mjs.map +1 -1
- package/dist/elements/Tooltip/index.js +1 -323
- package/dist/elements/Tooltip/index.js.map +1 -1
- package/dist/elements/Tooltip/index.mjs +1 -310
- package/dist/elements/Tooltip/index.mjs.map +1 -1
- package/dist/elements/index.css +1 -22
- package/dist/elements/index.css.map +1 -1
- package/dist/elements/index.d.ts +13 -1
- package/dist/elements/index.d.ts.map +1 -1
- package/dist/elements/index.js +1 -12455
- package/dist/elements/index.js.map +1 -1
- package/dist/elements/index.mjs +1 -12233
- package/dist/elements/index.mjs.map +1 -1
- package/dist/index.css +1 -22
- package/dist/index.css.map +1 -1
- package/dist/index.js +2 -12490
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -12262
- package/dist/index.mjs.map +1 -1
- package/dist/schemas/index.js +2 -54
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/index.mjs +2 -48
- package/dist/schemas/index.mjs.map +1 -1
- package/dist/styles/defaults.css +151 -0
- package/dist/styles/index.js +1 -166
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/index.mjs +1 -129
- package/dist/styles/index.mjs.map +1 -1
- package/dist/utils/index.js +1 -12
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -10
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +9 -7
- package/src/elements/Accordion/Accordion.stories.tsx +1 -1
- package/src/elements/AlertDialog/AlertDialog.stories.tsx +124 -0
- package/src/elements/Avatar/Avatar.stories.tsx +1 -1
- package/src/elements/Badge/Badge.stories.tsx +1 -1
- package/src/elements/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/src/elements/Button/Button.stories.tsx +1 -1
- package/src/elements/ButtonGroup/ButtonGroup.stories.tsx +1 -1
- package/src/elements/Card/Card.stories.tsx +1 -1
- package/src/elements/Carousel/Carousel.stories.tsx +1 -1
- package/src/elements/Chart/Chart.stories.tsx +1 -1
- package/src/elements/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/elements/CheckboxGroup/CheckboxGroup.stories.tsx +1 -1
- package/src/elements/Combobox/Combobox.stories.tsx +133 -0
- package/src/elements/DatePicker/DatePicker.stories.tsx +1 -1
- package/src/elements/Dropdown/Dropdown.stories.tsx +1 -1
- package/src/elements/FileField/FileField.stories.tsx +1 -1
- package/src/elements/FileField/FileProgress.stories.tsx +1 -1
- package/src/elements/FormLayout/FormLayout.stories.tsx +1 -1
- package/src/elements/Modal/Modal.stories.tsx +1 -1
- package/src/elements/NumberField/NumberField.stories.tsx +1 -1
- package/src/elements/OTPInput/OTPInput.stories.tsx +1 -1
- package/src/elements/Pagination/Pagination.stories.tsx +203 -0
- package/src/elements/Panel/Panel.stories.tsx +1 -1
- package/src/elements/PasswordField/PasswordField.stories.tsx +167 -0
- package/src/elements/Progress/Progress.stories.tsx +1 -1
- package/src/elements/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/src/elements/Resizable/Resizable.stories.tsx +1 -1
- package/src/elements/SearchField/SearchField.stories.tsx +146 -0
- package/src/elements/Select/Select.stories.tsx +1 -1
- package/src/elements/Skeleton/Skeleton.stories.tsx +1 -1
- package/src/elements/Switch/Switch.stories.tsx +1 -1
- package/src/elements/Table/Table.stories.tsx +1 -1
- package/src/elements/Tabs/Tabs.stories.tsx +1 -1
- package/src/elements/TextField/TextField.stories.tsx +1 -1
- package/src/elements/TimeField/TimeField.stories.tsx +1 -1
- package/src/elements/Toast/Toast.stories.tsx +1 -1
- package/src/elements/Tooltip/Tooltip.stories.tsx +1 -1
|
@@ -1,823 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var zod = require('zod');
|
|
5
|
-
var react = require('react');
|
|
6
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
-
var lucideReact = require('lucide-react');
|
|
8
|
-
var clsx = require('clsx');
|
|
9
|
-
var tailwindMerge = require('tailwind-merge');
|
|
10
|
-
var reactAriaComponents = require('react-aria-components');
|
|
11
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
-
|
|
13
|
-
// src/elements/Breadcrumbs/Breadcrumbs.types.ts
|
|
14
|
-
var BaseComponentPropsSchema = zod.z.object({
|
|
15
|
-
// Styling
|
|
16
|
-
className: zod.z.string().optional(),
|
|
17
|
-
// React
|
|
18
|
-
children: zod.z.any().optional(),
|
|
19
|
-
// ReactNode not directly supported by Zod
|
|
20
|
-
id: zod.z.string().optional(),
|
|
21
|
-
// Accessibility (WCAG 2.2 AA requirements)
|
|
22
|
-
"aria-label": zod.z.string().optional(),
|
|
23
|
-
"aria-labelledby": zod.z.string().optional(),
|
|
24
|
-
"aria-describedby": zod.z.string().optional(),
|
|
25
|
-
"aria-live": zod.z.enum(["off", "polite", "assertive"]).optional(),
|
|
26
|
-
"aria-hidden": zod.z.boolean().optional(),
|
|
27
|
-
// Testing & Development
|
|
28
|
-
"data-testid": zod.z.string().optional()
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// src/elements/Breadcrumbs/Breadcrumbs.types.ts
|
|
32
|
-
var BreadcrumbItemDataSchema = zod.z.object({
|
|
33
|
-
/** Unique identifier for the breadcrumb item */
|
|
34
|
-
id: zod.z.union([zod.z.string(), zod.z.number()]),
|
|
35
|
-
/** Display text for the breadcrumb (required - no icon-only items) */
|
|
36
|
-
label: zod.z.string(),
|
|
37
|
-
/** Link URL - omit for non-navigable items */
|
|
38
|
-
href: zod.z.string().optional(),
|
|
39
|
-
/** Optional leading icon (ReactNode) */
|
|
40
|
-
icon: zod.z.custom().optional(),
|
|
41
|
-
/** Disable this specific breadcrumb link */
|
|
42
|
-
isDisabled: zod.z.boolean().optional().default(false)
|
|
43
|
-
});
|
|
44
|
-
var SeparatorTypeSchema = zod.z.union([
|
|
45
|
-
zod.z.literal("chevron"),
|
|
46
|
-
zod.z.literal("slash"),
|
|
47
|
-
zod.z.custom()
|
|
48
|
-
]);
|
|
49
|
-
var BreadcrumbsPropsSchema = BaseComponentPropsSchema.extend({
|
|
50
|
-
/**
|
|
51
|
-
* Array of breadcrumb items to render
|
|
52
|
-
* @see FR-001 (Render Breadcrumbs from Items Array)
|
|
53
|
-
*/
|
|
54
|
-
items: zod.z.array(BreadcrumbItemDataSchema),
|
|
55
|
-
/**
|
|
56
|
-
* Separator style between items
|
|
57
|
-
* @default 'chevron'
|
|
58
|
-
* @see FR-003 (Configurable Separators)
|
|
59
|
-
*/
|
|
60
|
-
separator: SeparatorTypeSchema.optional().default("chevron"),
|
|
61
|
-
/**
|
|
62
|
-
* Maximum items to show before collapsing
|
|
63
|
-
* @default 4
|
|
64
|
-
* @see FR-004 (Ellipsis Collapse for Overflow)
|
|
65
|
-
*/
|
|
66
|
-
maxItems: zod.z.number().int().positive().optional().default(4),
|
|
67
|
-
/**
|
|
68
|
-
* Number of items to show before ellipsis
|
|
69
|
-
* @default 1
|
|
70
|
-
* @see FR-004 (Ellipsis Collapse for Overflow)
|
|
71
|
-
*/
|
|
72
|
-
itemsBeforeCollapse: zod.z.number().int().nonnegative().optional().default(1),
|
|
73
|
-
/**
|
|
74
|
-
* Number of items to show after ellipsis
|
|
75
|
-
* @default 2
|
|
76
|
-
* @see FR-004 (Ellipsis Collapse for Overflow)
|
|
77
|
-
*/
|
|
78
|
-
itemsAfterCollapse: zod.z.number().int().positive().optional().default(2),
|
|
79
|
-
/**
|
|
80
|
-
* Custom link component for framework integration (Next.js Link, React Router Link, etc.)
|
|
81
|
-
* @default 'a'
|
|
82
|
-
* @see FR-005 (Polymorphic Link Component)
|
|
83
|
-
*/
|
|
84
|
-
linkComponent: zod.z.custom().optional(),
|
|
85
|
-
/**
|
|
86
|
-
* Disable all breadcrumb links
|
|
87
|
-
* @default false
|
|
88
|
-
* @see FR-006 (Disabled States)
|
|
89
|
-
*/
|
|
90
|
-
isDisabled: zod.z.boolean().optional().default(false)
|
|
91
|
-
});
|
|
92
|
-
function cn(...inputs) {
|
|
93
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
94
|
-
}
|
|
95
|
-
var menuVariants = classVarianceAuthority.cva(
|
|
96
|
-
// Base styles - semantic tokens with fallbacks
|
|
97
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--menu-border)] bg-[var(--menu-background)] text-[var(--menu-foreground)] shadow-md data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 p-1",
|
|
98
|
-
{
|
|
99
|
-
variants: {
|
|
100
|
-
variant: {
|
|
101
|
-
default: ""
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
defaultVariants: {
|
|
105
|
-
variant: "default"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
var menuItemVariants = classVarianceAuthority.cva(
|
|
110
|
-
// Base styles - FR-014: 44x44px minimum touch targets
|
|
111
|
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 min-h-[44px] data-[focused]:bg-[var(--menu-accent)] data-[focused]:text-[var(--menu-accent-foreground)] data-[pressed]:bg-[var(--menu-accent)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
112
|
-
{
|
|
113
|
-
variants: {
|
|
114
|
-
variant: {
|
|
115
|
-
default: ""
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
defaultVariants: {
|
|
119
|
-
variant: "default"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
var DropdownRoot = react.forwardRef(
|
|
124
|
-
({ defaultOpen = false, isOpen, onOpenChange, children }, _ref) => {
|
|
125
|
-
const childArray = react.Children.toArray(children);
|
|
126
|
-
const hasTrigger = childArray.some(
|
|
127
|
-
(child) => react.isValidElement(child) && (child.type === DropdownTrigger || child.type.displayName === "DropdownTrigger")
|
|
128
|
-
);
|
|
129
|
-
const hasMenu = childArray.some(
|
|
130
|
-
(child) => react.isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
|
|
131
|
-
);
|
|
132
|
-
if (!hasTrigger || !hasMenu) {
|
|
133
|
-
throw new Error(
|
|
134
|
-
"Dropdown requires exactly one Dropdown.Trigger and one Dropdown.Menu as children"
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.MenuTrigger, { defaultOpen, isOpen, onOpenChange, children });
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
DropdownRoot.displayName = "Dropdown";
|
|
141
|
-
var DropdownTrigger = react.forwardRef(
|
|
142
|
-
({ children, ...props }, ref) => {
|
|
143
|
-
if (react.isValidElement(children)) {
|
|
144
|
-
return react.cloneElement(children, {
|
|
145
|
-
...props,
|
|
146
|
-
slot: "trigger"
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Button, { ref, ...props, children });
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
DropdownTrigger.displayName = "DropdownTrigger";
|
|
153
|
-
var DropdownMenu = react.forwardRef(
|
|
154
|
-
({ align = "start", side = "bottom", className, children, ...props }, _ref) => {
|
|
155
|
-
const placement = `${side} ${align}`;
|
|
156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Popover, { placement, className: "entering:animate-in exiting:animate-out", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
-
reactAriaComponents.Menu,
|
|
158
|
-
{
|
|
159
|
-
className: cn(menuVariants({ variant: "default" }), className),
|
|
160
|
-
...props,
|
|
161
|
-
children
|
|
162
|
-
}
|
|
163
|
-
) });
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
DropdownMenu.displayName = "DropdownMenu";
|
|
167
|
-
var DropdownItem = react.forwardRef(
|
|
168
|
-
({
|
|
169
|
-
children,
|
|
170
|
-
onAction,
|
|
171
|
-
isDisabled = false,
|
|
172
|
-
shortcut,
|
|
173
|
-
icon,
|
|
174
|
-
iconRight,
|
|
175
|
-
className,
|
|
176
|
-
"aria-label": ariaLabel,
|
|
177
|
-
...props
|
|
178
|
-
}, _ref) => {
|
|
179
|
-
const childArray = react.Children.toArray(children);
|
|
180
|
-
const hasSubmenu = childArray.some(
|
|
181
|
-
(child) => react.isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
|
|
182
|
-
);
|
|
183
|
-
const contentChildren = childArray.filter(
|
|
184
|
-
(child) => !react.isValidElement(child) || child.type !== DropdownMenu && child.type.displayName !== "DropdownMenu"
|
|
185
|
-
);
|
|
186
|
-
const submenu = childArray.find(
|
|
187
|
-
(child) => react.isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
|
|
188
|
-
);
|
|
189
|
-
if (hasSubmenu && submenu) {
|
|
190
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.SubmenuTrigger, { children: [
|
|
191
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
192
|
-
reactAriaComponents.MenuItem,
|
|
193
|
-
{
|
|
194
|
-
"aria-label": ariaLabel,
|
|
195
|
-
className: cn(menuItemVariants({ variant: "default" }), className),
|
|
196
|
-
...props,
|
|
197
|
-
children: [
|
|
198
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: icon }),
|
|
199
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: contentChildren }),
|
|
200
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto h-4 w-4", "aria-hidden": "true" })
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
),
|
|
204
|
-
submenu
|
|
205
|
-
] });
|
|
206
|
-
}
|
|
207
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
208
|
-
reactAriaComponents.MenuItem,
|
|
209
|
-
{
|
|
210
|
-
onAction,
|
|
211
|
-
isDisabled,
|
|
212
|
-
"aria-label": ariaLabel,
|
|
213
|
-
className: cn(menuItemVariants({ variant: "default" }), className),
|
|
214
|
-
...props,
|
|
215
|
-
children: [
|
|
216
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-2", children: icon }),
|
|
217
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
|
|
218
|
-
iconRight && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto", children: iconRight }),
|
|
219
|
-
shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "ml-auto pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-[var(--border)] bg-[var(--accent-background)] px-1.5 font-mono text-[10px] font-medium text-[var(--menu-muted)] opacity-100", children: shortcut })
|
|
220
|
-
]
|
|
221
|
-
}
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
DropdownItem.displayName = "DropdownItem";
|
|
226
|
-
var DropdownSeparator = react.memo(react.forwardRef(
|
|
227
|
-
({ className, ...props }, _ref) => {
|
|
228
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
229
|
-
reactAriaComponents.Separator,
|
|
230
|
-
{
|
|
231
|
-
className: cn(
|
|
232
|
-
"-mx-1 my-1 h-px bg-[var(--accent-background)]",
|
|
233
|
-
className
|
|
234
|
-
),
|
|
235
|
-
...props
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
));
|
|
240
|
-
DropdownSeparator.displayName = "DropdownSeparator";
|
|
241
|
-
var DropdownLabel = react.memo(react.forwardRef(
|
|
242
|
-
({ children, className, ...props }, _ref) => {
|
|
243
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
244
|
-
reactAriaComponents.Header,
|
|
245
|
-
{
|
|
246
|
-
className: cn(
|
|
247
|
-
"px-2 py-1.5 text-sm font-semibold text-[var(--menu-muted)]",
|
|
248
|
-
className
|
|
249
|
-
),
|
|
250
|
-
...props,
|
|
251
|
-
children
|
|
252
|
-
}
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
));
|
|
256
|
-
DropdownLabel.displayName = "DropdownLabel";
|
|
257
|
-
var Dropdown = Object.assign(DropdownRoot, {
|
|
258
|
-
Trigger: DropdownTrigger,
|
|
259
|
-
Menu: DropdownMenu,
|
|
260
|
-
Item: DropdownItem,
|
|
261
|
-
Separator: DropdownSeparator,
|
|
262
|
-
Label: DropdownLabel
|
|
263
|
-
});
|
|
264
|
-
var PRESSED_STYLES = "data-[pressed]:scale-[0.97]";
|
|
265
|
-
var HOVER_STYLES = "data-[hovered]:shadow-md";
|
|
266
|
-
var HIGH_CONTRAST_HOVER = "hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground";
|
|
267
|
-
var HIGH_CONTRAST_PRESSED = "hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";
|
|
268
|
-
var ButtonGroupContext = react.createContext(null);
|
|
269
|
-
ButtonGroupContext.displayName = "ButtonGroupContext";
|
|
270
|
-
function useButtonGroupContext() {
|
|
271
|
-
return react.useContext(ButtonGroupContext);
|
|
272
|
-
}
|
|
273
|
-
var ButtonGroupItemContext = react.createContext(null);
|
|
274
|
-
ButtonGroupItemContext.displayName = "ButtonGroupItemContext";
|
|
275
|
-
function useButtonGroupItemContext() {
|
|
276
|
-
return react.useContext(ButtonGroupItemContext);
|
|
277
|
-
}
|
|
278
|
-
classVarianceAuthority.cva("inline-flex items-center gap-0", {
|
|
279
|
-
variants: {
|
|
280
|
-
orientation: {
|
|
281
|
-
horizontal: "flex-row",
|
|
282
|
-
vertical: "flex-col w-full"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
defaultVariants: {
|
|
286
|
-
orientation: "horizontal"
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
var buttonGroupItemVariants = classVarianceAuthority.cva("", {
|
|
290
|
-
variants: {
|
|
291
|
-
orientation: {
|
|
292
|
-
// min-w-[44px] ensures visual layer fills touch target width (for icon buttons)
|
|
293
|
-
horizontal: "min-w-[44px]",
|
|
294
|
-
// flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,
|
|
295
|
-
// eliminating gaps between stacked buttons in vertical orientation
|
|
296
|
-
vertical: "flex min-h-[44px]"
|
|
297
|
-
},
|
|
298
|
-
position: {
|
|
299
|
-
first: "",
|
|
300
|
-
middle: "",
|
|
301
|
-
last: "",
|
|
302
|
-
only: ""
|
|
303
|
-
// Single button - no modifications needed
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
compoundVariants: [
|
|
307
|
-
// ==========================================================================
|
|
308
|
-
// Horizontal Orientation
|
|
309
|
-
// ==========================================================================
|
|
310
|
-
{
|
|
311
|
-
orientation: "horizontal",
|
|
312
|
-
position: "first",
|
|
313
|
-
className: "rounded-r-none border-r-0"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
orientation: "horizontal",
|
|
317
|
-
position: "middle",
|
|
318
|
-
className: "rounded-none border-r-0"
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
orientation: "horizontal",
|
|
322
|
-
position: "last",
|
|
323
|
-
className: "rounded-l-none"
|
|
324
|
-
},
|
|
325
|
-
// ==========================================================================
|
|
326
|
-
// Vertical Orientation
|
|
327
|
-
// Note: w-full is handled by Button's effectiveFullWidth for both layers
|
|
328
|
-
// ==========================================================================
|
|
329
|
-
{
|
|
330
|
-
orientation: "vertical",
|
|
331
|
-
position: "first",
|
|
332
|
-
className: "rounded-b-none border-b-0"
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
orientation: "vertical",
|
|
336
|
-
position: "middle",
|
|
337
|
-
className: "rounded-none border-b-0"
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
orientation: "vertical",
|
|
341
|
-
position: "last",
|
|
342
|
-
className: "rounded-t-none"
|
|
343
|
-
}
|
|
344
|
-
],
|
|
345
|
-
defaultVariants: {
|
|
346
|
-
orientation: "horizontal",
|
|
347
|
-
position: "only"
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
classVarianceAuthority.cva("bg-[var(--border)]", {
|
|
351
|
-
variants: {
|
|
352
|
-
orientation: {
|
|
353
|
-
horizontal: "w-px h-6 mx-1",
|
|
354
|
-
vertical: "h-px w-full my-1"
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
defaultVariants: {
|
|
358
|
-
orientation: "horizontal"
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
var buttonOuterVariants = classVarianceAuthority.cva(
|
|
362
|
-
"inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
363
|
-
{
|
|
364
|
-
variants: {
|
|
365
|
-
fullWidth: {
|
|
366
|
-
true: "w-full",
|
|
367
|
-
false: ""
|
|
368
|
-
},
|
|
369
|
-
inVerticalGroup: {
|
|
370
|
-
true: "items-stretch",
|
|
371
|
-
false: "items-center"
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
defaultVariants: {
|
|
375
|
-
fullWidth: false,
|
|
376
|
-
inVerticalGroup: false
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
var buttonVisualVariants = classVarianceAuthority.cva(
|
|
381
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",
|
|
382
|
-
{
|
|
383
|
-
variants: {
|
|
384
|
-
variant: {
|
|
385
|
-
default: "bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",
|
|
386
|
-
destructive: "bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",
|
|
387
|
-
outline: "border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",
|
|
388
|
-
secondary: "bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",
|
|
389
|
-
ghost: "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",
|
|
390
|
-
link: "text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"
|
|
391
|
-
},
|
|
392
|
-
fullWidth: {
|
|
393
|
-
true: "w-full",
|
|
394
|
-
false: ""
|
|
395
|
-
},
|
|
396
|
-
visualSize: {
|
|
397
|
-
default: "h-10 px-4 py-2",
|
|
398
|
-
sm: "h-9 rounded-md px-3 text-xs",
|
|
399
|
-
lg: "h-11 rounded-md px-8",
|
|
400
|
-
icon: "h-10 w-10",
|
|
401
|
-
dot: "h-5 w-5 rounded-full p-0 min-h-0 min-w-0"
|
|
402
|
-
},
|
|
403
|
-
paywall: {
|
|
404
|
-
true: "!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",
|
|
405
|
-
false: ""
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
defaultVariants: {
|
|
409
|
-
variant: "default",
|
|
410
|
-
visualSize: "default",
|
|
411
|
-
paywall: false
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
);
|
|
415
|
-
var Button = react.memo(react.forwardRef(
|
|
416
|
-
({
|
|
417
|
-
className,
|
|
418
|
-
buttonVisualClassName,
|
|
419
|
-
variant,
|
|
420
|
-
size,
|
|
421
|
-
visualSize,
|
|
422
|
-
fullWidth,
|
|
423
|
-
loading = false,
|
|
424
|
-
loadingText = "Loading...",
|
|
425
|
-
shortcut,
|
|
426
|
-
children,
|
|
427
|
-
isDisabled,
|
|
428
|
-
paywall = false,
|
|
429
|
-
paywallRedirect,
|
|
430
|
-
paywallDescription,
|
|
431
|
-
onPress,
|
|
432
|
-
...props
|
|
433
|
-
}, ref) => {
|
|
434
|
-
const paywallDescriptionId = react.useId();
|
|
435
|
-
const groupContext = useButtonGroupContext();
|
|
436
|
-
const itemContext = useButtonGroupItemContext();
|
|
437
|
-
const effectiveVariant = variant ?? groupContext?.variant ?? "default";
|
|
438
|
-
const effectiveSize = size ?? groupContext?.size;
|
|
439
|
-
const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;
|
|
440
|
-
const isInVerticalGroup = groupContext?.orientation === "vertical";
|
|
441
|
-
const effectiveFullWidth = fullWidth || isInVerticalGroup;
|
|
442
|
-
const positionClassName = itemContext ? buttonGroupItemVariants({
|
|
443
|
-
orientation: groupContext?.orientation ?? "horizontal",
|
|
444
|
-
position: itemContext.position
|
|
445
|
-
}) : "";
|
|
446
|
-
const effectiveVisualSize = visualSize ?? effectiveSize ?? "default";
|
|
447
|
-
if (process.env.NODE_ENV !== "production") {
|
|
448
|
-
if ((effectiveVisualSize === "dot" || effectiveVisualSize === "icon") && !props["aria-label"] && !children) {
|
|
449
|
-
console.warn(
|
|
450
|
-
'[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
const handlePress = (e) => {
|
|
455
|
-
if (paywall) {
|
|
456
|
-
if (paywallRedirect) {
|
|
457
|
-
window.open(paywallRedirect, "_blank", "noopener,noreferrer");
|
|
458
|
-
}
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
onPress?.(e);
|
|
462
|
-
};
|
|
463
|
-
const computedIsDisabled = effectiveIsDisabled || loading || void 0;
|
|
464
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
-
reactAriaComponents.Button,
|
|
466
|
-
{
|
|
467
|
-
ref,
|
|
468
|
-
isDisabled: computedIsDisabled,
|
|
469
|
-
"aria-disabled": paywall ? true : void 0,
|
|
470
|
-
"aria-describedby": paywall ? paywallDescriptionId : void 0,
|
|
471
|
-
onPress: handlePress,
|
|
472
|
-
className: cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className),
|
|
473
|
-
...props,
|
|
474
|
-
children: (renderProps) => (
|
|
475
|
-
/* Layer 2: Visual Button */
|
|
476
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
477
|
-
"span",
|
|
478
|
-
{
|
|
479
|
-
className: cn(
|
|
480
|
-
buttonVisualVariants({
|
|
481
|
-
variant: effectiveVariant,
|
|
482
|
-
visualSize: effectiveVisualSize,
|
|
483
|
-
paywall,
|
|
484
|
-
fullWidth: effectiveFullWidth
|
|
485
|
-
}),
|
|
486
|
-
// Position styling from ButtonGroup context (border-radius adjustments)
|
|
487
|
-
positionClassName,
|
|
488
|
-
buttonVisualClassName,
|
|
489
|
-
// Layer 2 interaction styles (no focus - focus ring is on Layer 1)
|
|
490
|
-
PRESSED_STYLES,
|
|
491
|
-
HOVER_STYLES,
|
|
492
|
-
HIGH_CONTRAST_HOVER,
|
|
493
|
-
HIGH_CONTRAST_PRESSED
|
|
494
|
-
),
|
|
495
|
-
"data-pressed": renderProps.isPressed || void 0,
|
|
496
|
-
children: [
|
|
497
|
-
loading && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
498
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "motion-safe:animate-spin", "aria-hidden": "true" }),
|
|
499
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", "aria-live": "polite", children: loadingText })
|
|
500
|
-
] }),
|
|
501
|
-
!loading && children,
|
|
502
|
-
paywall && /* @__PURE__ */ jsxRuntime.jsx(
|
|
503
|
-
lucideReact.Zap,
|
|
504
|
-
{
|
|
505
|
-
"data-testid": "zap-icon",
|
|
506
|
-
"aria-hidden": "true",
|
|
507
|
-
className: "ml-1"
|
|
508
|
-
}
|
|
509
|
-
),
|
|
510
|
-
paywall && /* @__PURE__ */ jsxRuntime.jsxs("span", { id: paywallDescriptionId, className: "sr-only", children: [
|
|
511
|
-
"Premium feature: ",
|
|
512
|
-
paywallDescription || "Upgrade required to access this feature"
|
|
513
|
-
] }),
|
|
514
|
-
renderProps.isFocusVisible && shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "ml-auto hidden text-xs opacity-60 lg:inline", children: shortcut }),
|
|
515
|
-
renderProps.isPressed && /* @__PURE__ */ jsxRuntime.jsx(
|
|
516
|
-
"span",
|
|
517
|
-
{
|
|
518
|
-
className: "absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95",
|
|
519
|
-
"aria-hidden": "true"
|
|
520
|
-
}
|
|
521
|
-
)
|
|
522
|
-
]
|
|
523
|
-
}
|
|
524
|
-
)
|
|
525
|
-
)
|
|
526
|
-
}
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
));
|
|
530
|
-
Button.displayName = "Button";
|
|
531
|
-
var breadcrumbsVariants = classVarianceAuthority.cva("flex items-center flex-wrap", {
|
|
532
|
-
variants: {},
|
|
533
|
-
defaultVariants: {}
|
|
534
|
-
});
|
|
535
|
-
var breadcrumbListVariants = classVarianceAuthority.cva(
|
|
536
|
-
"flex flex-wrap items-center gap-1 break-words text-sm text-[var(--menu-muted)]",
|
|
537
|
-
{
|
|
538
|
-
variants: {},
|
|
539
|
-
defaultVariants: {}
|
|
540
|
-
}
|
|
541
|
-
);
|
|
542
|
-
var breadcrumbItemVariants = classVarianceAuthority.cva("inline-flex items-center gap-1", {
|
|
543
|
-
variants: {},
|
|
544
|
-
defaultVariants: {}
|
|
545
|
-
});
|
|
546
|
-
var breadcrumbLinkVariants = classVarianceAuthority.cva(
|
|
547
|
-
"inline-flex items-center gap-2 min-h-[44px] px-2 rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
|
|
548
|
-
{
|
|
549
|
-
variants: {
|
|
550
|
-
state: {
|
|
551
|
-
default: [
|
|
552
|
-
"text-[var(--menu-muted)]",
|
|
553
|
-
"hover:text-[var(--content-foreground)]",
|
|
554
|
-
"hover:underline underline-offset-4"
|
|
555
|
-
].join(" "),
|
|
556
|
-
current: "text-[var(--content-foreground)] font-medium pointer-events-none",
|
|
557
|
-
disabled: "text-[var(--menu-muted)] opacity-50 cursor-not-allowed pointer-events-none"
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
defaultVariants: {
|
|
561
|
-
state: "default"
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
);
|
|
565
|
-
var separatorVariants = classVarianceAuthority.cva("text-[var(--menu-muted)]", {
|
|
566
|
-
variants: {
|
|
567
|
-
type: {
|
|
568
|
-
chevron: "[&>svg]:h-4 [&>svg]:w-4",
|
|
569
|
-
slash: "mx-2",
|
|
570
|
-
custom: ""
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
|
-
defaultVariants: {
|
|
574
|
-
type: "chevron"
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
var ellipsisButtonVariants = classVarianceAuthority.cva(
|
|
578
|
-
"inline-flex items-center justify-center min-h-[44px] min-w-[44px] rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 hover:bg-[var(--accent)]",
|
|
579
|
-
{
|
|
580
|
-
variants: {},
|
|
581
|
-
defaultVariants: {}
|
|
582
|
-
}
|
|
583
|
-
);
|
|
584
|
-
function isCurrentPage(index, total) {
|
|
585
|
-
return index === total - 1;
|
|
586
|
-
}
|
|
587
|
-
function getCollapsedItems(items, maxItems, itemsBeforeCollapse, itemsAfterCollapse) {
|
|
588
|
-
if (items.length <= maxItems) {
|
|
589
|
-
return null;
|
|
590
|
-
}
|
|
591
|
-
if (itemsBeforeCollapse + itemsAfterCollapse >= items.length) {
|
|
592
|
-
return null;
|
|
593
|
-
}
|
|
594
|
-
const before = items.slice(0, itemsBeforeCollapse);
|
|
595
|
-
const after = items.slice(-itemsAfterCollapse);
|
|
596
|
-
const collapsed = items.slice(itemsBeforeCollapse, items.length - itemsAfterCollapse);
|
|
597
|
-
return { before, collapsed, after };
|
|
598
|
-
}
|
|
599
|
-
function BreadcrumbSeparator({ separator }) {
|
|
600
|
-
if (separator === "chevron") {
|
|
601
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
602
|
-
"li",
|
|
603
|
-
{
|
|
604
|
-
role: "presentation",
|
|
605
|
-
"aria-hidden": "true",
|
|
606
|
-
className: separatorVariants({ type: "chevron" }),
|
|
607
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
|
|
608
|
-
}
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
if (separator === "slash") {
|
|
612
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
613
|
-
"li",
|
|
614
|
-
{
|
|
615
|
-
role: "presentation",
|
|
616
|
-
"aria-hidden": "true",
|
|
617
|
-
className: separatorVariants({ type: "slash" }),
|
|
618
|
-
children: "/"
|
|
619
|
-
}
|
|
620
|
-
);
|
|
621
|
-
}
|
|
622
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
623
|
-
"li",
|
|
624
|
-
{
|
|
625
|
-
role: "presentation",
|
|
626
|
-
"aria-hidden": "true",
|
|
627
|
-
className: separatorVariants({ type: "custom" }),
|
|
628
|
-
children: separator
|
|
629
|
-
}
|
|
630
|
-
);
|
|
631
|
-
}
|
|
632
|
-
function BreadcrumbLink({
|
|
633
|
-
item,
|
|
634
|
-
isCurrent,
|
|
635
|
-
linkComponent: LinkComponent = "a",
|
|
636
|
-
isGroupDisabled
|
|
637
|
-
}) {
|
|
638
|
-
const isDisabled = isGroupDisabled || item.isDisabled;
|
|
639
|
-
const state = isCurrent ? "current" : isDisabled ? "disabled" : "default";
|
|
640
|
-
if (isCurrent) {
|
|
641
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
642
|
-
"span",
|
|
643
|
-
{
|
|
644
|
-
className: breadcrumbLinkVariants({ state: "current" }),
|
|
645
|
-
"aria-current": "page",
|
|
646
|
-
children: [
|
|
647
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: item.icon }),
|
|
648
|
-
item.label
|
|
649
|
-
]
|
|
650
|
-
}
|
|
651
|
-
);
|
|
652
|
-
}
|
|
653
|
-
if (!item.href) {
|
|
654
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
655
|
-
"span",
|
|
656
|
-
{
|
|
657
|
-
className: breadcrumbLinkVariants({ state: isDisabled ? "disabled" : "default" }),
|
|
658
|
-
"aria-disabled": isDisabled || void 0,
|
|
659
|
-
children: [
|
|
660
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: item.icon }),
|
|
661
|
-
item.label
|
|
662
|
-
]
|
|
663
|
-
}
|
|
664
|
-
);
|
|
665
|
-
}
|
|
666
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
667
|
-
LinkComponent,
|
|
668
|
-
{
|
|
669
|
-
href: item.href,
|
|
670
|
-
className: breadcrumbLinkVariants({ state }),
|
|
671
|
-
"aria-disabled": isDisabled || void 0,
|
|
672
|
-
children: [
|
|
673
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: item.icon }),
|
|
674
|
-
item.label
|
|
675
|
-
]
|
|
676
|
-
}
|
|
677
|
-
);
|
|
678
|
-
}
|
|
679
|
-
function BreadcrumbEllipsis({
|
|
680
|
-
items,
|
|
681
|
-
linkComponent: LinkComponent = "a",
|
|
682
|
-
isGroupDisabled
|
|
683
|
-
}) {
|
|
684
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Dropdown, { defaultOpen: false, children: [
|
|
685
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dropdown.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
686
|
-
Button,
|
|
687
|
-
{
|
|
688
|
-
variant: "ghost",
|
|
689
|
-
size: "icon",
|
|
690
|
-
className: ellipsisButtonVariants(),
|
|
691
|
-
"aria-label": "More breadcrumbs",
|
|
692
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" })
|
|
693
|
-
}
|
|
694
|
-
) }),
|
|
695
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dropdown.Menu, { align: "start", side: "bottom", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
696
|
-
Dropdown.Item,
|
|
697
|
-
{
|
|
698
|
-
isDisabled: isGroupDisabled || item.isDisabled,
|
|
699
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
700
|
-
LinkComponent,
|
|
701
|
-
{
|
|
702
|
-
href: item.href,
|
|
703
|
-
className: "flex flex-1 items-center gap-2",
|
|
704
|
-
children: [
|
|
705
|
-
item.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: item.icon }),
|
|
706
|
-
item.label
|
|
707
|
-
]
|
|
708
|
-
}
|
|
709
|
-
)
|
|
710
|
-
},
|
|
711
|
-
item.id
|
|
712
|
-
)) })
|
|
713
|
-
] });
|
|
714
|
-
}
|
|
715
|
-
var Breadcrumbs = react.forwardRef(
|
|
716
|
-
({
|
|
717
|
-
items,
|
|
718
|
-
separator = "chevron",
|
|
719
|
-
maxItems = 4,
|
|
720
|
-
itemsBeforeCollapse = 1,
|
|
721
|
-
itemsAfterCollapse = 2,
|
|
722
|
-
linkComponent,
|
|
723
|
-
isDisabled,
|
|
724
|
-
className,
|
|
725
|
-
"aria-label": ariaLabel = "Breadcrumb",
|
|
726
|
-
...props
|
|
727
|
-
}, ref) => {
|
|
728
|
-
if (!items || items.length === 0) {
|
|
729
|
-
return null;
|
|
730
|
-
}
|
|
731
|
-
const collapsedData = getCollapsedItems(
|
|
732
|
-
items,
|
|
733
|
-
maxItems,
|
|
734
|
-
itemsBeforeCollapse,
|
|
735
|
-
itemsAfterCollapse
|
|
736
|
-
);
|
|
737
|
-
if (!collapsedData) {
|
|
738
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
739
|
-
"nav",
|
|
740
|
-
{
|
|
741
|
-
ref,
|
|
742
|
-
"aria-label": ariaLabel,
|
|
743
|
-
className: cn(breadcrumbsVariants(), className),
|
|
744
|
-
...props,
|
|
745
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: breadcrumbListVariants(), children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
746
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
-
BreadcrumbLink,
|
|
748
|
-
{
|
|
749
|
-
item,
|
|
750
|
-
isCurrent: isCurrentPage(index, items.length),
|
|
751
|
-
linkComponent,
|
|
752
|
-
isGroupDisabled: isDisabled
|
|
753
|
-
}
|
|
754
|
-
) }),
|
|
755
|
-
index < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, { separator })
|
|
756
|
-
] }, item.id)) })
|
|
757
|
-
}
|
|
758
|
-
);
|
|
759
|
-
}
|
|
760
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
761
|
-
"nav",
|
|
762
|
-
{
|
|
763
|
-
ref,
|
|
764
|
-
"aria-label": ariaLabel,
|
|
765
|
-
className: cn(breadcrumbsVariants(), className),
|
|
766
|
-
...props,
|
|
767
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: breadcrumbListVariants(), children: [
|
|
768
|
-
collapsedData.before.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
769
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
770
|
-
BreadcrumbLink,
|
|
771
|
-
{
|
|
772
|
-
item,
|
|
773
|
-
isCurrent: false,
|
|
774
|
-
linkComponent,
|
|
775
|
-
isGroupDisabled: isDisabled
|
|
776
|
-
}
|
|
777
|
-
) }),
|
|
778
|
-
/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, { separator })
|
|
779
|
-
] }, item.id)),
|
|
780
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
781
|
-
BreadcrumbEllipsis,
|
|
782
|
-
{
|
|
783
|
-
items: collapsedData.collapsed,
|
|
784
|
-
linkComponent,
|
|
785
|
-
isGroupDisabled: isDisabled
|
|
786
|
-
}
|
|
787
|
-
) }),
|
|
788
|
-
/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, { separator }),
|
|
789
|
-
collapsedData.after.map((item, index) => {
|
|
790
|
-
const isLast = index === collapsedData.after.length - 1;
|
|
791
|
-
const globalIndex = items.length - collapsedData.after.length + index;
|
|
792
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
793
|
-
/* @__PURE__ */ jsxRuntime.jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
794
|
-
BreadcrumbLink,
|
|
795
|
-
{
|
|
796
|
-
item,
|
|
797
|
-
isCurrent: isCurrentPage(globalIndex, items.length),
|
|
798
|
-
linkComponent,
|
|
799
|
-
isGroupDisabled: isDisabled
|
|
800
|
-
}
|
|
801
|
-
) }),
|
|
802
|
-
!isLast && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, { separator })
|
|
803
|
-
] }, item.id);
|
|
804
|
-
})
|
|
805
|
-
] })
|
|
806
|
-
}
|
|
807
|
-
);
|
|
808
|
-
}
|
|
809
|
-
);
|
|
810
|
-
Breadcrumbs.displayName = "Breadcrumbs";
|
|
811
|
-
|
|
812
|
-
exports.BreadcrumbItemDataSchema = BreadcrumbItemDataSchema;
|
|
813
|
-
exports.Breadcrumbs = Breadcrumbs;
|
|
814
|
-
exports.BreadcrumbsPropsSchema = BreadcrumbsPropsSchema;
|
|
815
|
-
exports.SeparatorTypeSchema = SeparatorTypeSchema;
|
|
816
|
-
exports.breadcrumbItemVariants = breadcrumbItemVariants;
|
|
817
|
-
exports.breadcrumbLinkVariants = breadcrumbLinkVariants;
|
|
818
|
-
exports.breadcrumbListVariants = breadcrumbListVariants;
|
|
819
|
-
exports.breadcrumbsVariants = breadcrumbsVariants;
|
|
820
|
-
exports.ellipsisButtonVariants = ellipsisButtonVariants;
|
|
821
|
-
exports.separatorVariants = separatorVariants;
|
|
822
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
'use strict';var zod=require('zod'),react=require('react'),classVarianceAuthority=require('class-variance-authority'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactAriaComponents=require('react-aria-components'),jsxRuntime=require('react/jsx-runtime');var se=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var pe=zod.z.object({id:zod.z.union([zod.z.string(),zod.z.number()]),label:zod.z.string(),href:zod.z.string().optional(),icon:zod.z.custom().optional(),isDisabled:zod.z.boolean().optional().default(false)}),le=zod.z.union([zod.z.literal("chevron"),zod.z.literal("slash"),zod.z.custom()]),ke=se.extend({items:zod.z.array(pe),separator:le.optional().default("chevron"),maxItems:zod.z.number().int().positive().optional().default(4),itemsBeforeCollapse:zod.z.number().int().nonnegative().optional().default(1),itemsAfterCollapse:zod.z.number().int().positive().optional().default(2),linkComponent:zod.z.custom().optional(),isDisabled:zod.z.boolean().optional().default(false)});function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var H=classVarianceAuthority.cva("z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--menu-border)] bg-[var(--menu-background)] text-[var(--menu-foreground)] shadow-md data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 p-1",{variants:{variant:{default:""}},defaultVariants:{variant:"default"}}),C=classVarianceAuthority.cva("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 min-h-[44px] data-[focused]:bg-[var(--menu-accent)] data-[focused]:text-[var(--menu-accent-foreground)] data-[pressed]:bg-[var(--menu-accent)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:""}},defaultVariants:{variant:"default"}});function $(e){if(typeof e=="function"||typeof e=="object")return e?.displayName}var fe=react.forwardRef(({defaultOpen:e=false,isOpen:t,onOpenChange:o,children:a},n)=>{if(process.env.NODE_ENV!=="production"){let s=react.Children.toArray(a),p=s.some(u=>react.isValidElement(u)&&(u.type===k||$(u.type)==="DropdownTrigger")),v=s.some(u=>react.isValidElement(u)&&(u.type===P||$(u.type)==="DropdownMenu"));if(!p||!v)throw new Error("Dropdown requires exactly one Dropdown.Trigger and one Dropdown.Menu as children")}return jsxRuntime.jsx(reactAriaComponents.MenuTrigger,{defaultOpen:e,isOpen:t,onOpenChange:o,children:a})});fe.displayName="Dropdown";var k=react.forwardRef(({children:e,...t},o)=>react.isValidElement(e)?react.cloneElement(e,{...t,slot:"trigger"}):jsxRuntime.jsx(reactAriaComponents.Button,{ref:o,...t,children:e}));k.displayName="DropdownTrigger";var P=react.forwardRef(({align:e="start",side:t="bottom",className:o,children:a,...n},s)=>{let p=`${t} ${e}`;return jsxRuntime.jsx(reactAriaComponents.Popover,{placement:p,className:"entering:animate-in exiting:animate-out",children:jsxRuntime.jsx(reactAriaComponents.Menu,{className:c(H({variant:"default"}),o),...n,children:a})})});P.displayName="DropdownMenu";var F=react.forwardRef(({children:e,onAction:t,isDisabled:o=false,shortcut:a,icon:n,iconRight:s,className:p,"aria-label":v,...u},y)=>{let h=react.Children.toArray(e),l=f=>react.isValidElement(f)&&(f.type===P||$(f.type)==="DropdownMenu"),d=h.some(l),g=h.filter(f=>!l(f)),D=h.find(l);return d&&D?jsxRuntime.jsxs(reactAriaComponents.SubmenuTrigger,{children:[jsxRuntime.jsxs(reactAriaComponents.MenuItem,{"aria-label":v,className:c(C({variant:"default"}),p),...u,children:[n&&jsxRuntime.jsx("span",{className:"mr-2",children:n}),jsxRuntime.jsx("span",{className:"flex-1",children:g}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"ml-auto h-4 w-4","aria-hidden":"true"})]}),D]}):jsxRuntime.jsxs(reactAriaComponents.MenuItem,{onAction:t,isDisabled:o,"aria-label":v,className:c(C({variant:"default"}),p),...u,children:[n&&jsxRuntime.jsx("span",{className:"mr-2",children:n}),jsxRuntime.jsx("span",{className:"flex-1",children:e}),s&&jsxRuntime.jsx("span",{className:"ml-auto",children:s}),a&&jsxRuntime.jsx("kbd",{className:"ml-auto pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-[var(--border)] bg-[var(--accent-background)] px-1.5 font-mono text-[10px] font-medium text-[var(--menu-muted)] opacity-100",children:a})]})});F.displayName="DropdownItem";var Y=react.memo(react.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(reactAriaComponents.Separator,{className:c("-mx-1 my-1 h-px bg-[var(--accent-background)]",e),...t})));Y.displayName="DropdownSeparator";var W=react.memo(react.forwardRef(({children:e,className:t,...o},a)=>jsxRuntime.jsx(reactAriaComponents.Header,{className:c("px-2 py-1.5 text-sm font-semibold text-[var(--menu-muted)]",t),...o,children:e})));W.displayName="DropdownLabel";var S=Object.assign(fe,{Trigger:k,Menu:P,Item:F,Separator:Y,Label:W});var j=classVarianceAuthority.cva("inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",{variants:{fullWidth:{true:"w-full",false:""},inVerticalGroup:{true:"items-stretch",false:"items-center"}},defaultVariants:{fullWidth:false,inVerticalGroup:false}}),U=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",{variants:{variant:{default:"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",destructive:"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",outline:"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",secondary:"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",ghost:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",link:"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"},fullWidth:{true:"w-full",false:""},visualSize:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",dot:"h-5 w-5 rounded-full p-0 min-h-0 min-w-0"},paywall:{true:"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",false:""}},defaultVariants:{variant:"default",visualSize:"default",paywall:false}});var q="data-[pressed]:scale-[0.97]";var Z="data-[hovered]:shadow-md";var L="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",M="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var he=react.createContext(null);he.displayName="ButtonGroupContext";function ye(){return react.useContext(he)}var De=react.createContext(null);De.displayName="ButtonGroupItemContext";function we(){return react.useContext(De)}classVarianceAuthority.cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}});var Se=classVarianceAuthority.cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}});classVarianceAuthority.cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var A=react.memo(react.forwardRef(({className:e,buttonVisualClassName:t,variant:o,size:a,visualSize:n,fullWidth:s,loading:p=false,loadingText:v="Loading...",shortcut:u,children:y,isDisabled:h,paywall:l=false,paywallRedirect:d,paywallDescription:g,onPress:D,...f},Ie)=>{let ae=react.useId(),V=ye(),oe=we(),Pe=o??V?.variant??"default",Te=a??V?.size,Ce=h??V?.isDisabled??false,ne=V?.orientation==="vertical",ie=s||ne,Ee=oe?Se({orientation:V?.orientation??"horizontal",position:oe.position}):"",z=n??Te??"default";return process.env.NODE_ENV!=="production"&&(z==="dot"||z==="icon")&&!f["aria-label"]&&!y&&console.warn('[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'),jsxRuntime.jsx(reactAriaComponents.Button,{ref:Ie,isDisabled:Ce||p||void 0,"aria-disabled":l?true:void 0,"aria-describedby":l?ae:void 0,onPress:I=>{if(l){d&&window.open(d,"_blank","noopener,noreferrer");return}D?.(I);},className:c(j({fullWidth:ie,inVerticalGroup:ne}),e),...f,children:I=>jsxRuntime.jsxs("span",{className:c(U({variant:Pe,visualSize:z,paywall:l,fullWidth:ie}),Ee,t,q,Z,L,M),"data-pressed":I.isPressed||void 0,children:[p&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"motion-safe:animate-spin","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"sr-only","aria-live":"polite",children:v})]}),!p&&y,l&&jsxRuntime.jsx(lucideReact.Zap,{"data-testid":"zap-icon","aria-hidden":"true",className:"ml-1"}),l&&jsxRuntime.jsxs("span",{id:ae,className:"sr-only",children:["Premium feature: ",g||"Upgrade required to access this feature"]}),I.isFocusVisible&&u&&jsxRuntime.jsx("kbd",{className:"ml-auto hidden text-xs opacity-60 lg:inline",children:u}),I.isPressed&&jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95","aria-hidden":"true"})]})})}));A.displayName="Button";var te=classVarianceAuthority.cva("flex items-center flex-wrap",{variants:{},defaultVariants:{}}),re=classVarianceAuthority.cva("flex flex-wrap items-center gap-1 break-words text-sm text-[var(--menu-muted)]",{variants:{},defaultVariants:{}}),T=classVarianceAuthority.cva("inline-flex items-center gap-1",{variants:{},defaultVariants:{}}),G=classVarianceAuthority.cva("inline-flex items-center gap-2 min-h-[44px] px-2 rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",{variants:{state:{default:["text-[var(--menu-muted)]","hover:text-[var(--content-foreground)]","hover:underline underline-offset-4"].join(" "),current:"text-[var(--content-foreground)] font-medium pointer-events-none",disabled:"text-[var(--menu-muted)] opacity-50 cursor-not-allowed pointer-events-none"}},defaultVariants:{state:"default"}}),R=classVarianceAuthority.cva("text-[var(--menu-muted)]",{variants:{type:{chevron:"[&>svg]:h-4 [&>svg]:w-4",slash:"mx-2",custom:""}},defaultVariants:{type:"chevron"}}),Ne=classVarianceAuthority.cva("inline-flex items-center justify-center min-h-[44px] min-w-[44px] rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 hover:bg-[var(--accent)]",{variants:{},defaultVariants:{}});function Be(e,t){return e===t-1}function tt(e,t,o,a){if(e.length<=t||o+a>=e.length)return null;let n=e.slice(0,o),s=e.slice(-a),p=e.slice(o,e.length-a);return {before:n,collapsed:p,after:s}}function _({separator:e}){return e==="chevron"?jsxRuntime.jsx("li",{role:"presentation","aria-hidden":"true",className:R({type:"chevron"}),children:jsxRuntime.jsx(lucideReact.ChevronRight,{})}):e==="slash"?jsxRuntime.jsx("li",{role:"presentation","aria-hidden":"true",className:R({type:"slash"}),children:"/"}):jsxRuntime.jsx("li",{role:"presentation","aria-hidden":"true",className:R({type:"custom"}),children:e})}function ee({item:e,isCurrent:t,linkComponent:o="a",isGroupDisabled:a}){let n=a||e.isDisabled,s=t?"current":n?"disabled":"default";return t?jsxRuntime.jsxs("span",{className:G({state:"current"}),"aria-current":"page",children:[e.icon&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:e.icon}),e.label]}):e.href?jsxRuntime.jsxs(o,{href:e.href,className:G({state:s}),"aria-disabled":n||void 0,children:[e.icon&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:e.icon}),e.label]}):jsxRuntime.jsxs("span",{className:G({state:n?"disabled":"default"}),"aria-disabled":n||void 0,children:[e.icon&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:e.icon}),e.label]})}function rt({items:e,linkComponent:t="a",isGroupDisabled:o}){return jsxRuntime.jsxs(S,{defaultOpen:false,children:[jsxRuntime.jsx(S.Trigger,{children:jsxRuntime.jsx(A,{variant:"ghost",size:"icon",className:Ne(),"aria-label":"More breadcrumbs",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-4 w-4"})})}),jsxRuntime.jsx(S.Menu,{align:"start",side:"bottom",children:e.map(a=>jsxRuntime.jsx(S.Item,{isDisabled:o||a.isDisabled,children:jsxRuntime.jsxs(t,{href:a.href,className:"flex flex-1 items-center gap-2",children:[a.icon&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:a.icon}),a.label]})},a.id))})]})}var Ve=react.forwardRef(({items:e,separator:t="chevron",maxItems:o=4,itemsBeforeCollapse:a=1,itemsAfterCollapse:n=2,linkComponent:s,isDisabled:p,className:v,"aria-label":u="Breadcrumb",...y},h)=>{if(!e||e.length===0)return null;let l=tt(e,o,a,n);return l?jsxRuntime.jsx("nav",{ref:h,"aria-label":u,className:c(te(),v),...y,children:jsxRuntime.jsxs("ol",{className:re(),children:[l.before.map(d=>jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsx("li",{className:T(),children:jsxRuntime.jsx(ee,{item:d,isCurrent:false,linkComponent:s,isGroupDisabled:p})}),jsxRuntime.jsx(_,{separator:t})]},d.id)),jsxRuntime.jsx("li",{className:T(),children:jsxRuntime.jsx(rt,{items:l.collapsed,linkComponent:s,isGroupDisabled:p})}),jsxRuntime.jsx(_,{separator:t}),l.after.map((d,g)=>{let D=g===l.after.length-1,f=e.length-l.after.length+g;return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsx("li",{className:T(),children:jsxRuntime.jsx(ee,{item:d,isCurrent:Be(f,e.length),linkComponent:s,isGroupDisabled:p})}),!D&&jsxRuntime.jsx(_,{separator:t})]},d.id)})]})}):jsxRuntime.jsx("nav",{ref:h,"aria-label":u,className:c(te(),v),...y,children:jsxRuntime.jsx("ol",{className:re(),children:e.map((d,g)=>jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsx("li",{className:T(),children:jsxRuntime.jsx(ee,{item:d,isCurrent:Be(g,e.length),linkComponent:s,isGroupDisabled:p})}),g<e.length-1&&jsxRuntime.jsx(_,{separator:t})]},d.id))})})});Ve.displayName="Breadcrumbs";exports.BreadcrumbItemDataSchema=pe;exports.Breadcrumbs=Ve;exports.BreadcrumbsPropsSchema=ke;exports.SeparatorTypeSchema=le;exports.breadcrumbItemVariants=T;exports.breadcrumbLinkVariants=G;exports.breadcrumbListVariants=re;exports.breadcrumbsVariants=te;exports.ellipsisButtonVariants=Ne;exports.separatorVariants=R;//# sourceMappingURL=index.js.map
|
|
823
3
|
//# sourceMappingURL=index.js.map
|