@edux-design/buttons 0.1.2 → 0.1.3
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/elements/Button.jsx +4 -4
- package/src/elements/Button.test.jsx +3 -3
- package/src/elements/ButtonCounter.jsx +1 -1
- package/src/elements/IconButton.jsx +1 -1
- package/dist/chevron-EVM4GL6D.svg +0 -4
- package/dist/chunk-M47FNL4P.mjs +0 -10
- package/dist/elements/Button.js +0 -39
- package/dist/elements/Button.mjs +0 -6
- package/dist/index.d.mts +0 -230
- package/dist/index.d.ts +0 -230
- package/dist/index.js +0 -803
- package/dist/index.mjs +0 -777
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/elements/Button.jsx
CHANGED
|
@@ -85,16 +85,16 @@ export const Button = forwardRef(
|
|
|
85
85
|
"text-bold tracking-normal hover:underline hover:underline-offset-(--underline-offset-btn) active:underline active:underline-offset-(--underline-offset-btn)";
|
|
86
86
|
|
|
87
87
|
const sizes = {
|
|
88
|
-
small: "h-
|
|
89
|
-
medium: "h-
|
|
90
|
-
large: "h-
|
|
88
|
+
small: "h-control-sm py-8 px-16 rounded-lg text-sm",
|
|
89
|
+
medium: "h-control-md py-8 px-16 rounded-lg text-base",
|
|
90
|
+
large: "h-control-lg py-8 px-16 rounded-lg text-lg",
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
const width = isStretched ? "w-full" : "w-fit-content";
|
|
94
94
|
|
|
95
95
|
const variants = {
|
|
96
96
|
primary:
|
|
97
|
-
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus
|
|
97
|
+
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus hover:text-fg-focus hover:border-border-emphasis hover:shadow-md active:bg-border-focus active:bg-bg-focus-overlay active:text-fg-focus",
|
|
98
98
|
secondary:
|
|
99
99
|
"border-2 border-border-primary-base bg-bg-base text-fg-primary-emphasis hover:shadow-md hover:bg-bg-primary-subtle active:bg-bg-primary-subtle-90",
|
|
100
100
|
bare: "bg-bg-base text-fg-primary-emphasis hover:bg-bg-minimal active:bg-bg-minimal-5",
|
|
@@ -11,17 +11,17 @@ describe("Button", () => {
|
|
|
11
11
|
it("applies medium size by default", () => {
|
|
12
12
|
render(<Button>Default size</Button>);
|
|
13
13
|
const btn = screen.getByRole("button");
|
|
14
|
-
expect(btn.className).toMatch(/h
|
|
14
|
+
expect(btn.className).toMatch(/h-control-md/);
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
it("applies small size when size='small'", () => {
|
|
18
18
|
render(<Button size="small">Small</Button>);
|
|
19
|
-
expect(screen.getByRole("button").className).toMatch(/h
|
|
19
|
+
expect(screen.getByRole("button").className).toMatch(/h-control-sm/);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it("applies large size when size='large'", () => {
|
|
23
23
|
render(<Button size="large">Large</Button>);
|
|
24
|
-
expect(screen.getByRole("button").className).toMatch(/h
|
|
24
|
+
expect(screen.getByRole("button").className).toMatch(/h-control-lg/);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
it("uses stretched width when isStretched=true", () => {
|
|
@@ -147,7 +147,7 @@ export const ButtonCounter = forwardRef(function ButtonCounter(
|
|
|
147
147
|
const variants = {
|
|
148
148
|
primary: {
|
|
149
149
|
button:
|
|
150
|
-
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus hover:text-fg-
|
|
150
|
+
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus hover:text-fg-focus hover:border-border-emphasis hover:shadow-md active:bg-border-focus active:bg-bg-focus-overlay active:text-fg-focus",
|
|
151
151
|
display:
|
|
152
152
|
"border-y-2 border-x-2 border-border-primary-emphasis bg-bg-primary-base text-white",
|
|
153
153
|
},
|
|
@@ -75,7 +75,7 @@ export const IconButton = forwardRef(
|
|
|
75
75
|
|
|
76
76
|
const variants = {
|
|
77
77
|
primary:
|
|
78
|
-
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus hover:text-fg-
|
|
78
|
+
"border-2 border-border-primary-emphasis bg-bg-primary-base text-white hover:bg-border-focus hover:text-fg-focus hover:border-border-emphasis hover:shadow-md active:bg-border-focus active:bg-bg-focus-overlay active:text-fg-focus",
|
|
79
79
|
secondary:
|
|
80
80
|
"border-2 border-border-primary-base bg-bg-base text-fg-primary-emphasis hover:shadow-md hover:bg-bg-primary-subtle active:bg-bg-primary-subtle-90",
|
|
81
81
|
bare: "bg-bg-base text-fg-primary-emphasis hover:bg-bg-minimal active:bg-bg-minimal-5",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5858 12L9.29289 7.70711C8.90237 7.31658 8.90237 6.68342 9.29289 6.29289C9.68342 5.90237 10.3166 5.90237 10.7071 6.29289L15.7071 11.2929C16.0976 11.6834 16.0976 12.3166 15.7071 12.7071L10.7071 17.7071C10.3166 18.0976 9.68342 18.0976 9.29289 17.7071C8.90237 17.3166 8.90237 16.6834 9.29289 16.2929L13.5858 12Z" fill="currentColor"/>
|
|
4
|
-
</svg>
|
package/dist/chunk-M47FNL4P.mjs
DELETED
package/dist/elements/Button.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/elements/Button.jsx
|
|
30
|
-
var Button_exports = {};
|
|
31
|
-
__export(Button_exports, {
|
|
32
|
-
default: () => Button_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Button_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
function Button() {
|
|
37
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "border-2 border-primary-700" }, "Button");
|
|
38
|
-
}
|
|
39
|
-
var Button_default = Button;
|
package/dist/elements/Button.mjs
DELETED
package/dist/index.d.mts
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Props for the IconButton component.
|
|
6
|
-
*
|
|
7
|
-
* Extends all native HTML `<button>` attributes and accepts an icon prop.
|
|
8
|
-
* Designed for circular icon-only buttons that follow the same
|
|
9
|
-
* design-system patterns as the regular Button.
|
|
10
|
-
*
|
|
11
|
-
* @typedef {React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
12
|
-
* icon: React.ReactNode,
|
|
13
|
-
* size?: "small"|"medium"|"large",
|
|
14
|
-
* isSecondary?: boolean,
|
|
15
|
-
* isDanger?: boolean,
|
|
16
|
-
* isBare?: boolean,
|
|
17
|
-
* disabled?: boolean,
|
|
18
|
-
* className?: string
|
|
19
|
-
* }} IconButtonProps
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* IconButton component.
|
|
23
|
-
*
|
|
24
|
-
* Provides a circular button used for icon-only actions, matching
|
|
25
|
-
* the design-system variants and states of the main Button component.
|
|
26
|
-
*
|
|
27
|
-
* @component
|
|
28
|
-
* @type {React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>}
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```jsx
|
|
32
|
-
* <IconButton icon={<XIcon />} aria-label="Close" />
|
|
33
|
-
* <IconButton icon={<EditIcon />} isSecondary />
|
|
34
|
-
* <IconButton icon={<TrashIcon />} isDanger disabled />
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
-
/**
|
|
39
|
-
* Props for the IconButton component.
|
|
40
|
-
*
|
|
41
|
-
* Extends all native HTML `<button>` attributes and accepts an icon prop.
|
|
42
|
-
* Designed for circular icon-only buttons that follow the same
|
|
43
|
-
* design-system patterns as the regular Button.
|
|
44
|
-
*/
|
|
45
|
-
type IconButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
46
|
-
icon: React.ReactNode;
|
|
47
|
-
size?: "small" | "medium" | "large";
|
|
48
|
-
isSecondary?: boolean;
|
|
49
|
-
isDanger?: boolean;
|
|
50
|
-
isBare?: boolean;
|
|
51
|
-
disabled?: boolean;
|
|
52
|
-
className?: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Props for the Button component.
|
|
57
|
-
*
|
|
58
|
-
* Extends all native HTML `<button>` attributes, while adding
|
|
59
|
-
* design-system variants and state controls.
|
|
60
|
-
*
|
|
61
|
-
* @typedef {React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
62
|
-
* children?: React.ReactNode,
|
|
63
|
-
* startIcon?: React.ReactNode,
|
|
64
|
-
* endIcon?: React.ReactNode,
|
|
65
|
-
* size?: "small"|"medium"|"large",
|
|
66
|
-
* isSecondary?: boolean,
|
|
67
|
-
* isDanger?: boolean,
|
|
68
|
-
* isBare?: boolean,
|
|
69
|
-
* isStretched?: boolean,
|
|
70
|
-
* disabled?: boolean,
|
|
71
|
-
* className?: string
|
|
72
|
-
* }} ButtonProps
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* Button component.
|
|
76
|
-
*
|
|
77
|
-
* Provides design-system styled button with support for
|
|
78
|
-
* multiple visual variants, sizing, and states.
|
|
79
|
-
*
|
|
80
|
-
* @component
|
|
81
|
-
* @type {React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>}
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```jsx
|
|
85
|
-
* <Button size="small">Save</Button>
|
|
86
|
-
* <Button isSecondary>Cancel</Button>
|
|
87
|
-
* <Button isDanger disabled>Delete</Button>
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
91
|
-
/**
|
|
92
|
-
* Props for the Button component.
|
|
93
|
-
*
|
|
94
|
-
* Extends all native HTML `<button>` attributes, while adding
|
|
95
|
-
* design-system variants and state controls.
|
|
96
|
-
*/
|
|
97
|
-
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
98
|
-
children?: React.ReactNode;
|
|
99
|
-
startIcon?: React.ReactNode;
|
|
100
|
-
endIcon?: React.ReactNode;
|
|
101
|
-
size?: "small" | "medium" | "large";
|
|
102
|
-
isSecondary?: boolean;
|
|
103
|
-
isDanger?: boolean;
|
|
104
|
-
isBare?: boolean;
|
|
105
|
-
isStretched?: boolean;
|
|
106
|
-
disabled?: boolean;
|
|
107
|
-
className?: string;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Props for the MenuButton component.
|
|
112
|
-
*
|
|
113
|
-
* @typedef {Object} MenuButtonProps
|
|
114
|
-
* @property {React.ReactNode} [children] - Content to display inside the button (usually label or icon).
|
|
115
|
-
* @property {"small"|"medium"} [size="medium"] - Size variant controlling button height.
|
|
116
|
-
*/
|
|
117
|
-
/**
|
|
118
|
-
* MenuButton component.
|
|
119
|
-
*
|
|
120
|
-
* Provides a styled menu trigger button with optional sizing.
|
|
121
|
-
* It uses a `MenuButtonContext` provider to share internal state
|
|
122
|
-
* with child menu items.
|
|
123
|
-
*
|
|
124
|
-
* @component
|
|
125
|
-
* @type {React.FC<MenuButtonProps>}
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```jsx
|
|
129
|
-
* <MenuButton size="small">Options</MenuButton>
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
declare function MenuButton({ children, size }: {
|
|
133
|
-
children: any;
|
|
134
|
-
size: any;
|
|
135
|
-
}): react_jsx_runtime.JSX.Element;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @typedef {Object} ButtonGroupOption
|
|
139
|
-
* @property {React.ReactNode} [label] - Main label for the option.
|
|
140
|
-
* @property {React.ReactNode} [startAdornment] - Optional leading element (icon, badge, etc.).
|
|
141
|
-
* @property {React.ReactNode} [endIcon] - Optional trailing element (legacy alias).
|
|
142
|
-
* @property {React.ReactNode} [endAdornment] - Optional trailing element.
|
|
143
|
-
* @property {string|number} [value] - Unique value used for selection.
|
|
144
|
-
* @property {boolean} [disabled] - Whether the option is disabled.
|
|
145
|
-
*/
|
|
146
|
-
/**
|
|
147
|
-
* Segmented button group with animated active state.
|
|
148
|
-
*
|
|
149
|
-
* @typedef {React.HTMLAttributes<HTMLDivElement> & {
|
|
150
|
-
* value?: string|number,
|
|
151
|
-
* defaultValue?: string|number,
|
|
152
|
-
* onChange?: (value: string|number, option: ButtonGroupOption) => void,
|
|
153
|
-
* size?: "small"|"medium"|"large",
|
|
154
|
-
* isStretched?: boolean,
|
|
155
|
-
* }} ButtonGroupProps
|
|
156
|
-
*/
|
|
157
|
-
declare const ButtonGroup: react.ForwardRefExoticComponent<react.RefAttributes<any>>;
|
|
158
|
-
|
|
159
|
-
declare function ButtonGroupItem(_props: any): any;
|
|
160
|
-
declare namespace ButtonGroupItem {
|
|
161
|
-
let displayName: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* ButtonCounter (stepper) component.
|
|
166
|
-
*
|
|
167
|
-
* Renders decrement/increment buttons with a central value display.
|
|
168
|
-
* Supports the same size + variant flags as the main Button.
|
|
169
|
-
*
|
|
170
|
-
* @typedef {React.HTMLAttributes<HTMLDivElement> & {
|
|
171
|
-
* value?: number,
|
|
172
|
-
* defaultValue?: number,
|
|
173
|
-
* onChange?: (value: number) => void,
|
|
174
|
-
* min?: number,
|
|
175
|
-
* max?: number,
|
|
176
|
-
* step?: number,
|
|
177
|
-
* children?: React.ReactNode,
|
|
178
|
-
* size?: "small"|"medium"|"large",
|
|
179
|
-
* isSecondary?: boolean,
|
|
180
|
-
* isDanger?: boolean,
|
|
181
|
-
* isBare?: boolean,
|
|
182
|
-
* isStretched?: boolean,
|
|
183
|
-
* disabled?: boolean,
|
|
184
|
-
* isEditable?: boolean,
|
|
185
|
-
* inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "value"|"defaultValue"|"onChange"|"type">,
|
|
186
|
-
* decrementIcon?: React.ReactNode,
|
|
187
|
-
* incrementIcon?: React.ReactNode,
|
|
188
|
-
* startIcon?: React.ReactNode,
|
|
189
|
-
* endIcon?: React.ReactNode,
|
|
190
|
-
* decrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
191
|
-
* incrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
192
|
-
* className?: string,
|
|
193
|
-
* }} ButtonCounterProps
|
|
194
|
-
*/
|
|
195
|
-
/**
|
|
196
|
-
* @type {React.ForwardRefExoticComponent<ButtonCounterProps & React.RefAttributes<HTMLDivElement>>}
|
|
197
|
-
*/
|
|
198
|
-
declare const ButtonCounter: React.ForwardRefExoticComponent<ButtonCounterProps & React.RefAttributes<HTMLDivElement>>;
|
|
199
|
-
/**
|
|
200
|
-
* ButtonCounter (stepper) component.
|
|
201
|
-
*
|
|
202
|
-
* Renders decrement/increment buttons with a central value display.
|
|
203
|
-
* Supports the same size + variant flags as the main Button.
|
|
204
|
-
*/
|
|
205
|
-
type ButtonCounterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
206
|
-
value?: number;
|
|
207
|
-
defaultValue?: number;
|
|
208
|
-
onChange?: (value: number) => void;
|
|
209
|
-
min?: number;
|
|
210
|
-
max?: number;
|
|
211
|
-
step?: number;
|
|
212
|
-
children?: React.ReactNode;
|
|
213
|
-
size?: "small" | "medium" | "large";
|
|
214
|
-
isSecondary?: boolean;
|
|
215
|
-
isDanger?: boolean;
|
|
216
|
-
isBare?: boolean;
|
|
217
|
-
isStretched?: boolean;
|
|
218
|
-
disabled?: boolean;
|
|
219
|
-
isEditable?: boolean;
|
|
220
|
-
inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type">;
|
|
221
|
-
decrementIcon?: React.ReactNode;
|
|
222
|
-
incrementIcon?: React.ReactNode;
|
|
223
|
-
startIcon?: React.ReactNode;
|
|
224
|
-
endIcon?: React.ReactNode;
|
|
225
|
-
decrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
226
|
-
incrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
227
|
-
className?: string;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export { Button, ButtonCounter, ButtonGroup, ButtonGroupItem, IconButton, MenuButton };
|
package/dist/index.d.ts
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Props for the IconButton component.
|
|
6
|
-
*
|
|
7
|
-
* Extends all native HTML `<button>` attributes and accepts an icon prop.
|
|
8
|
-
* Designed for circular icon-only buttons that follow the same
|
|
9
|
-
* design-system patterns as the regular Button.
|
|
10
|
-
*
|
|
11
|
-
* @typedef {React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
12
|
-
* icon: React.ReactNode,
|
|
13
|
-
* size?: "small"|"medium"|"large",
|
|
14
|
-
* isSecondary?: boolean,
|
|
15
|
-
* isDanger?: boolean,
|
|
16
|
-
* isBare?: boolean,
|
|
17
|
-
* disabled?: boolean,
|
|
18
|
-
* className?: string
|
|
19
|
-
* }} IconButtonProps
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* IconButton component.
|
|
23
|
-
*
|
|
24
|
-
* Provides a circular button used for icon-only actions, matching
|
|
25
|
-
* the design-system variants and states of the main Button component.
|
|
26
|
-
*
|
|
27
|
-
* @component
|
|
28
|
-
* @type {React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>}
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```jsx
|
|
32
|
-
* <IconButton icon={<XIcon />} aria-label="Close" />
|
|
33
|
-
* <IconButton icon={<EditIcon />} isSecondary />
|
|
34
|
-
* <IconButton icon={<TrashIcon />} isDanger disabled />
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
-
/**
|
|
39
|
-
* Props for the IconButton component.
|
|
40
|
-
*
|
|
41
|
-
* Extends all native HTML `<button>` attributes and accepts an icon prop.
|
|
42
|
-
* Designed for circular icon-only buttons that follow the same
|
|
43
|
-
* design-system patterns as the regular Button.
|
|
44
|
-
*/
|
|
45
|
-
type IconButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
46
|
-
icon: React.ReactNode;
|
|
47
|
-
size?: "small" | "medium" | "large";
|
|
48
|
-
isSecondary?: boolean;
|
|
49
|
-
isDanger?: boolean;
|
|
50
|
-
isBare?: boolean;
|
|
51
|
-
disabled?: boolean;
|
|
52
|
-
className?: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Props for the Button component.
|
|
57
|
-
*
|
|
58
|
-
* Extends all native HTML `<button>` attributes, while adding
|
|
59
|
-
* design-system variants and state controls.
|
|
60
|
-
*
|
|
61
|
-
* @typedef {React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
62
|
-
* children?: React.ReactNode,
|
|
63
|
-
* startIcon?: React.ReactNode,
|
|
64
|
-
* endIcon?: React.ReactNode,
|
|
65
|
-
* size?: "small"|"medium"|"large",
|
|
66
|
-
* isSecondary?: boolean,
|
|
67
|
-
* isDanger?: boolean,
|
|
68
|
-
* isBare?: boolean,
|
|
69
|
-
* isStretched?: boolean,
|
|
70
|
-
* disabled?: boolean,
|
|
71
|
-
* className?: string
|
|
72
|
-
* }} ButtonProps
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* Button component.
|
|
76
|
-
*
|
|
77
|
-
* Provides design-system styled button with support for
|
|
78
|
-
* multiple visual variants, sizing, and states.
|
|
79
|
-
*
|
|
80
|
-
* @component
|
|
81
|
-
* @type {React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>}
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```jsx
|
|
85
|
-
* <Button size="small">Save</Button>
|
|
86
|
-
* <Button isSecondary>Cancel</Button>
|
|
87
|
-
* <Button isDanger disabled>Delete</Button>
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
91
|
-
/**
|
|
92
|
-
* Props for the Button component.
|
|
93
|
-
*
|
|
94
|
-
* Extends all native HTML `<button>` attributes, while adding
|
|
95
|
-
* design-system variants and state controls.
|
|
96
|
-
*/
|
|
97
|
-
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
98
|
-
children?: React.ReactNode;
|
|
99
|
-
startIcon?: React.ReactNode;
|
|
100
|
-
endIcon?: React.ReactNode;
|
|
101
|
-
size?: "small" | "medium" | "large";
|
|
102
|
-
isSecondary?: boolean;
|
|
103
|
-
isDanger?: boolean;
|
|
104
|
-
isBare?: boolean;
|
|
105
|
-
isStretched?: boolean;
|
|
106
|
-
disabled?: boolean;
|
|
107
|
-
className?: string;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Props for the MenuButton component.
|
|
112
|
-
*
|
|
113
|
-
* @typedef {Object} MenuButtonProps
|
|
114
|
-
* @property {React.ReactNode} [children] - Content to display inside the button (usually label or icon).
|
|
115
|
-
* @property {"small"|"medium"} [size="medium"] - Size variant controlling button height.
|
|
116
|
-
*/
|
|
117
|
-
/**
|
|
118
|
-
* MenuButton component.
|
|
119
|
-
*
|
|
120
|
-
* Provides a styled menu trigger button with optional sizing.
|
|
121
|
-
* It uses a `MenuButtonContext` provider to share internal state
|
|
122
|
-
* with child menu items.
|
|
123
|
-
*
|
|
124
|
-
* @component
|
|
125
|
-
* @type {React.FC<MenuButtonProps>}
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```jsx
|
|
129
|
-
* <MenuButton size="small">Options</MenuButton>
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
declare function MenuButton({ children, size }: {
|
|
133
|
-
children: any;
|
|
134
|
-
size: any;
|
|
135
|
-
}): react_jsx_runtime.JSX.Element;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @typedef {Object} ButtonGroupOption
|
|
139
|
-
* @property {React.ReactNode} [label] - Main label for the option.
|
|
140
|
-
* @property {React.ReactNode} [startAdornment] - Optional leading element (icon, badge, etc.).
|
|
141
|
-
* @property {React.ReactNode} [endIcon] - Optional trailing element (legacy alias).
|
|
142
|
-
* @property {React.ReactNode} [endAdornment] - Optional trailing element.
|
|
143
|
-
* @property {string|number} [value] - Unique value used for selection.
|
|
144
|
-
* @property {boolean} [disabled] - Whether the option is disabled.
|
|
145
|
-
*/
|
|
146
|
-
/**
|
|
147
|
-
* Segmented button group with animated active state.
|
|
148
|
-
*
|
|
149
|
-
* @typedef {React.HTMLAttributes<HTMLDivElement> & {
|
|
150
|
-
* value?: string|number,
|
|
151
|
-
* defaultValue?: string|number,
|
|
152
|
-
* onChange?: (value: string|number, option: ButtonGroupOption) => void,
|
|
153
|
-
* size?: "small"|"medium"|"large",
|
|
154
|
-
* isStretched?: boolean,
|
|
155
|
-
* }} ButtonGroupProps
|
|
156
|
-
*/
|
|
157
|
-
declare const ButtonGroup: react.ForwardRefExoticComponent<react.RefAttributes<any>>;
|
|
158
|
-
|
|
159
|
-
declare function ButtonGroupItem(_props: any): any;
|
|
160
|
-
declare namespace ButtonGroupItem {
|
|
161
|
-
let displayName: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* ButtonCounter (stepper) component.
|
|
166
|
-
*
|
|
167
|
-
* Renders decrement/increment buttons with a central value display.
|
|
168
|
-
* Supports the same size + variant flags as the main Button.
|
|
169
|
-
*
|
|
170
|
-
* @typedef {React.HTMLAttributes<HTMLDivElement> & {
|
|
171
|
-
* value?: number,
|
|
172
|
-
* defaultValue?: number,
|
|
173
|
-
* onChange?: (value: number) => void,
|
|
174
|
-
* min?: number,
|
|
175
|
-
* max?: number,
|
|
176
|
-
* step?: number,
|
|
177
|
-
* children?: React.ReactNode,
|
|
178
|
-
* size?: "small"|"medium"|"large",
|
|
179
|
-
* isSecondary?: boolean,
|
|
180
|
-
* isDanger?: boolean,
|
|
181
|
-
* isBare?: boolean,
|
|
182
|
-
* isStretched?: boolean,
|
|
183
|
-
* disabled?: boolean,
|
|
184
|
-
* isEditable?: boolean,
|
|
185
|
-
* inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "value"|"defaultValue"|"onChange"|"type">,
|
|
186
|
-
* decrementIcon?: React.ReactNode,
|
|
187
|
-
* incrementIcon?: React.ReactNode,
|
|
188
|
-
* startIcon?: React.ReactNode,
|
|
189
|
-
* endIcon?: React.ReactNode,
|
|
190
|
-
* decrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
191
|
-
* incrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
192
|
-
* className?: string,
|
|
193
|
-
* }} ButtonCounterProps
|
|
194
|
-
*/
|
|
195
|
-
/**
|
|
196
|
-
* @type {React.ForwardRefExoticComponent<ButtonCounterProps & React.RefAttributes<HTMLDivElement>>}
|
|
197
|
-
*/
|
|
198
|
-
declare const ButtonCounter: React.ForwardRefExoticComponent<ButtonCounterProps & React.RefAttributes<HTMLDivElement>>;
|
|
199
|
-
/**
|
|
200
|
-
* ButtonCounter (stepper) component.
|
|
201
|
-
*
|
|
202
|
-
* Renders decrement/increment buttons with a central value display.
|
|
203
|
-
* Supports the same size + variant flags as the main Button.
|
|
204
|
-
*/
|
|
205
|
-
type ButtonCounterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
206
|
-
value?: number;
|
|
207
|
-
defaultValue?: number;
|
|
208
|
-
onChange?: (value: number) => void;
|
|
209
|
-
min?: number;
|
|
210
|
-
max?: number;
|
|
211
|
-
step?: number;
|
|
212
|
-
children?: React.ReactNode;
|
|
213
|
-
size?: "small" | "medium" | "large";
|
|
214
|
-
isSecondary?: boolean;
|
|
215
|
-
isDanger?: boolean;
|
|
216
|
-
isBare?: boolean;
|
|
217
|
-
isStretched?: boolean;
|
|
218
|
-
disabled?: boolean;
|
|
219
|
-
isEditable?: boolean;
|
|
220
|
-
inputProps?: Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type">;
|
|
221
|
-
decrementIcon?: React.ReactNode;
|
|
222
|
-
incrementIcon?: React.ReactNode;
|
|
223
|
-
startIcon?: React.ReactNode;
|
|
224
|
-
endIcon?: React.ReactNode;
|
|
225
|
-
decrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
226
|
-
incrementButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
227
|
-
className?: string;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export { Button, ButtonCounter, ButtonGroup, ButtonGroupItem, IconButton, MenuButton };
|