@gridui/button 2.0.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/dist/{async-action.d.ts → button/async-action.d.ts} +1 -1
- package/dist/{button.d.ts → button/button.d.ts} +2 -8
- package/dist/{download.d.ts → button/download.d.ts} +1 -1
- package/dist/button-link/button-link.d.ts +14 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +34 -21
- package/dist/index.js.map +4 -4
- package/dist/{style.d.ts → shared/style.d.ts} +6 -4
- package/dist/styles.css +11 -2
- package/package.json +7 -12
package/README.md
CHANGED
|
@@ -29,9 +29,10 @@ Use a real button when the action needs native disabled behavior.
|
|
|
29
29
|
|
|
30
30
|
## Appearance and icons
|
|
31
31
|
|
|
32
|
-
The variants are `primary`, `secondary`, `quiet`, `text`, and `underlined`. Sizes are
|
|
32
|
+
The variants are `primary`, `secondary`, `quiet`, `highlight`, `text`, and `underlined`. Sizes are
|
|
33
33
|
`standard` (2.75rem minimum height) and `small` (2.25rem). The existing `standard`,
|
|
34
|
-
`icon`, `entry`, and `rail` layouts
|
|
34
|
+
`icon`, `entry`, and `rail` layouts, plus the full-region `cell` layout, are
|
|
35
|
+
available for non-text/non-underlined variants.
|
|
35
36
|
Small icon controls retain a 2.75rem touch target on coarse pointers.
|
|
36
37
|
|
|
37
38
|
`text` and `underlined` accept only `layout="standard"`, which may be omitted.
|
|
@@ -57,6 +58,20 @@ omit the border. Secondary and quiet surfaces use `surface-hover` while enabled.
|
|
|
57
58
|
Disabled buttons keep their base fill and reduced opacity. Standard and small
|
|
58
59
|
sizes scale with the consumer's root font size.
|
|
59
60
|
|
|
61
|
+
`highlight` uses the neutral `surface` fill and normal foreground. Use it for a
|
|
62
|
+
persistent selected action, with `quiet` for its unselected peers. Choose the
|
|
63
|
+
variant from application state and supply the matching native semantics, such as
|
|
64
|
+
`aria-pressed` for a toggle or `aria-current="page"` for navigation. The variant
|
|
65
|
+
does not create selection behavior, and ARIA attributes do not choose a variant.
|
|
66
|
+
|
|
67
|
+
Appearance and layout are independent. `standard` and `icon` retain standalone
|
|
68
|
+
control geometry. `entry` fills the available width with entry spacing; it does
|
|
69
|
+
not replace the chosen variant's background. `cell` fills both the width and
|
|
70
|
+
height of its containing region, uses square corners and no button border, and
|
|
71
|
+
keeps content padding inside the hit area. Grid or another structural parent
|
|
72
|
+
owns any surrounding seams. Put a cell button in `GridItem padding={0}` to avoid
|
|
73
|
+
an inset selected surface. See the [composition recipe](../../docs/usage/composition.md#full-region-actions).
|
|
74
|
+
|
|
60
75
|
`buttonClass(variants, className?)` exposes the same appearance and text-layout
|
|
61
76
|
constraints for caller-owned native elements. `startIcon` and `endIcon` are
|
|
62
77
|
component props, not styling variants. It uses `cn` for consumer class overrides.
|
|
@@ -80,5 +95,6 @@ the browser has had time to consume it. Callers own the Blob contents and name.
|
|
|
80
95
|
Package unit tests cover native action/link semantics, decorative icon isolation,
|
|
81
96
|
busy-state scheduling and failure cleanup. Type fixtures compile with the package
|
|
82
97
|
and reject text and underlined/icon-layout combinations, missing link destinations, and icon
|
|
83
|
-
nodes passed as style variants. Storybook includes
|
|
84
|
-
|
|
98
|
+
nodes passed as style variants. Storybook includes standalone, icon, full-cell,
|
|
99
|
+
and disabled highlight states, text and underlined actions and links, decorative
|
|
100
|
+
icon slots, long labels, loading, and the existing variants.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author WMXPY
|
|
3
3
|
* @package Button
|
|
4
|
-
* @namespace
|
|
4
|
+
* @namespace Button
|
|
5
5
|
* @description Button
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type ButtonVariants } from "../shared/style";
|
|
8
8
|
import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
9
9
|
export type ButtonProps = ComponentPropsWithRef<"button"> & ButtonVariants & {
|
|
10
10
|
readonly loading?: boolean;
|
|
@@ -12,9 +12,3 @@ export type ButtonProps = ComponentPropsWithRef<"button"> & ButtonVariants & {
|
|
|
12
12
|
readonly endIcon?: ReactNode;
|
|
13
13
|
};
|
|
14
14
|
export declare const Button: FC<ButtonProps>;
|
|
15
|
-
export type ButtonLinkProps = ComponentPropsWithRef<"a"> & ButtonVariants & {
|
|
16
|
-
readonly href: string;
|
|
17
|
-
readonly startIcon?: ReactNode;
|
|
18
|
-
readonly endIcon?: ReactNode;
|
|
19
|
-
};
|
|
20
|
-
export declare const ButtonLink: FC<ButtonLinkProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Button
|
|
4
|
+
* @namespace ButtonLink
|
|
5
|
+
* @description Button Link
|
|
6
|
+
*/
|
|
7
|
+
import { type ButtonVariants } from "../shared/style";
|
|
8
|
+
import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
9
|
+
export type ButtonLinkProps = ComponentPropsWithRef<"a"> & ButtonVariants & {
|
|
10
|
+
readonly href: string;
|
|
11
|
+
readonly startIcon?: ReactNode;
|
|
12
|
+
readonly endIcon?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare const ButtonLink: FC<ButtonLinkProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* @namespace Root
|
|
5
5
|
* @description Index
|
|
6
6
|
*/
|
|
7
|
-
export { useAsyncAction } from "./async-action";
|
|
8
|
-
export type {
|
|
9
|
-
export { Button
|
|
10
|
-
export { downloadBlob } from "./download";
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
7
|
+
export { useAsyncAction } from "./button/async-action";
|
|
8
|
+
export type { ButtonProps } from "./button/button";
|
|
9
|
+
export { Button } from "./button/button";
|
|
10
|
+
export { downloadBlob } from "./button/download";
|
|
11
|
+
export type { ButtonLinkProps } from "./button-link/button-link";
|
|
12
|
+
export { ButtonLink } from "./button-link/button-link";
|
|
13
|
+
export type { ButtonVariants } from "./shared/style";
|
|
14
|
+
export { buttonClass } from "./shared/style";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/async-action.ts
|
|
1
|
+
// src/button/async-action.ts
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
3
|
var performAsyncAction = async ({ action, onStart, onPendingChange }) => {
|
|
4
4
|
onPendingChange(true);
|
|
@@ -38,7 +38,7 @@ var useAsyncAction = ({ action, onStart, disabled = false }) => {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
// src/style.ts
|
|
41
|
+
// src/shared/style.ts
|
|
42
42
|
import { cn } from "@gridui/style-utils";
|
|
43
43
|
import { cva } from "class-variance-authority";
|
|
44
44
|
var buttonStyles = cva(cn(
|
|
@@ -72,6 +72,10 @@ var buttonQuietStyles = cva(cn(
|
|
|
72
72
|
"text-foreground bg-transparent",
|
|
73
73
|
"[&:hover:not(:disabled)]:bg-surface-hover"
|
|
74
74
|
));
|
|
75
|
+
var buttonHighlightStyles = cva(cn(
|
|
76
|
+
"gridui-button-highlight",
|
|
77
|
+
"text-foreground bg-surface"
|
|
78
|
+
));
|
|
75
79
|
var buttonTextStyles = cva(cn(
|
|
76
80
|
"gridui-button-text",
|
|
77
81
|
"text-foreground bg-transparent border-0 rounded-none"
|
|
@@ -82,7 +86,11 @@ var buttonUnderlinedStyles = cva(cn(
|
|
|
82
86
|
));
|
|
83
87
|
var buttonEntryStyles = cva(cn(
|
|
84
88
|
"gridui-button-entry",
|
|
85
|
-
"justify-between w-full py-gridui-16 px-gridui-24
|
|
89
|
+
"justify-between w-full py-gridui-16 px-gridui-24"
|
|
90
|
+
));
|
|
91
|
+
var buttonCellStyles = cva(cn(
|
|
92
|
+
"gridui-button-cell",
|
|
93
|
+
"w-full h-full justify-start rounded-none border-0 py-gridui-16 px-gridui-24 text-left"
|
|
86
94
|
));
|
|
87
95
|
var buttonRailStyles = cva(cn(
|
|
88
96
|
"gridui-button-rail",
|
|
@@ -101,6 +109,7 @@ var buttonVariants = cva(buttonStyles(), {
|
|
|
101
109
|
primary: buttonPrimaryStyles(),
|
|
102
110
|
secondary: buttonSecondaryStyles(),
|
|
103
111
|
quiet: buttonQuietStyles(),
|
|
112
|
+
highlight: buttonHighlightStyles(),
|
|
104
113
|
text: buttonTextStyles(),
|
|
105
114
|
underlined: buttonUnderlinedStyles()
|
|
106
115
|
},
|
|
@@ -112,6 +121,7 @@ var buttonVariants = cva(buttonStyles(), {
|
|
|
112
121
|
standard: "",
|
|
113
122
|
icon: buttonIconStyles(),
|
|
114
123
|
entry: buttonEntryStyles(),
|
|
124
|
+
cell: buttonCellStyles(),
|
|
115
125
|
rail: buttonRailStyles()
|
|
116
126
|
}
|
|
117
127
|
},
|
|
@@ -128,7 +138,7 @@ var buttonClass = (variants = {}, className) => {
|
|
|
128
138
|
}), (variants.variant === "text" || variants.variant === "underlined") && "px-0", className);
|
|
129
139
|
};
|
|
130
140
|
|
|
131
|
-
// src/button.tsx
|
|
141
|
+
// src/button/button.tsx
|
|
132
142
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
133
143
|
var Button = (props) => {
|
|
134
144
|
const {
|
|
@@ -185,6 +195,23 @@ var Button = (props) => {
|
|
|
185
195
|
}
|
|
186
196
|
);
|
|
187
197
|
};
|
|
198
|
+
|
|
199
|
+
// src/button/download.ts
|
|
200
|
+
var downloadBlob = (blob, filename) => {
|
|
201
|
+
const url = URL.createObjectURL(blob);
|
|
202
|
+
const link = document.createElement("a");
|
|
203
|
+
link.href = url;
|
|
204
|
+
link.download = filename;
|
|
205
|
+
document.body.appendChild(link);
|
|
206
|
+
link.click();
|
|
207
|
+
link.remove();
|
|
208
|
+
window.setTimeout(() => {
|
|
209
|
+
URL.revokeObjectURL(url);
|
|
210
|
+
}, 3e4);
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/button-link/button-link.tsx
|
|
214
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
188
215
|
var ButtonLink = (props) => {
|
|
189
216
|
const {
|
|
190
217
|
variant = "secondary",
|
|
@@ -205,13 +232,13 @@ var ButtonLink = (props) => {
|
|
|
205
232
|
size,
|
|
206
233
|
layout
|
|
207
234
|
};
|
|
208
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ jsxs2(
|
|
209
236
|
"a",
|
|
210
237
|
{
|
|
211
238
|
...restProps,
|
|
212
239
|
className: buttonClass(variants, className),
|
|
213
240
|
children: [
|
|
214
|
-
startIcon !== void 0 && startIcon !== null && typeof startIcon !== "boolean" && /* @__PURE__ */
|
|
241
|
+
startIcon !== void 0 && startIcon !== null && typeof startIcon !== "boolean" && /* @__PURE__ */ jsx2(
|
|
215
242
|
"span",
|
|
216
243
|
{
|
|
217
244
|
className: "gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none",
|
|
@@ -221,7 +248,7 @@ var ButtonLink = (props) => {
|
|
|
221
248
|
}
|
|
222
249
|
),
|
|
223
250
|
children,
|
|
224
|
-
endIcon !== void 0 && endIcon !== null && typeof endIcon !== "boolean" && /* @__PURE__ */
|
|
251
|
+
endIcon !== void 0 && endIcon !== null && typeof endIcon !== "boolean" && /* @__PURE__ */ jsx2(
|
|
225
252
|
"span",
|
|
226
253
|
{
|
|
227
254
|
className: "gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none",
|
|
@@ -234,20 +261,6 @@ var ButtonLink = (props) => {
|
|
|
234
261
|
}
|
|
235
262
|
);
|
|
236
263
|
};
|
|
237
|
-
|
|
238
|
-
// src/download.ts
|
|
239
|
-
var downloadBlob = (blob, filename) => {
|
|
240
|
-
const url = URL.createObjectURL(blob);
|
|
241
|
-
const link = document.createElement("a");
|
|
242
|
-
link.href = url;
|
|
243
|
-
link.download = filename;
|
|
244
|
-
document.body.appendChild(link);
|
|
245
|
-
link.click();
|
|
246
|
-
link.remove();
|
|
247
|
-
window.setTimeout(() => {
|
|
248
|
-
URL.revokeObjectURL(url);
|
|
249
|
-
}, 3e4);
|
|
250
|
-
};
|
|
251
264
|
export {
|
|
252
265
|
Button,
|
|
253
266
|
ButtonLink,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/async-action.ts", "../src/style.ts", "../src/button.tsx", "../src/download.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Button\n * @namespace Root\n * @description Async Action\n */\n\nimport { useRef, useState } from \"react\";\n\ntype Action = () => void | Promise<void>;\n\nexport const performAsyncAction = async ({ action, onStart, onPendingChange }: {\n readonly action: Action;\n readonly onStart?: Action;\n readonly onPendingChange: (pending: boolean) => void;\n}): Promise<void> => {\n onPendingChange(true);\n try {\n await onStart?.();\n await new Promise<void>((resolve) => {\n setTimeout(resolve, 0);\n });\n await action();\n } finally {\n onPendingChange(false);\n }\n};\n\nexport const useAsyncAction = ({ action, onStart, disabled = false }: {\n readonly action: Action;\n readonly onStart?: Action;\n readonly disabled?: boolean;\n}) => {\n const [\n pending,\n setPending,\n ] = useState(false);\n const active = useRef(false);\n return {\n pending,\n async run(): Promise<void> {\n if (disabled || active.current) {\n return;\n }\n active.current = true;\n try {\n await performAsyncAction({\n action,\n ...(onStart ? { onStart } : {}),\n onPendingChange: setPending,\n });\n } finally {\n active.current = false;\n }\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Root\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cva } from \"class-variance-authority\";\n\nexport const buttonStyles = cva(cn(\n \"gridui-button\",\n \"inline-flex w-fit max-w-full min-w-0 items-center justify-center gap-gridui-8 border border-solid border-transparent rounded-control type-ui text-center no-underline wrap-anywhere cursor-pointer transition-colors duration-(--gridui-motion-duration-quick) ease-(--gridui-motion-ease-out)\",\n \"[&_svg]:w-gridui-16 [&_svg]:h-gridui-16 [&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n \"[&:hover:not(:disabled)]:border-foreground\",\n \"[&:active:not(:disabled)]:opacity-[0.8]\",\n \"motion-reduce:transition-none\",\n));\n\nexport const buttonStandardStyles = cva(cn(\n \"gridui-button-standard\",\n \"min-h-11 py-gridui-8 px-gridui-16\",\n));\n\nexport const buttonSmallStyles = cva(cn(\n \"gridui-button-small\",\n \"min-h-9 py-gridui-4 px-gridui-8\",\n));\n\nexport const buttonPrimaryStyles = cva(cn(\n \"gridui-button-primary\",\n \"text-accent-foreground bg-accent-background border-accent-background\",\n));\n\nexport const buttonSecondaryStyles = cva(cn(\n \"gridui-button-secondary\",\n \"text-foreground bg-transparent border-border\",\n \"[&:hover:not(:disabled)]:bg-surface-hover\",\n));\n\nexport const buttonQuietStyles = cva(cn(\n \"gridui-button-quiet\",\n \"text-foreground bg-transparent\",\n \"[&:hover:not(:disabled)]:bg-surface-hover\",\n));\n\nexport const buttonTextStyles = cva(cn(\n \"gridui-button-text\",\n \"text-foreground bg-transparent border-0 rounded-none\",\n));\n\nexport const buttonUnderlinedStyles = cva(cn(\n \"gridui-button-underlined\",\n \"text-foreground bg-transparent border-0 border-b border-foreground rounded-none\",\n));\n\nexport const buttonEntryStyles = cva(cn(\n \"gridui-button-entry\",\n \"justify-between w-full py-gridui-16 px-gridui-24 bg-background\",\n));\n\nexport const buttonRailStyles = cva(cn(\n \"gridui-button-rail\",\n \"w-full min-w-gridui-24 flex-col py-gridui-8 px-0\",\n \"[&_>_span]:[writing-mode:vertical-rl] [&_>_span]:whitespace-nowrap\",\n));\n\nexport const buttonIconStyles = cva(cn(\n \"gridui-button-icon\",\n \"w-11 h-11 shrink-0 p-0\",\n \"[&.gridui-button-small]:w-9 [&.gridui-button-small]:h-9\",\n \"pointer-coarse:[&.gridui-button-small]:w-11 pointer-coarse:[&.gridui-button-small]:h-11\",\n));\n\nexport const buttonVariants = cva(buttonStyles(), {\n variants: {\n variant: {\n primary: buttonPrimaryStyles(),\n secondary: buttonSecondaryStyles(),\n quiet: buttonQuietStyles(),\n text: buttonTextStyles(),\n underlined: buttonUnderlinedStyles(),\n },\n size: {\n small: buttonSmallStyles(),\n standard: buttonStandardStyles(),\n },\n layout: {\n standard: \"\",\n icon: buttonIconStyles(),\n entry: buttonEntryStyles(),\n rail: buttonRailStyles(),\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"standard\",\n },\n});\n\ntype ButtonStyleVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonVariants = Omit<ButtonStyleVariants, \"variant\" | \"layout\"> & (\n | {\n readonly variant: \"text\" | \"underlined\";\n readonly layout?: \"standard\" | null | undefined;\n }\n | {\n readonly variant?: Exclude<ButtonStyleVariants[\"variant\"], \"text\" | \"underlined\">;\n readonly layout?: ButtonStyleVariants[\"layout\"];\n }\n);\n\nexport const buttonClass = (variants: ButtonVariants = {}, className?: string): string => {\n return cn(buttonVariants({\n variant: variants.variant,\n size: variants.size,\n layout: variants.layout,\n }), (variants.variant === \"text\" || variants.variant === \"underlined\") && \"px-0\", className);\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Root\n * @description Button\n */\n\nimport type { ButtonVariants } from \"./style\";\nimport { buttonClass } from \"./style\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & ButtonVariants & {\n readonly loading?: boolean;\n readonly startIcon?: ReactNode;\n readonly endIcon?: ReactNode;\n};\n\nexport const Button: FC<ButtonProps> = (props: ButtonProps) => {\n const {\n variant,\n size,\n layout,\n loading = false,\n disabled,\n type = \"button\",\n className,\n children,\n startIcon,\n endIcon,\n ...restProps\n } = props;\n const variants: ButtonVariants = (variant === \"text\" || variant === \"underlined\") ? {\n variant,\n size,\n layout: \"standard\",\n } : {\n variant,\n size,\n layout,\n };\n return (<button\n {...restProps}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || restProps[\"aria-busy\"]}\n className={buttonClass(variants, className)}\n >\n {startIcon !== undefined && startIcon !== null && typeof startIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {startIcon}\n </span>)}\n {children}\n {endIcon !== undefined && endIcon !== null && typeof endIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {endIcon}\n </span>)}\n </button>);\n};\n\nexport type ButtonLinkProps = ComponentPropsWithRef<\"a\"> & ButtonVariants & {\n readonly href: string;\n readonly startIcon?: ReactNode;\n readonly endIcon?: ReactNode;\n};\n\nexport const ButtonLink: FC<ButtonLinkProps> = (props: ButtonLinkProps) => {\n const {\n variant = \"secondary\",\n size,\n layout,\n className,\n children,\n startIcon,\n endIcon,\n ...restProps\n } = props;\n const variants: ButtonVariants = (variant === \"text\" || variant === \"underlined\") ? {\n variant,\n size,\n layout: \"standard\",\n } : {\n variant,\n size,\n layout,\n };\n return (<a\n {...restProps}\n className={buttonClass(variants, className)}\n >\n {startIcon !== undefined && startIcon !== null && typeof startIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {startIcon}\n </span>)}\n {children}\n {endIcon !== undefined && endIcon !== null && typeof endIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {endIcon}\n </span>)}\n </a>);\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Root\n * @description Download\n */\n\nexport const downloadBlob = (blob: Blob, filename: string): void => {\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n link.remove();\n window.setTimeout(() => {\n URL.revokeObjectURL(url);\n }, 30000);\n};\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,QAAQ,gBAAgB;AAI1B,IAAM,qBAAqB,OAAO,EAAE,QAAQ,SAAS,gBAAgB,MAIvD;AACjB,kBAAgB,IAAI;AACpB,MAAI;AACA,UAAM,UAAU;AAChB,UAAM,IAAI,QAAc,CAAC,YAAY;AACjC,iBAAW,SAAS,CAAC;AAAA,IACzB,CAAC;AACD,UAAM,OAAO;AAAA,EACjB,UAAE;AACE,oBAAgB,KAAK;AAAA,EACzB;AACJ;AAEO,IAAM,iBAAiB,CAAC,EAAE,QAAQ,SAAS,WAAW,MAAM,MAI7D;AACF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,EACJ,IAAI,SAAS,KAAK;AAClB,QAAM,SAAS,OAAO,KAAK;AAC3B,SAAO;AAAA,IACH;AAAA,IACA,MAAM,MAAqB;AACvB,UAAI,YAAY,OAAO,SAAS;AAC5B;AAAA,MACJ;AACA,aAAO,UAAU;AACjB,UAAI;AACA,cAAM,mBAAmB;AAAA,UACrB;AAAA,UACA,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,UAC7B,iBAAiB;AAAA,QACrB,CAAC;AAAA,MACL,UAAE;AACE,eAAO,UAAU;AAAA,MACrB;AAAA,IACJ;AAAA,EACJ;AACJ;;;ACjDA,SAAS,UAAU;
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../src/button/async-action.ts", "../src/shared/style.ts", "../src/button/button.tsx", "../src/button/download.ts", "../src/button-link/button-link.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Button\n * @namespace Button\n * @description Async Action\n */\n\nimport { useRef, useState } from \"react\";\n\ntype Action = () => void | Promise<void>;\n\nexport const performAsyncAction = async ({ action, onStart, onPendingChange }: {\n readonly action: Action;\n readonly onStart?: Action;\n readonly onPendingChange: (pending: boolean) => void;\n}): Promise<void> => {\n onPendingChange(true);\n try {\n await onStart?.();\n await new Promise<void>((resolve) => {\n setTimeout(resolve, 0);\n });\n await action();\n } finally {\n onPendingChange(false);\n }\n};\n\nexport const useAsyncAction = ({ action, onStart, disabled = false }: {\n readonly action: Action;\n readonly onStart?: Action;\n readonly disabled?: boolean;\n}) => {\n const [\n pending,\n setPending,\n ] = useState(false);\n const active = useRef(false);\n return {\n pending,\n async run(): Promise<void> {\n if (disabled || active.current) {\n return;\n }\n active.current = true;\n try {\n await performAsyncAction({\n action,\n ...(onStart ? { onStart } : {}),\n onPendingChange: setPending,\n });\n } finally {\n active.current = false;\n }\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Shared\n * @description Style\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nexport const buttonStyles = cva(cn(\n \"gridui-button\",\n \"inline-flex w-fit max-w-full min-w-0 items-center justify-center gap-gridui-8 border border-solid border-transparent rounded-control type-ui text-center no-underline wrap-anywhere cursor-pointer transition-colors duration-(--gridui-motion-duration-quick) ease-(--gridui-motion-ease-out)\",\n \"[&_svg]:w-gridui-16 [&_svg]:h-gridui-16 [&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n \"[&:hover:not(:disabled)]:border-foreground\",\n \"[&:active:not(:disabled)]:opacity-[0.8]\",\n \"motion-reduce:transition-none\",\n));\n\nexport const buttonStandardStyles = cva(cn(\n \"gridui-button-standard\",\n \"min-h-11 py-gridui-8 px-gridui-16\",\n));\n\nexport const buttonSmallStyles = cva(cn(\n \"gridui-button-small\",\n \"min-h-9 py-gridui-4 px-gridui-8\",\n));\n\nexport const buttonPrimaryStyles = cva(cn(\n \"gridui-button-primary\",\n \"text-accent-foreground bg-accent-background border-accent-background\",\n));\n\nexport const buttonSecondaryStyles = cva(cn(\n \"gridui-button-secondary\",\n \"text-foreground bg-transparent border-border\",\n \"[&:hover:not(:disabled)]:bg-surface-hover\",\n));\n\nexport const buttonQuietStyles = cva(cn(\n \"gridui-button-quiet\",\n \"text-foreground bg-transparent\",\n \"[&:hover:not(:disabled)]:bg-surface-hover\",\n));\n\nexport const buttonHighlightStyles = cva(cn(\n \"gridui-button-highlight\",\n \"text-foreground bg-surface\",\n));\n\nexport const buttonTextStyles = cva(cn(\n \"gridui-button-text\",\n \"text-foreground bg-transparent border-0 rounded-none\",\n));\n\nexport const buttonUnderlinedStyles = cva(cn(\n \"gridui-button-underlined\",\n \"text-foreground bg-transparent border-0 border-b border-foreground rounded-none\",\n));\n\nexport const buttonEntryStyles = cva(cn(\n \"gridui-button-entry\",\n \"justify-between w-full py-gridui-16 px-gridui-24\",\n));\n\nexport const buttonCellStyles = cva(cn(\n \"gridui-button-cell\",\n \"w-full h-full justify-start rounded-none border-0 py-gridui-16 px-gridui-24 text-left\",\n));\n\nexport const buttonRailStyles = cva(cn(\n \"gridui-button-rail\",\n \"w-full min-w-gridui-24 flex-col py-gridui-8 px-0\",\n \"[&_>_span]:[writing-mode:vertical-rl] [&_>_span]:whitespace-nowrap\",\n));\n\nexport const buttonIconStyles = cva(cn(\n \"gridui-button-icon\",\n \"w-11 h-11 shrink-0 p-0\",\n \"[&.gridui-button-small]:w-9 [&.gridui-button-small]:h-9\",\n \"pointer-coarse:[&.gridui-button-small]:w-11 pointer-coarse:[&.gridui-button-small]:h-11\",\n));\n\nexport const buttonVariants = cva(buttonStyles(), {\n variants: {\n variant: {\n primary: buttonPrimaryStyles(),\n secondary: buttonSecondaryStyles(),\n quiet: buttonQuietStyles(),\n highlight: buttonHighlightStyles(),\n text: buttonTextStyles(),\n underlined: buttonUnderlinedStyles(),\n },\n size: {\n small: buttonSmallStyles(),\n standard: buttonStandardStyles(),\n },\n layout: {\n standard: \"\",\n icon: buttonIconStyles(),\n entry: buttonEntryStyles(),\n cell: buttonCellStyles(),\n rail: buttonRailStyles(),\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"standard\",\n },\n});\n\ntype ButtonStyleVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonVariants = Omit<ButtonStyleVariants, \"variant\" | \"layout\"> & (\n | {\n readonly variant: \"text\" | \"underlined\";\n readonly layout?: \"standard\" | null | undefined;\n }\n | {\n readonly variant?: Exclude<ButtonStyleVariants[\"variant\"], \"text\" | \"underlined\">;\n readonly layout?: ButtonStyleVariants[\"layout\"];\n }\n);\n\nexport const buttonClass = (variants: ButtonVariants = {}, className?: string): string => {\n return cn(buttonVariants({\n variant: variants.variant,\n size: variants.size,\n layout: variants.layout,\n }), (variants.variant === \"text\" || variants.variant === \"underlined\") && \"px-0\", className);\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Button\n * @description Button\n */\n\nimport { buttonClass, type ButtonVariants } from \"../shared/style\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & ButtonVariants & {\n readonly loading?: boolean;\n readonly startIcon?: ReactNode;\n readonly endIcon?: ReactNode;\n};\n\nexport const Button: FC<ButtonProps> = (props: ButtonProps) => {\n const {\n variant,\n size,\n layout,\n loading = false,\n disabled,\n type = \"button\",\n className,\n children,\n startIcon,\n endIcon,\n ...restProps\n } = props;\n const variants: ButtonVariants = (variant === \"text\" || variant === \"underlined\") ? {\n variant,\n size,\n layout: \"standard\",\n } : {\n variant,\n size,\n layout,\n };\n return (<button\n {...restProps}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || restProps[\"aria-busy\"]}\n className={buttonClass(variants, className)}\n >\n {startIcon !== undefined && startIcon !== null && typeof startIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {startIcon}\n </span>)}\n {children}\n {endIcon !== undefined && endIcon !== null && typeof endIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {endIcon}\n </span>)}\n </button>);\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace Button\n * @description Download\n */\n\nexport const downloadBlob = (blob: Blob, filename: string): void => {\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n link.remove();\n window.setTimeout(() => {\n URL.revokeObjectURL(url);\n }, 30000);\n};\n", "/**\n * @author WMXPY\n * @package Button\n * @namespace ButtonLink\n * @description Button Link\n */\n\nimport { buttonClass, type ButtonVariants } from \"../shared/style\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type ButtonLinkProps = ComponentPropsWithRef<\"a\"> & ButtonVariants & {\n readonly href: string;\n readonly startIcon?: ReactNode;\n readonly endIcon?: ReactNode;\n};\n\nexport const ButtonLink: FC<ButtonLinkProps> = (props: ButtonLinkProps) => {\n const {\n variant = \"secondary\",\n size,\n layout,\n className,\n children,\n startIcon,\n endIcon,\n ...restProps\n } = props;\n const variants: ButtonVariants = (variant === \"text\" || variant === \"underlined\") ? {\n variant,\n size,\n layout: \"standard\",\n } : {\n variant,\n size,\n layout,\n };\n return (<a\n {...restProps}\n className={buttonClass(variants, className)}\n >\n {startIcon !== undefined && startIcon !== null && typeof startIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {startIcon}\n </span>)}\n {children}\n {endIcon !== undefined && endIcon !== null && typeof endIcon !== \"boolean\" && (<span\n className=\"gridui-button-adornment inline-flex shrink-0 items-center pointer-events-none\"\n aria-hidden=\"true\"\n inert\n >\n {endIcon}\n </span>)}\n </a>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,QAAQ,gBAAgB;AAI1B,IAAM,qBAAqB,OAAO,EAAE,QAAQ,SAAS,gBAAgB,MAIvD;AACjB,kBAAgB,IAAI;AACpB,MAAI;AACA,UAAM,UAAU;AAChB,UAAM,IAAI,QAAc,CAAC,YAAY;AACjC,iBAAW,SAAS,CAAC;AAAA,IACzB,CAAC;AACD,UAAM,OAAO;AAAA,EACjB,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AY,eAAgB;AAAA,IAChF;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACZ,IAAI;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACA,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,WAAW,YAAY,UAAU,SAAS;AAAA,MAEzC;AAAA,sBAAc,UAAa,cAAc,QAAQ,OAAO,cAAc,aAAc,gBAAAD;AAAA,UAAC;AAAA;AAAA,YAClF,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,OAAK;AAAA,YAEJ;AAAA;AAAA,QACL;AAAA,QACC;AAAA,QACA,YAAY,UAAa,YAAY,QAAQ,OAAO,YAAY,aAAc,gBAAAA;AAAA,UAAC;AAAA;AAAA,YAC5E,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,OAAK;AAAA,YAEJ;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
|
+
"names": ["jsx", "jsxs"]
|
|
7
7
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author WMXPY
|
|
3
3
|
* @package Button
|
|
4
|
-
* @namespace
|
|
4
|
+
* @namespace Shared
|
|
5
5
|
* @description Style
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type VariantProps } from "class-variance-authority";
|
|
8
8
|
export declare const buttonStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
9
|
export declare const buttonStandardStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
10
10
|
export declare const buttonSmallStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
11
|
export declare const buttonPrimaryStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
12
|
export declare const buttonSecondaryStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
13
13
|
export declare const buttonQuietStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
export declare const buttonHighlightStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
15
|
export declare const buttonTextStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
15
16
|
export declare const buttonUnderlinedStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
16
17
|
export declare const buttonEntryStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
18
|
+
export declare const buttonCellStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
17
19
|
export declare const buttonRailStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
18
20
|
export declare const buttonIconStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
19
21
|
export declare const buttonVariants: (props?: ({
|
|
20
|
-
variant?: "primary" | "secondary" | "quiet" | "text" | "underlined" | null | undefined;
|
|
22
|
+
variant?: "primary" | "secondary" | "quiet" | "highlight" | "text" | "underlined" | null | undefined;
|
|
21
23
|
size?: "small" | "standard" | null | undefined;
|
|
22
|
-
layout?: "standard" | "icon" | "entry" | "rail" | null | undefined;
|
|
24
|
+
layout?: "standard" | "icon" | "entry" | "cell" | "rail" | null | undefined;
|
|
23
25
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
26
|
type ButtonStyleVariants = VariantProps<typeof buttonVariants>;
|
|
25
27
|
export type ButtonVariants = Omit<ButtonStyleVariants, "variant" | "layout"> & ({
|
package/dist/styles.css
CHANGED
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
.h-11 {
|
|
19
19
|
height: calc(var(--spacing) * 11);
|
|
20
20
|
}
|
|
21
|
+
.h-full {
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
21
24
|
.min-h-9 {
|
|
22
25
|
min-height: calc(var(--spacing) * 9);
|
|
23
26
|
}
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
.justify-center {
|
|
61
64
|
justify-content: center;
|
|
62
65
|
}
|
|
66
|
+
.justify-start {
|
|
67
|
+
justify-content: flex-start;
|
|
68
|
+
}
|
|
63
69
|
.gap-gridui-8 {
|
|
64
70
|
gap: var(--gridui-space-8);
|
|
65
71
|
}
|
|
@@ -100,8 +106,8 @@
|
|
|
100
106
|
.bg-accent-background {
|
|
101
107
|
background-color: var(--gridui-accent-background);
|
|
102
108
|
}
|
|
103
|
-
.bg-
|
|
104
|
-
background-color: var(--gridui-
|
|
109
|
+
.bg-surface {
|
|
110
|
+
background-color: var(--gridui-surface);
|
|
105
111
|
}
|
|
106
112
|
.bg-transparent {
|
|
107
113
|
background-color: transparent;
|
|
@@ -133,6 +139,9 @@
|
|
|
133
139
|
.text-center {
|
|
134
140
|
text-align: center;
|
|
135
141
|
}
|
|
142
|
+
.text-left {
|
|
143
|
+
text-align: left;
|
|
144
|
+
}
|
|
136
145
|
.type-ui {
|
|
137
146
|
font: var(--gridui-type-ui);
|
|
138
147
|
letter-spacing: normal;
|
package/package.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/button",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "GridUI React buttons and action helpers",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/sudo-ui/GridUI-React-Monorepo.git",
|
|
10
|
-
"directory": "packages/button"
|
|
11
|
-
},
|
|
12
7
|
"files": [
|
|
13
8
|
"dist",
|
|
14
9
|
"README.md"
|
|
@@ -27,20 +22,20 @@
|
|
|
27
22
|
"access": "public"
|
|
28
23
|
},
|
|
29
24
|
"dependencies": {
|
|
30
|
-
"@gridui/style-utils": "^2.1.
|
|
31
|
-
"@gridui/theme": "^2.
|
|
25
|
+
"@gridui/style-utils": "^2.1.3",
|
|
26
|
+
"@gridui/theme": "^2.2.1",
|
|
32
27
|
"class-variance-authority": "0.7.1"
|
|
33
28
|
},
|
|
34
29
|
"devDependencies": {
|
|
35
|
-
"@gridui-internal/configuration": "0.0.0",
|
|
30
|
+
"@gridui-internal/configuration": "0.0.0-internal",
|
|
36
31
|
"@jest/globals": "30.5.2",
|
|
37
|
-
"@storybook/react-vite": "10.6.
|
|
32
|
+
"@storybook/react-vite": "10.6.5",
|
|
38
33
|
"@types/jest": "30.0.0",
|
|
39
|
-
"@types/node": "26.6.
|
|
34
|
+
"@types/node": "26.6.6",
|
|
40
35
|
"@types/react": "19.3.0",
|
|
41
36
|
"@types/react-dom": "19.3.0",
|
|
42
37
|
"jest": "30.5.2",
|
|
43
|
-
"lucide-react": "1.
|
|
38
|
+
"lucide-react": "1.63.0",
|
|
44
39
|
"react": "19.3.1",
|
|
45
40
|
"react-dom": "19.3.1",
|
|
46
41
|
"typescript": "6.0.3"
|