@octaviaflow/core 3.0.7 → 3.0.9
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/components/Button/Button.d.ts +14 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +13 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -7,6 +7,19 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
7
7
|
rightIcon?: ReactNode;
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
children?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Override the cursor shown on hover. When omitted, the cursor auto-resolves:
|
|
12
|
+
* - `not-allowed` when disabled (CSS handles this — see Button.module.scss)
|
|
13
|
+
* - `progress` when loading (request in flight)
|
|
14
|
+
* - `pointer` when the button has an action (onClick, type="submit",
|
|
15
|
+
* or type="reset"). Anchors (href) get pointer too.
|
|
16
|
+
* - `default` otherwise (decorative / placeholder buttons)
|
|
17
|
+
* Pass an explicit value (e.g. `"text"`, `"grab"`) to override the
|
|
18
|
+
* auto-resolve for the specific story / use case.
|
|
19
|
+
*/
|
|
20
|
+
cursor?: ButtonHTMLAttributes<HTMLButtonElement>["style"] extends infer S ? S extends {
|
|
21
|
+
cursor?: infer C;
|
|
22
|
+
} ? C : string : string;
|
|
10
23
|
}
|
|
11
|
-
export declare function Button({ variant, size, loading, disabled, leftIcon, rightIcon, fullWidth, className, children, type, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function Button({ variant, size, loading, disabled, leftIcon, rightIcon, fullWidth, className, children, type, cursor, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
25
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAK1E,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,kBAAkB,CAC5D;IACD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAK1E,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,QAAQ,GAAG,aAAa,GAAG,WAAW,GAAG,kBAAkB,CAC5D;IACD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,GACrE,CAAC,SAAS;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;KAAE,GAC5B,CAAC,GACD,MAAM,GACR,MAAM,CAAC;CACZ;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAmB,EACnB,IAAW,EACX,OAAe,EACf,QAAgB,EAChB,QAAQ,EACR,SAAS,EACT,SAAiB,EACjB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,2CAwIb"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
+
import { type DropdownMenuItem } from "../DropdownMenu/DropdownMenu";
|
|
2
3
|
export interface SidebarNavItem {
|
|
3
4
|
id: string;
|
|
4
5
|
label: ReactNode;
|
|
@@ -25,7 +26,19 @@ export interface SidebarUser {
|
|
|
25
26
|
email?: ReactNode;
|
|
26
27
|
initial?: ReactNode;
|
|
27
28
|
avatar?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Optional click handler — fires when the user card itself is activated.
|
|
31
|
+
* If `menu` is also provided, the click opens the menu instead; this
|
|
32
|
+
* onClick acts as an additional side effect, not the navigation.
|
|
33
|
+
*/
|
|
28
34
|
onClick?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Profile / account menu. When provided, the user card becomes a
|
|
37
|
+
* DropdownMenu trigger — clicking it opens the menu inline. This is the
|
|
38
|
+
* supported way to attach a profile menu without nesting a <button>
|
|
39
|
+
* inside the user card's <button>.
|
|
40
|
+
*/
|
|
41
|
+
menu?: DropdownMenuItem[];
|
|
29
42
|
}
|
|
30
43
|
export interface SidebarProps {
|
|
31
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,gBAAgB,EA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|
818
|
+
cursor,
|
|
819
|
+
style,
|
|
818
820
|
...props
|
|
819
821
|
}) {
|
|
820
822
|
const ref = (0, import_react4.useRef)(null);
|
|
821
823
|
const isDisabled = disabled || loading;
|
|
824
|
+
const hasAction = Boolean(props.onClick) || type === "submit" || type === "reset" || Boolean(props.href);
|
|
825
|
+
const resolvedCursor = cursor ?? (disabled ? "not-allowed" : loading ? "progress" : hasAction ? "pointer" : "default");
|
|
822
826
|
const resolvedType = type ?? "button";
|
|
823
827
|
const hasVisibleText = typeof children === "string" ? children.trim().length > 0 : Boolean(children);
|
|
824
828
|
const needsAriaName = !hasVisibleText;
|
|
@@ -863,6 +867,7 @@ function Button({
|
|
|
863
867
|
fullWidth && "ods-btn--full",
|
|
864
868
|
className
|
|
865
869
|
),
|
|
870
|
+
style: { cursor: resolvedCursor, ...style },
|
|
866
871
|
"data-loading": loading || void 0,
|
|
867
872
|
whileTap: isDisabled ? void 0 : { scale: 0.97 },
|
|
868
873
|
transition: { duration: 0.1 },
|