@cytario/design 0.0.0-development
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/LICENSE +191 -0
- package/README.md +143 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +9 -0
- package/dist/components/Breadcrumbs/index.d.ts +3 -0
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/index.js +1 -0
- package/dist/components/Button/Button.d.ts +18 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +51 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/ButtonLink/ButtonLink.d.ts +35 -0
- package/dist/components/ButtonLink/ButtonLink.d.ts.map +1 -0
- package/dist/components/ButtonLink/ButtonLink.js +47 -0
- package/dist/components/ButtonLink/index.d.ts +3 -0
- package/dist/components/ButtonLink/index.d.ts.map +1 -0
- package/dist/components/ButtonLink/index.js +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +19 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/Dialog/Dialog.d.ts +11 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +31 -0
- package/dist/components/Dialog/index.d.ts +3 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +11 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState/EmptyState.js +10 -0
- package/dist/components/EmptyState/index.d.ts +3 -0
- package/dist/components/EmptyState/index.d.ts.map +1 -0
- package/dist/components/EmptyState/index.js +1 -0
- package/dist/components/Field/Field.d.ts +13 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/Field.js +15 -0
- package/dist/components/Field/index.d.ts +3 -0
- package/dist/components/Field/index.d.ts.map +1 -0
- package/dist/components/Field/index.js +1 -0
- package/dist/components/Fieldset/Fieldset.d.ts +8 -0
- package/dist/components/Fieldset/Fieldset.d.ts.map +1 -0
- package/dist/components/Fieldset/Fieldset.js +15 -0
- package/dist/components/Fieldset/index.d.ts +3 -0
- package/dist/components/Fieldset/index.d.ts.map +1 -0
- package/dist/components/Fieldset/index.js +1 -0
- package/dist/components/Heading/Heading.d.ts +19 -0
- package/dist/components/Heading/Heading.d.ts.map +1 -0
- package/dist/components/Heading/Heading.js +39 -0
- package/dist/components/Heading/index.d.ts +3 -0
- package/dist/components/Heading/index.d.ts.map +1 -0
- package/dist/components/Heading/index.js +1 -0
- package/dist/components/Icon/Icon.d.ts +15 -0
- package/dist/components/Icon/Icon.d.ts.map +1 -0
- package/dist/components/Icon/Icon.js +11 -0
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Icon/index.d.ts.map +1 -0
- package/dist/components/Icon/index.js +1 -0
- package/dist/components/IconButton/IconButton.d.ts +23 -0
- package/dist/components/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.js +59 -0
- package/dist/components/IconButton/index.d.ts +3 -0
- package/dist/components/IconButton/index.d.ts.map +1 -0
- package/dist/components/IconButton/index.js +1 -0
- package/dist/components/Input/Input.d.ts +23 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/Input.js +97 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/InputAddon/InputAddon.d.ts +7 -0
- package/dist/components/InputAddon/InputAddon.d.ts.map +1 -0
- package/dist/components/InputAddon/InputAddon.js +35 -0
- package/dist/components/InputAddon/index.d.ts +3 -0
- package/dist/components/InputAddon/index.d.ts.map +1 -0
- package/dist/components/InputAddon/index.js +1 -0
- package/dist/components/InputGroup/InputGroup.d.ts +7 -0
- package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/InputGroup/InputGroup.js +16 -0
- package/dist/components/InputGroup/InputGroupContext.d.ts +9 -0
- package/dist/components/InputGroup/InputGroupContext.d.ts.map +1 -0
- package/dist/components/InputGroup/InputGroupContext.js +8 -0
- package/dist/components/InputGroup/index.d.ts +5 -0
- package/dist/components/InputGroup/index.d.ts.map +1 -0
- package/dist/components/InputGroup/index.js +2 -0
- package/dist/components/Label/Label.d.ts +7 -0
- package/dist/components/Label/Label.d.ts.map +1 -0
- package/dist/components/Label/Label.js +12 -0
- package/dist/components/Label/index.d.ts +3 -0
- package/dist/components/Label/index.d.ts.map +1 -0
- package/dist/components/Label/index.js +1 -0
- package/dist/components/Link/Link.d.ts +10 -0
- package/dist/components/Link/Link.d.ts.map +1 -0
- package/dist/components/Link/Link.js +22 -0
- package/dist/components/Link/index.d.ts +3 -0
- package/dist/components/Link/index.d.ts.map +1 -0
- package/dist/components/Link/index.js +1 -0
- package/dist/components/Menu/Menu.d.ts +24 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/Menu.js +29 -0
- package/dist/components/Menu/index.d.ts +3 -0
- package/dist/components/Menu/index.d.ts.map +1 -0
- package/dist/components/Menu/index.js +1 -0
- package/dist/components/Radio/Radio.d.ts +18 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -0
- package/dist/components/Radio/Radio.js +43 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/Select/Select.d.ts +17 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/Select.js +42 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Spinner/Spinner.d.ts +10 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +12 -0
- package/dist/components/Spinner/index.d.ts +3 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Spinner/index.js +1 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +25 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Switch/index.js +1 -0
- package/dist/components/Table/Table.d.ts +13 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +61 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/index.js +1 -0
- package/dist/components/Tabs/Tabs.d.ts +32 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +100 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +1 -0
- package/dist/components/Toast/Toast.d.ts +33 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +102 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +1 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +13 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts.map +1 -0
- package/dist/components/ToggleButton/ToggleButton.js +42 -0
- package/dist/components/ToggleButton/index.d.ts +3 -0
- package/dist/components/ToggleButton/index.d.ts.map +1 -0
- package/dist/components/ToggleButton/index.js +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +20 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/_shared/styles.d.ts +5 -0
- package/dist/components/_shared/styles.d.ts.map +1 -0
- package/dist/components/_shared/styles.js +43 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +1 -0
- package/dist/tokens/tokens.d.ts +144 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/tokens.js +143 -0
- package/package.json +85 -0
- package/src/styles/global.css +38 -0
- package/src/styles/tailwind.css +78 -0
- package/src/tokens/variables.css +148 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { InputGroupContext } from "./InputGroupContext";
|
|
4
|
+
export function InputGroup({ children, className }) {
|
|
5
|
+
const childArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
6
|
+
return (_jsx("div", { className: ["flex items-stretch", className].filter(Boolean).join(" "), children: childArray.map((child, index) => {
|
|
7
|
+
const position = childArray.length === 1
|
|
8
|
+
? "standalone"
|
|
9
|
+
: index === 0
|
|
10
|
+
? "start"
|
|
11
|
+
: index === childArray.length - 1
|
|
12
|
+
? "end"
|
|
13
|
+
: "middle";
|
|
14
|
+
return (_jsx(InputGroupContext.Provider, { value: { inGroup: true, position }, children: child }, index));
|
|
15
|
+
}) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type GroupPosition = "start" | "middle" | "end" | "standalone";
|
|
2
|
+
interface InputGroupContextValue {
|
|
3
|
+
inGroup: boolean;
|
|
4
|
+
position: GroupPosition;
|
|
5
|
+
}
|
|
6
|
+
export declare const InputGroupContext: import("react").Context<InputGroupContextValue>;
|
|
7
|
+
export declare function useInputGroup(): InputGroupContextValue;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=InputGroupContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroupContext.d.ts","sourceRoot":"","sources":["../../../src/components/InputGroup/InputGroupContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC;AAEtE,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,iDAG5B,CAAC;AAEH,wBAAgB,aAAa,2BAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InputGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LabelProps as AriaLabelProps } from "react-aria-components";
|
|
2
|
+
export interface LabelProps extends Omit<AriaLabelProps, "className"> {
|
|
3
|
+
isRequired?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Label({ isRequired, children, className, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,IAAI,cAAc,EAClC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAwB9E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Label as AriaLabel, } from "react-aria-components";
|
|
3
|
+
export function Label({ isRequired, children, className, ...props }) {
|
|
4
|
+
return (_jsxs(AriaLabel, { ...props, className: [
|
|
5
|
+
"text-[length:var(--font-size-sm)]",
|
|
6
|
+
"font-[number:var(--font-weight-medium)]",
|
|
7
|
+
"text-[var(--color-text-primary)]",
|
|
8
|
+
className,
|
|
9
|
+
]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(" "), children: [children, isRequired && (_jsx("span", { "aria-hidden": "true", className: "ml-0.5 text-[var(--color-text-danger)]", children: "*" }))] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Label/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label } from "./Label";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LinkProps as AriaLinkProps } from "react-aria-components";
|
|
2
|
+
export type LinkVariant = "default" | "subtle";
|
|
3
|
+
export interface LinkProps extends Omit<AriaLinkProps, "className"> {
|
|
4
|
+
/** Visual style variant */
|
|
5
|
+
variant?: LinkVariant;
|
|
6
|
+
/** Additional CSS classes */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Link({ variant, className, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,IAAI,aAAa,EAChC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE/C,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;IACjE,2BAA2B;IAC3B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD,wBAAgB,IAAI,CAAC,EACnB,OAAmB,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,2CAcX"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Link as AriaLink, } from "react-aria-components";
|
|
3
|
+
const variantStyles = {
|
|
4
|
+
default: [
|
|
5
|
+
"text-[var(--color-teal-700)] underline",
|
|
6
|
+
"hover:text-[var(--color-teal-800)]",
|
|
7
|
+
].join(" "),
|
|
8
|
+
subtle: [
|
|
9
|
+
"text-[var(--color-text-secondary)] no-underline",
|
|
10
|
+
"hover:underline hover:text-[var(--color-text-primary)]",
|
|
11
|
+
].join(" "),
|
|
12
|
+
};
|
|
13
|
+
export function Link({ variant = "default", className, ...props }) {
|
|
14
|
+
return (_jsx(AriaLink, { ...props, className: [
|
|
15
|
+
"outline-none transition-colors",
|
|
16
|
+
"focus-visible:ring-2 focus-visible:ring-[var(--color-border-focus)] focus-visible:ring-offset-2 focus-visible:rounded-sm",
|
|
17
|
+
variantStyles[variant],
|
|
18
|
+
className,
|
|
19
|
+
]
|
|
20
|
+
.filter(Boolean)
|
|
21
|
+
.join(" ") }));
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from "./Link";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { LucideIcon } from "lucide-react";
|
|
3
|
+
export interface MenuItemData {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: LucideIcon;
|
|
7
|
+
onAction?: () => void;
|
|
8
|
+
/** When set, renders the menu item as a navigational link */
|
|
9
|
+
href?: string;
|
|
10
|
+
/** Link target, e.g. "_blank" for external links */
|
|
11
|
+
target?: string;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isDanger?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MenuProps {
|
|
16
|
+
/** Items to render in the menu */
|
|
17
|
+
items: MenuItemData[];
|
|
18
|
+
/** Trigger element (typically a Button or IconButton) */
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
/** Additional CSS classes for the menu popover */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function Menu({ items, children, className }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS/C,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,kCAAkC;IAClC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,yDAAyD;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,SAAS,2CAmD7D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MenuTrigger, Menu as AriaMenu, MenuItem as AriaMenuItem, Popover, } from "react-aria-components";
|
|
3
|
+
import { Icon } from "../Icon";
|
|
4
|
+
export function Menu({ items, children, className }) {
|
|
5
|
+
return (_jsxs(MenuTrigger, { children: [children, _jsx(Popover, { className: [
|
|
6
|
+
"bg-[var(--color-surface-primary)] rounded-[var(--border-radius-md)]",
|
|
7
|
+
"shadow-lg border border-[var(--color-border-default)]",
|
|
8
|
+
"py-1 min-w-48",
|
|
9
|
+
"entering:animate-in entering:fade-in entering:zoom-in-95",
|
|
10
|
+
"exiting:animate-out exiting:fade-out exiting:zoom-out-95",
|
|
11
|
+
className,
|
|
12
|
+
]
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
.join(" "), children: _jsx(AriaMenu, { items: items, onAction: (key) => {
|
|
15
|
+
const item = items.find((i) => i.id === key);
|
|
16
|
+
item?.onAction?.();
|
|
17
|
+
}, className: "outline-none", children: (item) => (_jsxs(AriaMenuItem, { id: item.id, href: item.href, target: item.target, isDisabled: item.isDisabled, className: [
|
|
18
|
+
"flex items-center gap-2 px-3 py-2 text-sm outline-none cursor-default",
|
|
19
|
+
"transition-colors",
|
|
20
|
+
"focus:bg-[var(--color-neutral-100)]",
|
|
21
|
+
"hover:bg-[var(--color-neutral-100)]",
|
|
22
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
23
|
+
item.isDanger
|
|
24
|
+
? "text-[var(--color-text-danger)]"
|
|
25
|
+
: "text-[var(--color-text-primary)]",
|
|
26
|
+
]
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.join(" "), children: [item.icon && _jsx(Icon, { icon: item.icon, size: "sm" }), item.label] })) }) })] }));
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Menu } from "./Menu";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type RadioGroupProps as AriaRadioGroupProps, type RadioProps as AriaRadioProps } from "react-aria-components";
|
|
3
|
+
export interface RadioGroupProps extends Omit<AriaRadioGroupProps, "children" | "className"> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RadioProps extends Omit<AriaRadioProps, "children" | "className"> {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RadioButtonProps extends Omit<AriaRadioProps, "children" | "className"> {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function RadioGroup({ children, className, ...props }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Radio({ children, className, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function RadioButton({ children, className, ...props }: RadioButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,KAAK,eAAe,IAAI,mBAAmB,EAC3C,KAAK,UAAU,IAAI,cAAc,EAClC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,WAAW,CAAC;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,CAAC;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,WAAW,CAAC;IACtD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAe5E;AAED,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAiClE;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CA4B9E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RadioGroup as AriaRadioGroup, Radio as AriaRadio, } from "react-aria-components";
|
|
3
|
+
export function RadioGroup({ children, className, ...props }) {
|
|
4
|
+
return (_jsx(AriaRadioGroup, { ...props, className: [
|
|
5
|
+
"flex flex-col gap-2",
|
|
6
|
+
"disabled:opacity-50",
|
|
7
|
+
className,
|
|
8
|
+
]
|
|
9
|
+
.filter(Boolean)
|
|
10
|
+
.join(" "), children: children }));
|
|
11
|
+
}
|
|
12
|
+
export function Radio({ children, className, ...props }) {
|
|
13
|
+
return (_jsx(AriaRadio, { ...props, className: [
|
|
14
|
+
"group flex items-center gap-2 text-[length:var(--font-size-sm)] text-[var(--color-text-primary)] cursor-pointer",
|
|
15
|
+
"disabled:opacity-50 disabled:cursor-default",
|
|
16
|
+
className,
|
|
17
|
+
]
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
.join(" "), children: ({ isSelected }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: [
|
|
20
|
+
"flex items-center justify-center w-5 h-5 shrink-0",
|
|
21
|
+
"rounded-full border-2 transition-colors",
|
|
22
|
+
"group-focus-visible:ring-2 group-focus-visible:ring-[var(--color-border-focus)] group-focus-visible:ring-offset-2",
|
|
23
|
+
isSelected
|
|
24
|
+
? "border-[var(--color-action-primary)]"
|
|
25
|
+
: "border-[var(--color-border-default)] group-hover:border-[var(--color-border-strong)]",
|
|
26
|
+
].join(" "), children: isSelected && (_jsx("div", { className: "w-2.5 h-2.5 rounded-full bg-[var(--color-action-primary)]" })) }), children && _jsx("span", { children: children })] })) }));
|
|
27
|
+
}
|
|
28
|
+
export function RadioButton({ children, className, ...props }) {
|
|
29
|
+
return (_jsx(AriaRadio, { ...props, className: [
|
|
30
|
+
"group cursor-pointer",
|
|
31
|
+
"disabled:opacity-50 disabled:cursor-default",
|
|
32
|
+
className,
|
|
33
|
+
]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join(" "), children: ({ isSelected }) => (_jsx("div", { className: [
|
|
36
|
+
"px-4 py-2 text-[length:var(--font-size-sm)] font-[number:var(--font-weight-medium)]",
|
|
37
|
+
"rounded-[var(--border-radius-md)] border transition-colors text-center",
|
|
38
|
+
"group-focus-visible:ring-2 group-focus-visible:ring-[var(--color-border-focus)] group-focus-visible:ring-offset-2",
|
|
39
|
+
isSelected
|
|
40
|
+
? "bg-[var(--color-action-primary)] border-[var(--color-action-primary)] text-[var(--color-text-inverse)]"
|
|
41
|
+
: "bg-[var(--color-surface-default)] border-[var(--color-border-default)] text-[var(--color-text-primary)] hover:border-[var(--color-border-strong)]",
|
|
42
|
+
].join(" "), children: children })) }));
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioGroup, Radio, RadioButton } from "./Radio";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SelectProps as AriaSelectProps } from "react-aria-components";
|
|
2
|
+
export interface SelectItem {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SelectProps extends Omit<AriaSelectProps<SelectItem>, "children"> {
|
|
7
|
+
/** Label displayed above the trigger (always visible) */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Options to display in the dropdown */
|
|
10
|
+
items: SelectItem[];
|
|
11
|
+
/** Placeholder text when no item is selected */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** Error message displayed below the trigger */
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function Select({ label, items, placeholder, errorMessage, isDisabled, isRequired, className, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,WAAW,IAAI,eAAe,EAEpC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACrD,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoCD,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,KAAK,EACL,WAAgC,EAChC,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,2CA4Fb"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Label, ListBox, ListBoxItem, Popover, Select as AriaSelect, SelectValue, } from "react-aria-components";
|
|
3
|
+
function ChevronDown() {
|
|
4
|
+
return (_jsx("svg", { "aria-hidden": "true", className: "h-4 w-4 text-[var(--color-text-secondary)]", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M4 6l4 4 4-4" }) }));
|
|
5
|
+
}
|
|
6
|
+
function CheckIcon() {
|
|
7
|
+
return (_jsx("svg", { "aria-hidden": "true", className: "h-4 w-4 text-[var(--color-action-primary)]", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M3 8.5l3.5 3.5 6.5-7" }) }));
|
|
8
|
+
}
|
|
9
|
+
export function Select({ label, items, placeholder = "Select an option", errorMessage, isDisabled, isRequired, className, ...props }) {
|
|
10
|
+
const hasError = Boolean(errorMessage);
|
|
11
|
+
return (_jsxs(AriaSelect, { ...props, isDisabled: isDisabled, isRequired: isRequired, isInvalid: hasError, className: ["flex flex-col gap-1", className].filter(Boolean).join(" "), children: [_jsxs(Label, { className: [
|
|
12
|
+
"text-sm font-[var(--font-weight-medium)] text-[var(--color-text-primary)]",
|
|
13
|
+
].join(" "), children: [label, isRequired && (_jsx("span", { "aria-hidden": "true", className: "ml-0.5 text-[var(--color-text-danger)]", children: "*" }))] }), _jsxs(Button, { className: [
|
|
14
|
+
"inline-flex items-center justify-between",
|
|
15
|
+
"w-full rounded-[var(--border-radius-md)] px-4 py-2",
|
|
16
|
+
"text-base text-left",
|
|
17
|
+
"border outline-none transition-colors",
|
|
18
|
+
hasError
|
|
19
|
+
? "border-[var(--color-border-danger)]"
|
|
20
|
+
: "border-[var(--color-border-default)]",
|
|
21
|
+
"focus-visible:ring-2 focus-visible:ring-[var(--color-border-focus)] focus-visible:ring-offset-2",
|
|
22
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
23
|
+
"bg-[var(--color-surface-default)]",
|
|
24
|
+
].join(" "), children: [_jsx(SelectValue, { className: "truncate data-[placeholder]:text-[var(--color-text-tertiary)]", children: ({ selectedText }) => selectedText || placeholder }), _jsx(ChevronDown, {})] }), hasError && (_jsx("span", { className: "text-sm text-[var(--color-text-danger)]", children: errorMessage })), _jsx(Popover, { className: [
|
|
25
|
+
"w-[var(--trigger-width)]",
|
|
26
|
+
"rounded-[var(--border-radius-md)]",
|
|
27
|
+
"border border-[var(--color-border-default)]",
|
|
28
|
+
"bg-[var(--color-surface-default)]",
|
|
29
|
+
"shadow-lg",
|
|
30
|
+
"overflow-auto",
|
|
31
|
+
"entering:animate-in entering:fade-in entering:slide-in-from-top-1",
|
|
32
|
+
"exiting:animate-out exiting:fade-out exiting:slide-out-to-top-1",
|
|
33
|
+
].join(" "), children: _jsx(ListBox, { className: "p-1 outline-none", items: items, children: (item) => (_jsx(ListBoxItem, { id: item.id, textValue: item.name, className: [
|
|
34
|
+
"flex items-center justify-between gap-2",
|
|
35
|
+
"px-4 py-2 rounded-[var(--border-radius-sm)]",
|
|
36
|
+
"text-base text-[var(--color-text-primary)]",
|
|
37
|
+
"cursor-pointer outline-none",
|
|
38
|
+
"hover:bg-[var(--color-surface-muted)]",
|
|
39
|
+
"focus:bg-[var(--color-surface-muted)]",
|
|
40
|
+
"selected:text-[var(--color-action-primary)] selected:font-[var(--font-weight-medium)]",
|
|
41
|
+
].join(" "), children: ({ isSelected }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: "truncate", children: item.name }), isSelected && _jsx(CheckIcon, {})] })) })) }) })] }));
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Select } from "./Select";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SpinnerProps {
|
|
2
|
+
/** Size preset */
|
|
3
|
+
size?: "sm" | "md" | "lg";
|
|
4
|
+
/** Accessible label — when provided, the spinner is announced to screen readers */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/** Additional CSS classes */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Spinner({ size, "aria-label": ariaLabel, className, }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,kBAAkB;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,wBAAgB,OAAO,CAAC,EACtB,IAAW,EACX,YAAY,EAAE,SAAS,EACvB,SAAS,GACV,EAAE,YAAY,2CA6Bd"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const sizeMap = {
|
|
3
|
+
sm: "h-4 w-4",
|
|
4
|
+
md: "h-5 w-5",
|
|
5
|
+
lg: "h-6 w-6",
|
|
6
|
+
};
|
|
7
|
+
export function Spinner({ size = "md", "aria-label": ariaLabel, className, }) {
|
|
8
|
+
const isDecorative = !ariaLabel;
|
|
9
|
+
return (_jsxs("svg", { role: isDecorative ? undefined : "status", "aria-label": ariaLabel, "aria-hidden": isDecorative ? "true" : undefined, className: [sizeMap[size], "animate-spin", className]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(" "), viewBox: "0 0 24 24", fill: "none", children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spinner } from "./Spinner";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type SwitchProps as AriaSwitchProps } from "react-aria-components";
|
|
3
|
+
export interface SwitchProps extends Omit<AriaSwitchProps, "children" | "className"> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
color?: "primary" | "success" | "destructive";
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Switch({ children, color, className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,WAAW,IAAI,eAAe,EACpC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,WAAW,CAAC;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,KAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,2CAmCb"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as AriaSwitch, } from "react-aria-components";
|
|
3
|
+
const trackColorMap = {
|
|
4
|
+
primary: "bg-[var(--color-action-primary)]",
|
|
5
|
+
success: "bg-[var(--color-action-success)]",
|
|
6
|
+
destructive: "bg-[var(--color-action-danger)]",
|
|
7
|
+
};
|
|
8
|
+
export function Switch({ children, color = "primary", className, ...props }) {
|
|
9
|
+
return (_jsx(AriaSwitch, { ...props, className: [
|
|
10
|
+
"group flex items-center gap-2 text-[length:var(--font-size-sm)] text-[var(--color-text-primary)] cursor-pointer",
|
|
11
|
+
"disabled:opacity-50 disabled:cursor-default",
|
|
12
|
+
className,
|
|
13
|
+
]
|
|
14
|
+
.filter(Boolean)
|
|
15
|
+
.join(" "), children: ({ isSelected }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: [
|
|
16
|
+
"w-9 h-5 rounded-full transition-colors shrink-0 p-0.5",
|
|
17
|
+
"group-focus-visible:ring-2 group-focus-visible:ring-[var(--color-border-focus)] group-focus-visible:ring-offset-2",
|
|
18
|
+
isSelected
|
|
19
|
+
? trackColorMap[color]
|
|
20
|
+
: "bg-[var(--color-border-strong)]",
|
|
21
|
+
].join(" "), children: _jsx("div", { className: [
|
|
22
|
+
"w-4 h-4 rounded-full bg-[var(--color-surface-default)] transition-transform shadow-sm",
|
|
23
|
+
isSelected ? "translate-x-4" : "translate-x-0",
|
|
24
|
+
].join(" ") }) }), children && _jsx("span", { children: children })] })) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from "./Switch";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CellProps, type ColumnProps, type RowProps, type TableBodyProps, type TableHeaderProps, type TableProps } from "react-aria-components";
|
|
2
|
+
export type TableSize = "compact" | "comfortable";
|
|
3
|
+
export interface DataTableProps extends TableProps {
|
|
4
|
+
/** Row density */
|
|
5
|
+
size?: TableSize;
|
|
6
|
+
}
|
|
7
|
+
export declare function Table({ size, className, ...props }: DataTableProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableHeader<T extends object>(props: TableHeaderProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function Column(props: ColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function TableBody<T extends object>(props: TableBodyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function Row<T extends object>(props: RowProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Cell(props: CellProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAChB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAMlD,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,kBAAkB;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAOD,wBAAgB,KAAK,CAAC,EAAE,IAAoB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAalF;AAMD,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAEvE;AAMD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAuBxC;AAMD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,2CAEnE;AAMD,wBAAgB,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,2CAcvD;AAMD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAWpC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Cell as AriaCell, Column as AriaColumn, Row as AriaRow, Table as AriaTable, TableBody as AriaTableBody, TableHeader as AriaTableHeader, } from "react-aria-components";
|
|
3
|
+
const tableSizeClass = {
|
|
4
|
+
compact: "[--table-row-py:theme(spacing.1)]",
|
|
5
|
+
comfortable: "[--table-row-py:theme(spacing.3)]",
|
|
6
|
+
};
|
|
7
|
+
export function Table({ size = "comfortable", className, ...props }) {
|
|
8
|
+
return (_jsx(AriaTable, { ...props, className: [
|
|
9
|
+
"w-full border-collapse text-[var(--font-size-sm)] text-[var(--color-text-primary)]",
|
|
10
|
+
tableSizeClass[size],
|
|
11
|
+
className,
|
|
12
|
+
]
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
.join(" ") }));
|
|
15
|
+
}
|
|
16
|
+
/* ------------------------------------------------------------------ */
|
|
17
|
+
/* TableHeader */
|
|
18
|
+
/* ------------------------------------------------------------------ */
|
|
19
|
+
export function TableHeader(props) {
|
|
20
|
+
return _jsx(AriaTableHeader, { ...props });
|
|
21
|
+
}
|
|
22
|
+
/* ------------------------------------------------------------------ */
|
|
23
|
+
/* Column */
|
|
24
|
+
/* ------------------------------------------------------------------ */
|
|
25
|
+
export function Column(props) {
|
|
26
|
+
return (_jsx(AriaColumn, { ...props, className: [
|
|
27
|
+
"px-3 py-2 text-left font-[var(--font-weight-semibold)] text-[var(--color-text-secondary)]",
|
|
28
|
+
"border-b-2 border-[var(--color-border-default)]",
|
|
29
|
+
"cursor-default select-none outline-none",
|
|
30
|
+
"focus-visible:outline-2 focus-visible:outline-[var(--color-border-focus)] focus-visible:outline-offset-[-2px]",
|
|
31
|
+
].join(" "), children: ({ allowsSorting, sortDirection }) => (_jsxs("span", { className: "inline-flex items-center gap-1", children: [props.children, allowsSorting && (_jsx("span", { "aria-hidden": "true", className: "text-[var(--color-text-tertiary)]", children: sortDirection === "ascending" ? "\u25B2" : sortDirection === "descending" ? "\u25BC" : "\u25B4" }))] })) }));
|
|
32
|
+
}
|
|
33
|
+
/* ------------------------------------------------------------------ */
|
|
34
|
+
/* TableBody */
|
|
35
|
+
/* ------------------------------------------------------------------ */
|
|
36
|
+
export function TableBody(props) {
|
|
37
|
+
return _jsx(AriaTableBody, { ...props });
|
|
38
|
+
}
|
|
39
|
+
/* ------------------------------------------------------------------ */
|
|
40
|
+
/* Row */
|
|
41
|
+
/* ------------------------------------------------------------------ */
|
|
42
|
+
export function Row(props) {
|
|
43
|
+
return (_jsx(AriaRow, { ...props, className: [
|
|
44
|
+
"border-b border-[var(--color-border-default)]",
|
|
45
|
+
"even:bg-[var(--color-neutral-50)]",
|
|
46
|
+
"hover:bg-[var(--color-teal-50)]",
|
|
47
|
+
"outline-none",
|
|
48
|
+
"focus-visible:outline-2 focus-visible:outline-[var(--color-border-focus)] focus-visible:outline-offset-[-2px]",
|
|
49
|
+
"transition-colors",
|
|
50
|
+
].join(" ") }));
|
|
51
|
+
}
|
|
52
|
+
/* ------------------------------------------------------------------ */
|
|
53
|
+
/* Cell */
|
|
54
|
+
/* ------------------------------------------------------------------ */
|
|
55
|
+
export function Cell(props) {
|
|
56
|
+
return (_jsx(AriaCell, { ...props, className: [
|
|
57
|
+
"px-3 py-[var(--table-row-py)]",
|
|
58
|
+
"outline-none",
|
|
59
|
+
"focus-visible:outline-2 focus-visible:outline-[var(--color-border-focus)] focus-visible:outline-offset-[-2px]",
|
|
60
|
+
].join(" ") }));
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table, TableHeader, Column, TableBody, Row, Cell } from "./Table";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type TabsProps as AriaTabsProps, type TabListProps as AriaTabListProps, type TabProps as AriaTabProps, type TabPanelProps as AriaTabPanelProps } from "react-aria-components";
|
|
3
|
+
export type TabsVariant = "underline" | "pills";
|
|
4
|
+
export type TabsSize = "sm" | "md" | "lg";
|
|
5
|
+
export interface TabsProps extends Omit<AriaTabsProps, "className" | "orientation"> {
|
|
6
|
+
/** Visual style variant */
|
|
7
|
+
variant?: TabsVariant;
|
|
8
|
+
/** Size preset */
|
|
9
|
+
size?: TabsSize;
|
|
10
|
+
/** Layout orientation */
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
/** Additional CSS classes */
|
|
13
|
+
className?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function Tabs({ variant, size, orientation, className, children, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface TabListProps<T extends object> extends Omit<AriaTabListProps<T>, "className"> {
|
|
18
|
+
/** Additional CSS classes */
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function TabList<T extends object>({ className, ...props }: TabListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface TabProps extends Omit<AriaTabProps, "className"> {
|
|
23
|
+
/** Additional CSS classes */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function Tab({ className, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export interface TabPanelProps extends Omit<AriaTabPanelProps, "className"> {
|
|
28
|
+
/** Additional CSS classes */
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function TabPanel({ className, ...props }: TabPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=Tabs.d.ts.map
|