@azmr/ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -0
- package/dist/avatar.d.ts +58 -0
- package/dist/avatar.js +84 -0
- package/dist/breadcrumb.d.ts +47 -0
- package/dist/breadcrumb.js +120 -0
- package/dist/button-CYt2Zw3D.d.ts +64 -0
- package/dist/button.d.ts +54 -0
- package/dist/button.js +19 -0
- package/dist/chunk-2RIWL363.js +27 -0
- package/dist/chunk-2TQSHVXA.js +12 -0
- package/dist/chunk-7EOSDFS3.js +10 -0
- package/dist/chunk-C2HKIPLQ.js +118 -0
- package/dist/chunk-CAJLW6K2.js +16 -0
- package/dist/chunk-CZJZYN54.js +36 -0
- package/dist/chunk-EE4V6XMB.js +35 -0
- package/dist/chunk-EFHRRLAW.js +211 -0
- package/dist/chunk-GLB75NT3.js +21 -0
- package/dist/chunk-GX2YEJ43.js +36 -0
- package/dist/chunk-LTOLV67A.js +19 -0
- package/dist/chunk-LZMX27IZ.js +10 -0
- package/dist/chunk-NIIDYIZA.js +1 -0
- package/dist/chunk-Q4PPM2SU.js +97 -0
- package/dist/chunk-WVE2E37B.js +20 -0
- package/dist/chunk-XRZHP6BD.js +92 -0
- package/dist/disclosure.d.ts +72 -0
- package/dist/disclosure.js +221 -0
- package/dist/display.d.ts +111 -0
- package/dist/display.js +237 -0
- package/dist/floating.d.ts +81 -0
- package/dist/floating.js +231 -0
- package/dist/hooks.d.ts +33 -0
- package/dist/hooks.js +55 -0
- package/dist/icons/lucide.d.ts +77 -0
- package/dist/icons/lucide.js +135 -0
- package/dist/icons/mui-map.d.ts +1268 -0
- package/dist/icons/mui-map.js +352 -0
- package/dist/icons.d.ts +48 -0
- package/dist/icons.js +19 -0
- package/dist/index.d.ts +238 -3
- package/dist/index.js +242 -15
- package/dist/input.d.ts +14 -0
- package/dist/input.js +8 -0
- package/dist/layout/mui-map.d.ts +80 -0
- package/dist/layout/mui-map.js +104 -0
- package/dist/layout.d.ts +89 -0
- package/dist/layout.js +455 -0
- package/dist/lib.d.ts +11 -0
- package/dist/lib.js +6 -0
- package/dist/menu.d.ts +105 -0
- package/dist/menu.js +56 -0
- package/dist/modal.d.ts +105 -0
- package/dist/modal.js +273 -0
- package/dist/motion.css +295 -0
- package/dist/pagination.d.ts +82 -0
- package/dist/pagination.js +211 -0
- package/dist/presets.d.ts +97 -0
- package/dist/presets.js +94 -0
- package/dist/progress.d.ts +70 -0
- package/dist/progress.js +138 -0
- package/dist/react.d.ts +81 -0
- package/dist/react.js +281 -0
- package/dist/responsive-YJBnvsjt.d.ts +69 -0
- package/dist/scroll-area.d.ts +30 -0
- package/dist/scroll-area.js +80 -0
- package/dist/shared-Fkx-sjPt.d.ts +15 -0
- package/dist/spinner.d.ts +18 -0
- package/dist/spinner.js +39 -0
- package/dist/split-button.d.ts +32 -0
- package/dist/split-button.js +54 -0
- package/dist/stepper.d.ts +27 -0
- package/dist/stepper.js +104 -0
- package/dist/styles.css +24 -0
- package/dist/table.d.ts +52 -0
- package/dist/table.js +124 -0
- package/dist/theme.d.ts +111 -0
- package/dist/theme.js +414 -0
- package/dist/toast.d.ts +77 -0
- package/dist/toast.js +203 -0
- package/dist/toggle.d.ts +55 -0
- package/dist/toggle.js +88 -0
- package/dist/tokens.css +337 -0
- package/dist/transition.d.ts +51 -0
- package/dist/transition.js +79 -0
- package/dist/types-BBudf463.d.ts +39 -0
- package/dist/typography/mui-map.d.ts +91 -0
- package/dist/typography/mui-map.js +62 -0
- package/dist/typography.d.ts +90 -0
- package/dist/typography.js +193 -0
- package/dist/useSignal-C-3ZGURN.d.ts +21 -0
- package/dist/variants-De0c0ucO.d.ts +60 -0
- package/package.json +167 -12
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-2TQSHVXA.js";
|
|
5
|
+
|
|
6
|
+
// src/icons/registry.ts
|
|
7
|
+
var ICON_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
8
|
+
var registry = /* @__PURE__ */ new Map();
|
|
9
|
+
var warned = /* @__PURE__ */ new Set();
|
|
10
|
+
function isIconComponent(value) {
|
|
11
|
+
return typeof value === "function" || typeof value === "object" && value !== null && "$$typeof" in value;
|
|
12
|
+
}
|
|
13
|
+
function assertIconEntry(name, component) {
|
|
14
|
+
if (!ICON_NAME.test(name)) {
|
|
15
|
+
throw new TypeError(
|
|
16
|
+
`Invalid icon name "${name}": use lower-case kebab-case, e.g. "arrow-right"`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
if (!isIconComponent(component)) {
|
|
20
|
+
throw new TypeError(`Icon "${name}" must be a React component that renders an <svg>`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function registerIcons(icons) {
|
|
24
|
+
const entries = Object.entries(icons);
|
|
25
|
+
for (const [name, component] of entries) assertIconEntry(name, component);
|
|
26
|
+
for (const [name, component] of entries) registry.set(name, component);
|
|
27
|
+
}
|
|
28
|
+
function getIcon(name) {
|
|
29
|
+
return registry.get(name);
|
|
30
|
+
}
|
|
31
|
+
function warnMissingIcon(name) {
|
|
32
|
+
const isProduction = typeof process !== "undefined" && process.env?.NODE_ENV === "production";
|
|
33
|
+
const key = name ?? "(no icon or name)";
|
|
34
|
+
if (isProduction || warned.has(key)) return;
|
|
35
|
+
warned.add(key);
|
|
36
|
+
console.error(
|
|
37
|
+
name === void 0 ? "<Icon> needs an `icon` component or a registered `name`; rendering nothing." : `<Icon name="${name}"> is not registered (see registerIcons); rendering nothing.`
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/icons/icon.tsx
|
|
42
|
+
import { forwardRef } from "react";
|
|
43
|
+
import { jsx } from "react/jsx-runtime";
|
|
44
|
+
var iconSizes = {
|
|
45
|
+
xs: "size-3",
|
|
46
|
+
sm: "size-3.5",
|
|
47
|
+
md: "size-4",
|
|
48
|
+
lg: "size-5",
|
|
49
|
+
xl: "size-6"
|
|
50
|
+
};
|
|
51
|
+
var Icon = forwardRef(function Icon2({
|
|
52
|
+
icon,
|
|
53
|
+
name,
|
|
54
|
+
size = "md",
|
|
55
|
+
spin = false,
|
|
56
|
+
className,
|
|
57
|
+
"aria-label": ariaLabel,
|
|
58
|
+
"aria-labelledby": ariaLabelledBy,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) {
|
|
61
|
+
const resolved = icon ?? (name === void 0 ? void 0 : getIcon(name));
|
|
62
|
+
if (!resolved) {
|
|
63
|
+
warnMissingIcon(name);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const Component = resolved;
|
|
67
|
+
const labelled = Boolean(ariaLabel || ariaLabelledBy);
|
|
68
|
+
const numeric = typeof size === "number";
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Component,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: cn(
|
|
74
|
+
numeric ? void 0 : iconSizes[size],
|
|
75
|
+
"shrink-0",
|
|
76
|
+
spin && "animate-spin",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...numeric ? { width: size, height: size } : {},
|
|
80
|
+
...spin ? { "data-motion": "essential" } : {},
|
|
81
|
+
...labelled ? { role: "img", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy } : { "aria-hidden": true },
|
|
82
|
+
...props
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
assertIconEntry,
|
|
89
|
+
registerIcons,
|
|
90
|
+
warnMissingIcon,
|
|
91
|
+
Icon
|
|
92
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as _base_ui_react_accordion from '@base-ui/react/accordion';
|
|
2
|
+
import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
5
|
+
import * as _base_ui_react_collapsible from '@base-ui/react/collapsible';
|
|
6
|
+
import * as _base_ui_react_tabs from '@base-ui/react/tabs';
|
|
7
|
+
|
|
8
|
+
type WithClassName<T> = Omit<T, "className"> & {
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A set of collapsible sections. One open at a time by default; `multiple` allows several. The
|
|
13
|
+
* keyboard map follows the WAI-ARIA accordion pattern: Tab to a trigger, Enter or Space to
|
|
14
|
+
* toggle, Up and Down to move between triggers, Home and End to jump.
|
|
15
|
+
*/
|
|
16
|
+
declare const Accordion: react.ForwardRefExoticComponent<Omit<Omit<Accordion$1.Root.Props<unknown>, "ref">, "className"> & {
|
|
17
|
+
className?: string;
|
|
18
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_accordion.AccordionItemProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
20
|
+
className?: string;
|
|
21
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
interface AccordionTriggerProps extends WithClassName<ComponentPropsWithoutRef<typeof Accordion$1.Trigger>> {
|
|
23
|
+
/** The heading level wrapping the trigger, to fit the page outline. Default 3. */
|
|
24
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
25
|
+
}
|
|
26
|
+
declare const AccordionTrigger: react.ForwardRefExoticComponent<AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
/** The panel. Its height animates from the measured height with the motion tokens. */
|
|
28
|
+
declare const AccordionContent: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_accordion.AccordionPanelProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
29
|
+
className?: string;
|
|
30
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
|
|
32
|
+
/** One show/hide region. The trigger is a real button with `aria-expanded` and `aria-controls`. */
|
|
33
|
+
declare const Collapsible: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_collapsible.CollapsibleRootProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
34
|
+
className?: string;
|
|
35
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
/** The control that toggles the content. Style it, or render your own element with `render`. */
|
|
37
|
+
declare const CollapsibleTrigger: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_collapsible.CollapsibleTriggerProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
38
|
+
className?: string;
|
|
39
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* The content. Its height animates from the panel's measured height (Base UI measures it and
|
|
42
|
+
* exposes `--collapsible-panel-height`) using the motion tokens, so it is instant under
|
|
43
|
+
* `prefers-reduced-motion`. `className` styles an inner wrapper, so padding never fights the
|
|
44
|
+
* height animation.
|
|
45
|
+
*/
|
|
46
|
+
declare const CollapsibleContent: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_collapsible.CollapsiblePanelProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
47
|
+
className?: string;
|
|
48
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Tabs: a list of tabs and one visible panel each. Horizontal by default, or `orientation="vertical"`.
|
|
52
|
+
* Keyboard: Tab enters the list at the selected tab and then moves on to the panel; the arrow keys
|
|
53
|
+
* (Left and Right, or Up and Down when vertical) move focus between tabs and wrap at the ends;
|
|
54
|
+
* Home and End jump; Enter or Space selects the focused tab. Add `activateOnFocus` to the list to
|
|
55
|
+
* select as you arrow (best when switching is cheap). For a shareable tab, see `useUrlTab`.
|
|
56
|
+
*/
|
|
57
|
+
declare const Tabs: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_tabs.TabsRootProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
58
|
+
className?: string;
|
|
59
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
/** The row (or column) of tabs. Give it an accessible name with `aria-label`. */
|
|
61
|
+
declare const TabsList: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_tabs.TabsListProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
62
|
+
className?: string;
|
|
63
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
declare const TabsTrigger: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_tabs.TabsTabProps, "ref"> & react.RefAttributes<HTMLElement>, "ref">, "className"> & {
|
|
65
|
+
className?: string;
|
|
66
|
+
} & react.RefAttributes<HTMLButtonElement>>;
|
|
67
|
+
/** A panel. It is focusable, so a keyboard user can reach and scroll content that has no controls. */
|
|
68
|
+
declare const TabsContent: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react_tabs.TabsPanelProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
69
|
+
className?: string;
|
|
70
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
71
|
+
|
|
72
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type AccordionTriggerProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Icon
|
|
4
|
+
} from "./chunk-XRZHP6BD.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-2TQSHVXA.js";
|
|
8
|
+
|
|
9
|
+
// src/components/disclosure/accordion.tsx
|
|
10
|
+
import { ChevronDown } from "lucide-react";
|
|
11
|
+
import { createElement, forwardRef } from "react";
|
|
12
|
+
|
|
13
|
+
// src/primitives/accordion.ts
|
|
14
|
+
import { Accordion } from "@base-ui/react/accordion";
|
|
15
|
+
|
|
16
|
+
// src/components/disclosure/accordion.tsx
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var Accordion2 = forwardRef(function Accordion3({ className, onKeyDown, loopFocus = true, orientation, ...props }, ref) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Accordion.Root,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
orientation,
|
|
24
|
+
loopFocus,
|
|
25
|
+
className: cn("w-full", className),
|
|
26
|
+
onKeyDown: (event) => {
|
|
27
|
+
onKeyDown?.(event);
|
|
28
|
+
if (!event.defaultPrevented) moveFocus(event, orientation ?? "vertical", loopFocus);
|
|
29
|
+
},
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
var PREVIOUS = { vertical: "ArrowUp", horizontal: "ArrowLeft" };
|
|
35
|
+
var NEXT = { vertical: "ArrowDown", horizontal: "ArrowRight" };
|
|
36
|
+
function moveFocus(event, orientation, loop) {
|
|
37
|
+
const root = event.currentTarget;
|
|
38
|
+
const target = event.target;
|
|
39
|
+
const ownTriggers = Array.from(
|
|
40
|
+
root.querySelectorAll("button[aria-expanded][data-index]")
|
|
41
|
+
);
|
|
42
|
+
const index = ownTriggers.indexOf(target);
|
|
43
|
+
if (index === -1) return;
|
|
44
|
+
const enabled = ownTriggers.filter(
|
|
45
|
+
(el) => !el.disabled && !el.hasAttribute("data-disabled")
|
|
46
|
+
);
|
|
47
|
+
const position = enabled.indexOf(target);
|
|
48
|
+
let next;
|
|
49
|
+
switch (event.key) {
|
|
50
|
+
case NEXT[orientation]:
|
|
51
|
+
next = enabled[position + 1] ?? (loop ? enabled[0] : void 0);
|
|
52
|
+
break;
|
|
53
|
+
case PREVIOUS[orientation]:
|
|
54
|
+
next = enabled[position - 1] ?? (loop ? enabled[enabled.length - 1] : void 0);
|
|
55
|
+
break;
|
|
56
|
+
case "Home":
|
|
57
|
+
next = enabled[0];
|
|
58
|
+
break;
|
|
59
|
+
case "End":
|
|
60
|
+
next = enabled[enabled.length - 1];
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
next?.focus();
|
|
67
|
+
}
|
|
68
|
+
var AccordionItem = forwardRef(function AccordionItem2({ className, ...props }, ref) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Accordion.Item,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: cn("border-b border-border last:border-b-0", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
var AccordionTrigger = forwardRef(
|
|
79
|
+
function AccordionTrigger2({ headingLevel = 3, className, children, ...props }, ref) {
|
|
80
|
+
return /* @__PURE__ */ jsx(Accordion.Header, { render: createElement(`h${headingLevel}`), className: "flex", children: /* @__PURE__ */ jsxs(
|
|
81
|
+
Accordion.Trigger,
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
className: cn(
|
|
85
|
+
"flex flex-1 items-center justify-between gap-4 rounded-sm py-4 text-left text-sm font-medium outline-none transition-colors duration-(--motion-duration-fast) hover:underline focus-visible:ring-2 focus-visible:ring-ring data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[panel-open]:[&>svg]:rotate-180",
|
|
86
|
+
className
|
|
87
|
+
),
|
|
88
|
+
...props,
|
|
89
|
+
children: [
|
|
90
|
+
children,
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Icon,
|
|
93
|
+
{
|
|
94
|
+
icon: ChevronDown,
|
|
95
|
+
className: "transition-transform duration-(--motion-duration-fast) ease-standard"
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) });
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
var AccordionContent = forwardRef(function AccordionContent2({ className, children, ...props }, ref) {
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Accordion.Panel,
|
|
106
|
+
{
|
|
107
|
+
ref,
|
|
108
|
+
className: "h-(--accordion-panel-height) overflow-hidden text-sm transition-[height] duration-(--motion-duration-base) ease-standard data-[ending-style]:h-0 data-[starting-style]:h-0",
|
|
109
|
+
...props,
|
|
110
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("pb-4", className), children })
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// src/components/disclosure/collapsible.tsx
|
|
116
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
117
|
+
|
|
118
|
+
// src/primitives/collapsible.ts
|
|
119
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
120
|
+
|
|
121
|
+
// src/components/disclosure/collapsible.tsx
|
|
122
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
123
|
+
var Collapsible2 = forwardRef2(function Collapsible3({ className, ...props }, ref) {
|
|
124
|
+
return /* @__PURE__ */ jsx2(Collapsible.Root, { ref, className: cn("w-full", className), ...props });
|
|
125
|
+
});
|
|
126
|
+
var CollapsibleTrigger = forwardRef2(function CollapsibleTrigger2({ className, ...props }, ref) {
|
|
127
|
+
return /* @__PURE__ */ jsx2(
|
|
128
|
+
Collapsible.Trigger,
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
className: cn(
|
|
132
|
+
"rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
...props
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
var CollapsibleContent = forwardRef2(function CollapsibleContent2({ className, children, ...props }, ref) {
|
|
140
|
+
return /* @__PURE__ */ jsx2(
|
|
141
|
+
Collapsible.Panel,
|
|
142
|
+
{
|
|
143
|
+
ref,
|
|
144
|
+
className: "h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-(--motion-duration-base) ease-standard data-[ending-style]:h-0 data-[starting-style]:h-0",
|
|
145
|
+
...props,
|
|
146
|
+
children: /* @__PURE__ */ jsx2("div", { className, children })
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// src/components/disclosure/tabs.tsx
|
|
152
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
153
|
+
|
|
154
|
+
// src/primitives/tabs.ts
|
|
155
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
156
|
+
|
|
157
|
+
// src/components/disclosure/tabs.tsx
|
|
158
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
159
|
+
var Tabs2 = forwardRef3(function Tabs3({ className, ...props }, ref) {
|
|
160
|
+
return /* @__PURE__ */ jsx3(
|
|
161
|
+
Tabs.Root,
|
|
162
|
+
{
|
|
163
|
+
ref,
|
|
164
|
+
className: cn("flex flex-col gap-2 data-[orientation=vertical]:flex-row", className),
|
|
165
|
+
...props
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
var TabsList = forwardRef3(function TabsList2({ className, ...props }, ref) {
|
|
170
|
+
return /* @__PURE__ */ jsx3(
|
|
171
|
+
Tabs.List,
|
|
172
|
+
{
|
|
173
|
+
ref,
|
|
174
|
+
className: cn(
|
|
175
|
+
"inline-flex items-center rounded-md bg-muted p-1 text-muted-foreground data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
176
|
+
className
|
|
177
|
+
),
|
|
178
|
+
...props
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
var TabsTrigger = forwardRef3(function TabsTrigger2({ className, ...props }, ref) {
|
|
183
|
+
return /* @__PURE__ */ jsx3(
|
|
184
|
+
Tabs.Tab,
|
|
185
|
+
{
|
|
186
|
+
ref,
|
|
187
|
+
className: cn(
|
|
188
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium outline-none transition-colors duration-(--motion-duration-fast) focus-visible:ring-2 focus-visible:ring-ring data-[active]:bg-background data-[active]:text-foreground data-[active]:shadow-elevation-1 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
189
|
+
className
|
|
190
|
+
),
|
|
191
|
+
...props
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
var TabsContent = forwardRef3(function TabsContent2({ className, ...props }, ref) {
|
|
196
|
+
return /* @__PURE__ */ jsx3(
|
|
197
|
+
Tabs.Panel,
|
|
198
|
+
{
|
|
199
|
+
ref,
|
|
200
|
+
tabIndex: 0,
|
|
201
|
+
className: cn(
|
|
202
|
+
"rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
203
|
+
className
|
|
204
|
+
),
|
|
205
|
+
...props
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
});
|
|
209
|
+
export {
|
|
210
|
+
Accordion2 as Accordion,
|
|
211
|
+
AccordionContent,
|
|
212
|
+
AccordionItem,
|
|
213
|
+
AccordionTrigger,
|
|
214
|
+
Collapsible2 as Collapsible,
|
|
215
|
+
CollapsibleContent,
|
|
216
|
+
CollapsibleTrigger,
|
|
217
|
+
Tabs2 as Tabs,
|
|
218
|
+
TabsContent,
|
|
219
|
+
TabsList,
|
|
220
|
+
TabsTrigger
|
|
221
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const STATUS: {
|
|
7
|
+
readonly info: {
|
|
8
|
+
readonly token: "info";
|
|
9
|
+
readonly textToken: "info";
|
|
10
|
+
readonly alert: "border-info/30 bg-info/10";
|
|
11
|
+
readonly badge: "border-transparent bg-info/15 text-info";
|
|
12
|
+
readonly icon: "text-info";
|
|
13
|
+
};
|
|
14
|
+
readonly success: {
|
|
15
|
+
readonly token: "success";
|
|
16
|
+
readonly textToken: "success";
|
|
17
|
+
readonly alert: "border-success/30 bg-success/10";
|
|
18
|
+
readonly badge: "border-transparent bg-success/15 text-success";
|
|
19
|
+
readonly icon: "text-success";
|
|
20
|
+
};
|
|
21
|
+
readonly warning: {
|
|
22
|
+
readonly token: "warning";
|
|
23
|
+
readonly textToken: "warning-text";
|
|
24
|
+
readonly alert: "border-warning/40 bg-warning/10";
|
|
25
|
+
readonly badge: "border-transparent bg-warning/15 text-warning-text";
|
|
26
|
+
readonly icon: "text-warning-text";
|
|
27
|
+
};
|
|
28
|
+
readonly destructive: {
|
|
29
|
+
readonly token: "destructive";
|
|
30
|
+
readonly textToken: "destructive";
|
|
31
|
+
readonly alert: "border-destructive/30 bg-destructive/10";
|
|
32
|
+
readonly badge: "border-transparent bg-destructive/10 text-destructive";
|
|
33
|
+
readonly icon: "text-destructive";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type StatusVariant = keyof typeof STATUS;
|
|
37
|
+
|
|
38
|
+
interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
39
|
+
variant?: StatusVariant;
|
|
40
|
+
/** Replaces the default icon; `null` removes it. */
|
|
41
|
+
icon?: ReactNode;
|
|
42
|
+
/** Adds a dismiss button that calls this. The Alert does not hide itself: you own that state. */
|
|
43
|
+
onDismiss?: () => void;
|
|
44
|
+
/** The accessible name of the dismiss button. Default "Dismiss". */
|
|
45
|
+
dismissLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A status message. Problems (`warning`, `destructive`) are announced assertively with
|
|
49
|
+
* `role="alert"`; `info` and `success` politely with `role="status"`. Server-safe: the dismiss
|
|
50
|
+
* handler works when the Alert is rendered from a Client Component.
|
|
51
|
+
*/
|
|
52
|
+
declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
declare const AlertTitle: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare const AlertDescription: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
|
|
56
|
+
declare const badgeVariants: (props?: ({
|
|
57
|
+
variant?: "info" | "success" | "warning" | "destructive" | "default" | "secondary" | "outline" | null | undefined;
|
|
58
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
59
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
60
|
+
}
|
|
61
|
+
/** A small label for status or a count. Server-safe. */
|
|
62
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
63
|
+
|
|
64
|
+
type DivProps = HTMLAttributes<HTMLDivElement>;
|
|
65
|
+
/** A bordered surface for grouped content. Server-safe. */
|
|
66
|
+
declare const Card: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
declare const CardHeader: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
69
|
+
/** The heading level to render. Default `h3`; pick the one that fits the page outline. */
|
|
70
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "p";
|
|
71
|
+
}
|
|
72
|
+
declare const CardTitle: react.ForwardRefExoticComponent<CardTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
73
|
+
declare const CardDescription: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
declare const CardContent: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
declare const CardFooter: react.ForwardRefExoticComponent<DivProps & react.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
|
|
77
|
+
interface ChipProps extends BadgeProps {
|
|
78
|
+
/** Adds a remove button that calls this. The Chip does not hide itself: you own that state. */
|
|
79
|
+
onRemove?: () => void;
|
|
80
|
+
/** The accessible name of the remove button. Default `Remove <label>` for text labels. */
|
|
81
|
+
removeLabel?: string;
|
|
82
|
+
}
|
|
83
|
+
/** A Badge that can be removed, such as a selected filter or a tag. Server-safe. */
|
|
84
|
+
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
85
|
+
|
|
86
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
87
|
+
title: ReactNode;
|
|
88
|
+
description?: ReactNode;
|
|
89
|
+
/** A decorative icon or illustration above the title. */
|
|
90
|
+
icon?: ReactNode;
|
|
91
|
+
/** What the user can do about it, usually a Button. */
|
|
92
|
+
action?: ReactNode;
|
|
93
|
+
/** The heading level of the title, to fit the page outline. Default 3. */
|
|
94
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
95
|
+
}
|
|
96
|
+
/** What to show when there is nothing to show yet, with a way forward. Server-safe. */
|
|
97
|
+
declare const EmptyState: react.ForwardRefExoticComponent<EmptyStateProps & react.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
|
|
99
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
100
|
+
/** Pulse while loading. Default true; the global reduced-motion rule stills it for users who ask. */
|
|
101
|
+
animate?: boolean;
|
|
102
|
+
/** Sweep a highlight across (needs `@azmr/ui/styles.css`) instead of pulsing. Stops with reduced motion. */
|
|
103
|
+
shimmer?: boolean;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* A placeholder shaped like content that is loading. Decorative (`aria-hidden`): mark the loading
|
|
107
|
+
* container `aria-busy` and announce the result instead. Server-safe.
|
|
108
|
+
*/
|
|
109
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
|
|
111
|
+
export { Alert, AlertDescription, type AlertProps, AlertTitle, Badge, type BadgeProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, Chip, type ChipProps, EmptyState, type EmptyStateProps, Skeleton, type SkeletonProps, type StatusVariant, badgeVariants };
|