@sps-woodland/buttons 8.51.2 → 8.52.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/lib/button/Button.css.d.ts +14 -0
- package/lib/button/Button.d.ts +18 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1443 -38
- package/lib/index.umd.cjs +29 -23
- package/lib/style.css +1 -1
- package/package.json +19 -5
- package/vite.config.mjs +13 -6
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tokens } from "@sps-woodland/tokens";
|
|
2
|
+
import type { VariantDefinitions, RecipeVariant, BooleanRecipeVariant } from "@sps-woodland/core";
|
|
3
|
+
export type ButtonKind = keyof typeof Tokens.component.button.kind;
|
|
4
|
+
interface ButtonVariantDefinitions extends VariantDefinitions {
|
|
5
|
+
kind: RecipeVariant<ButtonKind>;
|
|
6
|
+
disabled: BooleanRecipeVariant;
|
|
7
|
+
spinning: BooleanRecipeVariant;
|
|
8
|
+
}
|
|
9
|
+
export declare const button: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<ButtonVariantDefinitions>;
|
|
10
|
+
export declare const buttonElement: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<ButtonVariantDefinitions>;
|
|
11
|
+
export declare const linkButton: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ButtonVariantDefinitions, "kind" | "spinning">>;
|
|
12
|
+
export declare const buttonIcon: string;
|
|
13
|
+
export declare const buttonSpinner: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<ButtonVariantDefinitions, "spinning">>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PolymorphicComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import type { IconName } from "@sps-woodland/tokens";
|
|
4
|
+
import type { AriaButtonProps } from "@react-aria/button";
|
|
5
|
+
import type { ButtonKind } from "./Button.css";
|
|
6
|
+
interface BaseButtonProps {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
href?: string;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
kind?: ButtonKind;
|
|
11
|
+
spinning?: boolean;
|
|
12
|
+
spinningTitle?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
15
|
+
}
|
|
16
|
+
type ButtonProps<T extends React.ElementType = "button" | "a"> = Partial<PolymorphicComponentProps<Partial<AriaButtonProps<"button">> & Partial<BaseButtonProps>, T>>;
|
|
17
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps<"button" | "a">>;
|
|
18
|
+
export { Button };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./button/Button";
|
|
2
2
|
export * from "./manifest";
|