@cytario/design 1.6.1 → 1.7.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/dist/index.d.ts +583 -58
- package/dist/index.js +2145 -32
- package/dist/index.js.map +1 -0
- package/package.json +7 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -9
- package/dist/components/Breadcrumbs/index.d.ts +0 -3
- package/dist/components/Breadcrumbs/index.d.ts.map +0 -1
- package/dist/components/Breadcrumbs/index.js +0 -1
- package/dist/components/Button/Button.d.ts +0 -18
- package/dist/components/Button/Button.d.ts.map +0 -1
- package/dist/components/Button/Button.js +0 -51
- package/dist/components/Button/index.d.ts +0 -3
- package/dist/components/Button/index.d.ts.map +0 -1
- package/dist/components/Button/index.js +0 -1
- package/dist/components/ButtonLink/ButtonLink.d.ts +0 -35
- package/dist/components/ButtonLink/ButtonLink.d.ts.map +0 -1
- package/dist/components/ButtonLink/ButtonLink.js +0 -47
- package/dist/components/ButtonLink/index.d.ts +0 -3
- package/dist/components/ButtonLink/index.d.ts.map +0 -1
- package/dist/components/ButtonLink/index.js +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -8
- package/dist/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -19
- package/dist/components/Checkbox/index.d.ts +0 -3
- package/dist/components/Checkbox/index.d.ts.map +0 -1
- package/dist/components/Checkbox/index.js +0 -1
- package/dist/components/Dialog/Dialog.d.ts +0 -11
- package/dist/components/Dialog/Dialog.d.ts.map +0 -1
- package/dist/components/Dialog/Dialog.js +0 -31
- package/dist/components/Dialog/index.d.ts +0 -3
- package/dist/components/Dialog/index.d.ts.map +0 -1
- package/dist/components/Dialog/index.js +0 -1
- package/dist/components/EmptyState/EmptyState.d.ts +0 -11
- package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
- package/dist/components/EmptyState/EmptyState.js +0 -10
- package/dist/components/EmptyState/index.d.ts +0 -3
- package/dist/components/EmptyState/index.d.ts.map +0 -1
- package/dist/components/EmptyState/index.js +0 -1
- package/dist/components/Field/Field.d.ts +0 -13
- package/dist/components/Field/Field.d.ts.map +0 -1
- package/dist/components/Field/Field.js +0 -15
- package/dist/components/Field/index.d.ts +0 -3
- package/dist/components/Field/index.d.ts.map +0 -1
- package/dist/components/Field/index.js +0 -1
- package/dist/components/Fieldset/Fieldset.d.ts +0 -8
- package/dist/components/Fieldset/Fieldset.d.ts.map +0 -1
- package/dist/components/Fieldset/Fieldset.js +0 -15
- package/dist/components/Fieldset/index.d.ts +0 -3
- package/dist/components/Fieldset/index.d.ts.map +0 -1
- package/dist/components/Fieldset/index.js +0 -1
- package/dist/components/Heading/Heading.d.ts +0 -19
- package/dist/components/Heading/Heading.d.ts.map +0 -1
- package/dist/components/Heading/Heading.js +0 -39
- package/dist/components/Heading/index.d.ts +0 -3
- package/dist/components/Heading/index.d.ts.map +0 -1
- package/dist/components/Heading/index.js +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -15
- package/dist/components/Icon/Icon.d.ts.map +0 -1
- package/dist/components/Icon/Icon.js +0 -11
- package/dist/components/Icon/index.d.ts +0 -3
- package/dist/components/Icon/index.d.ts.map +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/components/IconButton/IconButton.d.ts +0 -23
- package/dist/components/IconButton/IconButton.d.ts.map +0 -1
- package/dist/components/IconButton/IconButton.js +0 -59
- package/dist/components/IconButton/index.d.ts +0 -3
- package/dist/components/IconButton/index.d.ts.map +0 -1
- package/dist/components/IconButton/index.js +0 -1
- package/dist/components/Input/Input.d.ts +0 -23
- package/dist/components/Input/Input.d.ts.map +0 -1
- package/dist/components/Input/Input.js +0 -97
- package/dist/components/Input/index.d.ts +0 -3
- package/dist/components/Input/index.d.ts.map +0 -1
- package/dist/components/Input/index.js +0 -1
- package/dist/components/InputAddon/InputAddon.d.ts +0 -7
- package/dist/components/InputAddon/InputAddon.d.ts.map +0 -1
- package/dist/components/InputAddon/InputAddon.js +0 -35
- package/dist/components/InputAddon/index.d.ts +0 -3
- package/dist/components/InputAddon/index.d.ts.map +0 -1
- package/dist/components/InputAddon/index.js +0 -1
- package/dist/components/InputGroup/InputGroup.d.ts +0 -7
- package/dist/components/InputGroup/InputGroup.d.ts.map +0 -1
- package/dist/components/InputGroup/InputGroup.js +0 -16
- package/dist/components/InputGroup/InputGroupContext.d.ts +0 -9
- package/dist/components/InputGroup/InputGroupContext.d.ts.map +0 -1
- package/dist/components/InputGroup/InputGroupContext.js +0 -8
- package/dist/components/InputGroup/index.d.ts +0 -5
- package/dist/components/InputGroup/index.d.ts.map +0 -1
- package/dist/components/InputGroup/index.js +0 -2
- package/dist/components/Label/Label.d.ts +0 -7
- package/dist/components/Label/Label.d.ts.map +0 -1
- package/dist/components/Label/Label.js +0 -12
- package/dist/components/Label/index.d.ts +0 -3
- package/dist/components/Label/index.d.ts.map +0 -1
- package/dist/components/Label/index.js +0 -1
- package/dist/components/Link/Link.d.ts +0 -10
- package/dist/components/Link/Link.d.ts.map +0 -1
- package/dist/components/Link/Link.js +0 -22
- package/dist/components/Link/index.d.ts +0 -3
- package/dist/components/Link/index.d.ts.map +0 -1
- package/dist/components/Link/index.js +0 -1
- package/dist/components/Menu/Menu.d.ts +0 -24
- package/dist/components/Menu/Menu.d.ts.map +0 -1
- package/dist/components/Menu/Menu.js +0 -29
- package/dist/components/Menu/index.d.ts +0 -3
- package/dist/components/Menu/index.d.ts.map +0 -1
- package/dist/components/Menu/index.js +0 -1
- package/dist/components/Popover/Popover.d.ts +0 -44
- package/dist/components/Popover/Popover.d.ts.map +0 -1
- package/dist/components/Popover/Popover.js +0 -46
- package/dist/components/Popover/index.d.ts +0 -3
- package/dist/components/Popover/index.d.ts.map +0 -1
- package/dist/components/Popover/index.js +0 -1
- package/dist/components/Radio/Radio.d.ts +0 -18
- package/dist/components/Radio/Radio.d.ts.map +0 -1
- package/dist/components/Radio/Radio.js +0 -43
- package/dist/components/Radio/index.d.ts +0 -3
- package/dist/components/Radio/index.d.ts.map +0 -1
- package/dist/components/Radio/index.js +0 -1
- package/dist/components/Select/Select.d.ts +0 -17
- package/dist/components/Select/Select.d.ts.map +0 -1
- package/dist/components/Select/Select.js +0 -42
- package/dist/components/Select/index.d.ts +0 -3
- package/dist/components/Select/index.d.ts.map +0 -1
- package/dist/components/Select/index.js +0 -1
- package/dist/components/Spinner/Spinner.d.ts +0 -10
- package/dist/components/Spinner/Spinner.d.ts.map +0 -1
- package/dist/components/Spinner/Spinner.js +0 -12
- package/dist/components/Spinner/index.d.ts +0 -3
- package/dist/components/Spinner/index.d.ts.map +0 -1
- package/dist/components/Spinner/index.js +0 -1
- package/dist/components/Switch/Switch.d.ts +0 -12
- package/dist/components/Switch/Switch.d.ts.map +0 -1
- package/dist/components/Switch/Switch.js +0 -34
- package/dist/components/Switch/index.d.ts +0 -3
- package/dist/components/Switch/index.d.ts.map +0 -1
- package/dist/components/Switch/index.js +0 -1
- package/dist/components/Table/Table.d.ts +0 -13
- package/dist/components/Table/Table.d.ts.map +0 -1
- package/dist/components/Table/Table.js +0 -61
- package/dist/components/Table/index.d.ts +0 -3
- package/dist/components/Table/index.d.ts.map +0 -1
- package/dist/components/Table/index.js +0 -1
- package/dist/components/Tabs/Tabs.d.ts +0 -32
- package/dist/components/Tabs/Tabs.d.ts.map +0 -1
- package/dist/components/Tabs/Tabs.js +0 -100
- package/dist/components/Tabs/index.d.ts +0 -3
- package/dist/components/Tabs/index.d.ts.map +0 -1
- package/dist/components/Tabs/index.js +0 -1
- package/dist/components/Toast/Toast.d.ts +0 -33
- package/dist/components/Toast/Toast.d.ts.map +0 -1
- package/dist/components/Toast/Toast.js +0 -102
- package/dist/components/Toast/index.d.ts +0 -3
- package/dist/components/Toast/index.d.ts.map +0 -1
- package/dist/components/Toast/index.js +0 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +0 -13
- package/dist/components/ToggleButton/ToggleButton.d.ts.map +0 -1
- package/dist/components/ToggleButton/ToggleButton.js +0 -42
- package/dist/components/ToggleButton/index.d.ts +0 -3
- package/dist/components/ToggleButton/index.d.ts.map +0 -1
- package/dist/components/ToggleButton/index.js +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -15
- package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip/Tooltip.js +0 -20
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/components/Tooltip/index.d.ts.map +0 -1
- package/dist/components/Tooltip/index.js +0 -1
- package/dist/components/_shared/styles.d.ts +0 -5
- package/dist/components/_shared/styles.d.ts.map +0 -1
- package/dist/components/_shared/styles.js +0 -43
- package/dist/index.d.ts.map +0 -1
- package/dist/test-setup.d.ts +0 -2
- package/dist/test-setup.d.ts.map +0 -1
- package/dist/test-setup.js +0 -1
- package/dist/tokens/tokens.d.ts +0 -144
- package/dist/tokens/tokens.d.ts.map +0 -1
- package/dist/tokens/tokens.js +0 -143
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useInputGroup } from "../InputGroup/InputGroupContext";
|
|
3
|
-
function groupRadiusClass(position) {
|
|
4
|
-
switch (position) {
|
|
5
|
-
case "start":
|
|
6
|
-
return "rounded-l-[var(--border-radius-md)] rounded-r-none";
|
|
7
|
-
case "middle":
|
|
8
|
-
return "rounded-none";
|
|
9
|
-
case "end":
|
|
10
|
-
return "rounded-r-[var(--border-radius-md)] rounded-l-none";
|
|
11
|
-
default:
|
|
12
|
-
return "rounded-[var(--border-radius-md)]";
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function InputAddon({ children, className }) {
|
|
16
|
-
const { inGroup, position } = useInputGroup();
|
|
17
|
-
const radiusClass = inGroup
|
|
18
|
-
? groupRadiusClass(position)
|
|
19
|
-
: "rounded-[var(--border-radius-md)]";
|
|
20
|
-
const marginClass = inGroup && position !== "start" && position !== "standalone"
|
|
21
|
-
? "-ml-px"
|
|
22
|
-
: "";
|
|
23
|
-
return (_jsx("div", { className: [
|
|
24
|
-
"flex items-center self-stretch shrink-0 select-none",
|
|
25
|
-
"px-3 py-2 text-base",
|
|
26
|
-
"bg-[var(--color-surface-subtle)]",
|
|
27
|
-
"text-[var(--color-text-secondary)]",
|
|
28
|
-
"border border-[var(--color-border-default)]",
|
|
29
|
-
radiusClass,
|
|
30
|
-
marginClass,
|
|
31
|
-
className,
|
|
32
|
-
]
|
|
33
|
-
.filter(Boolean)
|
|
34
|
-
.join(" "), children: children }));
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InputAddon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputAddon } from "./InputAddon";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface InputGroupProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function InputGroup({ children, className }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=InputGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../src/components/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA8BlE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Label } from "./Label";
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Link } from "./Link";
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Menu } from "./Menu";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import { type PopoverProps as AriaPopoverProps } from "react-aria-components";
|
|
3
|
-
export interface PopoverProps {
|
|
4
|
-
/** Controls open state (uncontrolled by default via DialogTrigger) */
|
|
5
|
-
isOpen?: boolean;
|
|
6
|
-
/** Called when open state changes */
|
|
7
|
-
onOpenChange?: (isOpen: boolean) => void;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export interface PopoverTriggerProps {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
/** Additional CSS classes for the trigger wrapper */
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface PopoverContentProps {
|
|
16
|
-
/** Placement relative to the trigger element */
|
|
17
|
-
placement?: AriaPopoverProps["placement"];
|
|
18
|
-
/** Offset from the trigger in pixels */
|
|
19
|
-
offset?: number;
|
|
20
|
-
/** Additional CSS classes */
|
|
21
|
-
className?: string;
|
|
22
|
-
/** Content to render inside the popover. Can be a render function receiving { close }. */
|
|
23
|
-
children: React.ReactNode | ((opts: {
|
|
24
|
-
close: () => void;
|
|
25
|
-
}) => React.ReactNode);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Popover root -- wraps React Aria's DialogTrigger.
|
|
29
|
-
*/
|
|
30
|
-
export declare function Popover({ children, isOpen, onOpenChange }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
/**
|
|
32
|
-
* PopoverTrigger -- wraps the child in a React Aria Button so it
|
|
33
|
-
* participates in DialogTrigger's open/close handling.
|
|
34
|
-
*
|
|
35
|
-
* Renders as an unstyled inline element. Pass your visual trigger
|
|
36
|
-
* (text, icon, swatch) as children.
|
|
37
|
-
*/
|
|
38
|
-
export declare function PopoverTrigger({ children, className }: PopoverTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
/**
|
|
40
|
-
* PopoverContent -- the floating panel anchored to the trigger.
|
|
41
|
-
* Built on React Aria's Popover + Dialog for accessible focus management.
|
|
42
|
-
*/
|
|
43
|
-
export declare function PopoverContent({ placement, offset: offsetPx, className, children, }: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAKL,KAAK,YAAY,IAAI,gBAAgB,EACtC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,YAAY;IAC3B,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAC1C,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,QAAQ,EACJ,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,YAAY,2CAMvE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,mBAAmB,2CAc1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,SAAoB,EACpB,MAAM,EAAE,QAAY,EACpB,SAAS,EACT,QAAQ,GACT,EAAE,mBAAmB,2CA+BrB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { DialogTrigger, Popover as AriaPopover, Dialog as AriaDialog, Button as AriaButton, } from "react-aria-components";
|
|
3
|
-
/**
|
|
4
|
-
* Popover root -- wraps React Aria's DialogTrigger.
|
|
5
|
-
*/
|
|
6
|
-
export function Popover({ children, isOpen, onOpenChange }) {
|
|
7
|
-
return (_jsx(DialogTrigger, { isOpen: isOpen, onOpenChange: onOpenChange, children: children }));
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* PopoverTrigger -- wraps the child in a React Aria Button so it
|
|
11
|
-
* participates in DialogTrigger's open/close handling.
|
|
12
|
-
*
|
|
13
|
-
* Renders as an unstyled inline element. Pass your visual trigger
|
|
14
|
-
* (text, icon, swatch) as children.
|
|
15
|
-
*/
|
|
16
|
-
export function PopoverTrigger({ children, className }) {
|
|
17
|
-
return (_jsx(AriaButton, { className: [
|
|
18
|
-
"inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer",
|
|
19
|
-
"focus-visible:ring-2 focus-visible:ring-[var(--color-border-focus)] focus-visible:rounded-[var(--border-radius-sm)]",
|
|
20
|
-
className,
|
|
21
|
-
]
|
|
22
|
-
.filter(Boolean)
|
|
23
|
-
.join(" "), children: children }));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* PopoverContent -- the floating panel anchored to the trigger.
|
|
27
|
-
* Built on React Aria's Popover + Dialog for accessible focus management.
|
|
28
|
-
*/
|
|
29
|
-
export function PopoverContent({ placement = "bottom", offset: offsetPx = 8, className, children, }) {
|
|
30
|
-
return (_jsx(AriaPopover, { placement: placement, offset: offsetPx, className: [
|
|
31
|
-
"z-50",
|
|
32
|
-
"bg-[var(--color-surface-default)] border border-[var(--color-border-default)]",
|
|
33
|
-
"rounded-[var(--border-radius-md)] shadow-lg",
|
|
34
|
-
"entering:animate-in entering:fade-in entering:duration-150",
|
|
35
|
-
"exiting:animate-out exiting:fade-out exiting:duration-100",
|
|
36
|
-
"entering:placement-top:slide-in-from-bottom-1",
|
|
37
|
-
"entering:placement-bottom:slide-in-from-top-1",
|
|
38
|
-
"entering:placement-left:slide-in-from-right-1",
|
|
39
|
-
"entering:placement-right:slide-in-from-left-1",
|
|
40
|
-
className,
|
|
41
|
-
]
|
|
42
|
-
.filter(Boolean)
|
|
43
|
-
.join(" "), children: _jsx(AriaDialog, { className: "outline-none", children: ({ close }) => (_jsx(_Fragment, { children: typeof children === "function"
|
|
44
|
-
? children({ close })
|
|
45
|
-
: children })) }) }));
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpE,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RadioGroup, Radio, RadioButton } from "./Radio";
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Select } from "./Select";
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Spinner } from "./Spinner";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import { type SwitchProps as AriaSwitchProps } from "react-aria-components";
|
|
3
|
-
type PresetColor = "primary" | "success" | "destructive";
|
|
4
|
-
export interface SwitchProps extends Omit<AriaSwitchProps, "children" | "className"> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/** Preset color name or any valid CSS color string for the track when selected */
|
|
7
|
-
color?: PresetColor | (string & {});
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function Switch({ children, color, className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAEzD,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,WAAW,CAAC;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,kFAAkF;IAClF,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,KAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,2CA4Cb"}
|