@hanzogui/button 3.0.3 → 7.0.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/package.json +17 -17
- package/src/Button.test.tsx +5 -5
- package/src/Button.tsx +5 -5
- package/src/v1/Button.test.tsx +5 -5
- package/src/v1/Button.tsx +7 -7
- package/types/Button.d.ts +17 -17
- package/types/v1/Button.d.ts +26 -26
- package/dist/cjs/Button.cjs +0 -218
- package/dist/cjs/Button.native.js +0 -224
- package/dist/cjs/Button.native.js.map +0 -1
- package/dist/cjs/Button.test.cjs +0 -36
- package/dist/cjs/Button.test.native.js +0 -39
- package/dist/cjs/Button.test.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -18
- package/dist/cjs/index.native.js +0 -21
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/cjs/v1/Button.cjs +0 -259
- package/dist/cjs/v1/Button.native.js +0 -265
- package/dist/cjs/v1/Button.native.js.map +0 -1
- package/dist/cjs/v1/Button.test.cjs +0 -9
- package/dist/cjs/v1/Button.test.native.js +0 -12
- package/dist/cjs/v1/Button.test.native.js.map +0 -1
- package/dist/cjs/v1/index.cjs +0 -18
- package/dist/cjs/v1/index.native.js +0 -21
- package/dist/cjs/v1/index.native.js.map +0 -1
- package/dist/esm/Button.mjs +0 -194
- package/dist/esm/Button.mjs.map +0 -1
- package/dist/esm/Button.native.js +0 -197
- package/dist/esm/Button.native.js.map +0 -1
- package/dist/esm/Button.test.mjs +0 -37
- package/dist/esm/Button.test.mjs.map +0 -1
- package/dist/esm/Button.test.native.js +0 -37
- package/dist/esm/Button.test.native.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -2
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/v1/Button.mjs +0 -231
- package/dist/esm/v1/Button.mjs.map +0 -1
- package/dist/esm/v1/Button.native.js +0 -234
- package/dist/esm/v1/Button.native.js.map +0 -1
- package/dist/esm/v1/Button.test.mjs +0 -10
- package/dist/esm/v1/Button.test.mjs.map +0 -1
- package/dist/esm/v1/Button.test.native.js +0 -10
- package/dist/esm/v1/Button.test.native.js.map +0 -1
- package/dist/esm/v1/index.mjs +0 -2
- package/dist/esm/v1/index.mjs.map +0 -1
- package/dist/esm/v1/index.native.js +0 -2
- package/dist/esm/v1/index.native.js.map +0 -1
- package/dist/jsx/Button.mjs +0 -194
- package/dist/jsx/Button.mjs.map +0 -1
- package/dist/jsx/Button.native.js +0 -224
- package/dist/jsx/Button.native.js.map +0 -1
- package/dist/jsx/Button.test.mjs +0 -37
- package/dist/jsx/Button.test.mjs.map +0 -1
- package/dist/jsx/Button.test.native.js +0 -39
- package/dist/jsx/Button.test.native.js.map +0 -1
- package/dist/jsx/index.js +0 -2
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs +0 -2
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -21
- package/dist/jsx/index.native.js.map +0 -1
- package/dist/jsx/v1/Button.mjs +0 -231
- package/dist/jsx/v1/Button.mjs.map +0 -1
- package/dist/jsx/v1/Button.native.js +0 -265
- package/dist/jsx/v1/Button.native.js.map +0 -1
- package/dist/jsx/v1/Button.test.mjs +0 -10
- package/dist/jsx/v1/Button.test.mjs.map +0 -1
- package/dist/jsx/v1/Button.test.native.js +0 -12
- package/dist/jsx/v1/Button.test.native.js.map +0 -1
- package/dist/jsx/v1/index.mjs +0 -2
- package/dist/jsx/v1/index.mjs.map +0 -1
- package/dist/jsx/v1/index.native.js +0 -21
- package/dist/jsx/v1/index.native.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/button",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -31,25 +31,25 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "
|
|
35
|
-
"watch": "
|
|
36
|
-
"clean": "
|
|
37
|
-
"clean:build": "
|
|
34
|
+
"build": "hanzogui-build",
|
|
35
|
+
"watch": "hanzogui-build --watch",
|
|
36
|
+
"clean": "hanzogui-build clean",
|
|
37
|
+
"clean:build": "hanzogui-build clean:build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hanzogui/config-default": "
|
|
41
|
-
"@hanzogui/core": "
|
|
42
|
-
"@hanzogui/get-button-sized": "
|
|
43
|
-
"@hanzogui/helpers": "
|
|
44
|
-
"@hanzogui/
|
|
45
|
-
"@hanzogui/
|
|
46
|
-
"@hanzogui/
|
|
47
|
-
"@hanzogui/
|
|
48
|
-
"@hanzogui/
|
|
49
|
-
"@hanzogui/
|
|
40
|
+
"@hanzogui/config-default": "^7.0.0",
|
|
41
|
+
"@hanzogui/core": "^7.0.0",
|
|
42
|
+
"@hanzogui/get-button-sized": "^7.0.0",
|
|
43
|
+
"@hanzogui/helpers": "^7.0.0",
|
|
44
|
+
"@hanzogui/component-helpers": "^7.0.0",
|
|
45
|
+
"@hanzogui/spacer": "^7.0.0",
|
|
46
|
+
"@hanzogui/stacks": "^7.0.0",
|
|
47
|
+
"@hanzogui/text": "^7.0.0",
|
|
48
|
+
"@hanzogui/font-size": "^7.0.0",
|
|
49
|
+
"@hanzogui/web": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@hanzogui/build": "
|
|
52
|
+
"@hanzogui/build": "^7.0.0",
|
|
53
53
|
"react": ">=19",
|
|
54
54
|
"vitest": "4.0.4"
|
|
55
55
|
},
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"react": ">=19"
|
|
58
58
|
},
|
|
59
59
|
"module:jsx": "dist/jsx"
|
|
60
|
-
}
|
|
60
|
+
}
|
package/src/Button.test.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getDefaultHanzoguiConfig } from '@hanzogui/config-default'
|
|
2
|
+
import { createHanzogui } from '@hanzogui/core'
|
|
3
3
|
import { describe, expect, test } from 'vitest'
|
|
4
4
|
import { Button } from './Button'
|
|
5
5
|
|
|
6
|
-
const conf =
|
|
6
|
+
const conf = createHanzogui(getDefaultHanzoguiConfig())
|
|
7
7
|
|
|
8
8
|
describe('Button', () => {
|
|
9
9
|
test(`123`, () => {
|
|
@@ -35,9 +35,9 @@ describe('Button', () => {
|
|
|
35
35
|
|
|
36
36
|
// test(`Adapts to a when given accessibilityRole="link"`, async () => {
|
|
37
37
|
// const { container } = render(
|
|
38
|
-
// <
|
|
38
|
+
// <HanzoguiProvider config={conf} defaultTheme="light">
|
|
39
39
|
// <Button href="http://google.com" accessibilityRole="link" />
|
|
40
|
-
// </
|
|
40
|
+
// </HanzoguiProvider>
|
|
41
41
|
// )
|
|
42
42
|
|
|
43
43
|
// expect(container.firstChild).toMatchSnapshot()
|
package/src/Button.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getFontSize } from '@hanzogui/font-size'
|
|
2
2
|
import { getButtonSized } from '@hanzogui/get-button-sized'
|
|
3
|
-
import { getIcon, useCurrentColor } from '@hanzogui/helpers'
|
|
3
|
+
import { getIcon, useCurrentColor } from '@hanzogui/component-helpers'
|
|
4
4
|
import { ButtonNestingContext, getElevation, themeableVariants } from '@hanzogui/stacks'
|
|
5
5
|
import { SizableText, wrapChildrenInText } from '@hanzogui/text'
|
|
6
6
|
import type { ColorTokens, GetProps, SizeTokens, Token } from '@hanzogui/web'
|
|
@@ -69,7 +69,7 @@ const Frame = styled(View, {
|
|
|
69
69
|
|
|
70
70
|
variant: {
|
|
71
71
|
outlined:
|
|
72
|
-
process.env.
|
|
72
|
+
process.env.HANZOGUI_HEADLESS === '1'
|
|
73
73
|
? {}
|
|
74
74
|
: {
|
|
75
75
|
backgroundColor: 'transparent',
|
|
@@ -126,7 +126,7 @@ const Frame = styled(View, {
|
|
|
126
126
|
} as const,
|
|
127
127
|
|
|
128
128
|
defaultVariants: {
|
|
129
|
-
unstyled: process.env.
|
|
129
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
130
130
|
},
|
|
131
131
|
})
|
|
132
132
|
|
|
@@ -148,7 +148,7 @@ const Text = styled(SizableText, {
|
|
|
148
148
|
} as const,
|
|
149
149
|
|
|
150
150
|
defaultVariants: {
|
|
151
|
-
unstyled: process.env.
|
|
151
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
152
152
|
},
|
|
153
153
|
})
|
|
154
154
|
|
|
@@ -239,7 +239,7 @@ const ButtonComponent = Frame.styleable<ButtonExtraProps>((propsIn, ref) => {
|
|
|
239
239
|
Text,
|
|
240
240
|
{ children },
|
|
241
241
|
{
|
|
242
|
-
unstyled: process.env.
|
|
242
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
243
243
|
size: finalSize ?? styledContext?.size,
|
|
244
244
|
}
|
|
245
245
|
)
|
package/src/v1/Button.test.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getDefaultHanzoguiConfig } from '@hanzogui/config-default'
|
|
2
|
+
import { createHanzogui } from '@hanzogui/core'
|
|
3
3
|
import { describe, expect, test } from 'vitest'
|
|
4
4
|
|
|
5
|
-
const conf =
|
|
5
|
+
const conf = createHanzogui(getDefaultHanzoguiConfig())
|
|
6
6
|
|
|
7
7
|
describe('Button', () => {
|
|
8
8
|
test(`123`, () => {
|
|
@@ -11,9 +11,9 @@ describe('Button', () => {
|
|
|
11
11
|
|
|
12
12
|
// test(`Adapts to a when given accessibilityRole="link"`, async () => {
|
|
13
13
|
// const { container } = render(
|
|
14
|
-
// <
|
|
14
|
+
// <HanzoguiProvider config={conf} defaultTheme="light">
|
|
15
15
|
// <Button href="http://google.com" accessibilityRole="link" />
|
|
16
|
-
// </
|
|
16
|
+
// </HanzoguiProvider>
|
|
17
17
|
// )
|
|
18
18
|
|
|
19
19
|
// expect(container.firstChild).toMatchSnapshot()
|
package/src/v1/Button.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getFontSize } from '@hanzogui/font-size'
|
|
2
2
|
import { getButtonSized } from '@hanzogui/get-button-sized'
|
|
3
3
|
import { withStaticProperties } from '@hanzogui/helpers'
|
|
4
|
-
import { useGetThemedIcon } from '@hanzogui/helpers'
|
|
4
|
+
import { useGetThemedIcon } from '@hanzogui/component-helpers'
|
|
5
5
|
import { ButtonNestingContext, ThemeableStack } from '@hanzogui/stacks'
|
|
6
6
|
import type { TextContextStyles, TextParentStyles } from '@hanzogui/text'
|
|
7
7
|
import { SizableText, wrapChildrenInText } from '@hanzogui/text'
|
|
@@ -142,7 +142,7 @@ const ButtonFrame = styled(ThemeableStack, {
|
|
|
142
142
|
} as const,
|
|
143
143
|
|
|
144
144
|
defaultVariants: {
|
|
145
|
-
unstyled: process.env.
|
|
145
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
146
146
|
},
|
|
147
147
|
})
|
|
148
148
|
|
|
@@ -165,7 +165,7 @@ const ButtonText = styled(SizableText, {
|
|
|
165
165
|
} as const,
|
|
166
166
|
|
|
167
167
|
defaultVariants: {
|
|
168
|
-
unstyled: process.env.
|
|
168
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
169
169
|
},
|
|
170
170
|
})
|
|
171
171
|
|
|
@@ -191,7 +191,7 @@ const ButtonComponent = ButtonFrame.styleable<ButtonExtraProps>(
|
|
|
191
191
|
)
|
|
192
192
|
/**
|
|
193
193
|
* @summary A Button is a clickable element that can be used to trigger actions such as submitting forms, navigating to other pages, or performing other actions.
|
|
194
|
-
* @see — Docs https://
|
|
194
|
+
* @see — Docs https://hanzogui.dev/ui/button
|
|
195
195
|
*/
|
|
196
196
|
const Button = withStaticProperties(ButtonComponent, {
|
|
197
197
|
Text: ButtonText,
|
|
@@ -199,7 +199,7 @@ const Button = withStaticProperties(ButtonComponent, {
|
|
|
199
199
|
})
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
* @deprecated Instead of useButton, see the Button docs for the newer and much improved Advanced customization pattern: https://
|
|
202
|
+
* @deprecated Instead of useButton, see the Button docs for the newer and much improved Advanced customization pattern: https://hanzogui.dev/docs/components/button
|
|
203
203
|
*/
|
|
204
204
|
function useButton<Props extends ButtonProps>(
|
|
205
205
|
{ textProps, ...propsIn }: Props,
|
|
@@ -267,7 +267,7 @@ function useButton<Props extends ButtonProps>(
|
|
|
267
267
|
},
|
|
268
268
|
Text === ButtonText && propsActive.unstyled !== true
|
|
269
269
|
? {
|
|
270
|
-
unstyled: process.env.
|
|
270
|
+
unstyled: process.env.HANZOGUI_HEADLESS === '1',
|
|
271
271
|
size,
|
|
272
272
|
}
|
|
273
273
|
: undefined
|
|
@@ -304,7 +304,7 @@ function useButton<Props extends ButtonProps>(
|
|
|
304
304
|
(isNested
|
|
305
305
|
? 'span'
|
|
306
306
|
: // defaults to <a /> when accessibilityRole = link
|
|
307
|
-
// see https://github.com/
|
|
307
|
+
// see https://github.com/hanzoai/gui/issues/505
|
|
308
308
|
propsActive.accessibilityRole === 'link' || propsActive.role === 'link'
|
|
309
309
|
? 'a'
|
|
310
310
|
: 'button'),
|
package/types/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ColorTokens, GetProps, SizeTokens } from '@
|
|
1
|
+
import type { ColorTokens, GetProps, SizeTokens } from '@hanzogui/web';
|
|
2
2
|
import type { FunctionComponent, JSX } from 'react';
|
|
3
3
|
type ButtonVariant = 'outlined';
|
|
4
|
-
export declare const ButtonContext: import("@
|
|
4
|
+
export declare const ButtonContext: import("@hanzogui/web").StyledContext<{
|
|
5
5
|
size?: SizeTokens;
|
|
6
6
|
variant?: ButtonVariant;
|
|
7
7
|
color?: ColorTokens | string;
|
|
@@ -25,7 +25,7 @@ type ButtonExtraProps = {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
value?: string | readonly string[] | number;
|
|
27
27
|
};
|
|
28
|
-
declare const ButtonComponent: import("@
|
|
28
|
+
declare const ButtonComponent: import("@hanzogui/web").HanzoguiComponent<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
29
29
|
size?: number | SizeTokens | undefined;
|
|
30
30
|
variant?: "outlined" | undefined;
|
|
31
31
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -33,7 +33,7 @@ declare const ButtonComponent: import("@gui/web").GuiComponent<Omit<import("@gui
|
|
|
33
33
|
chromeless?: boolean | "all" | undefined;
|
|
34
34
|
disabled?: boolean | undefined;
|
|
35
35
|
unstyled?: boolean | undefined;
|
|
36
|
-
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@
|
|
36
|
+
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/web").StackNonStyleProps & ButtonExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
37
37
|
size?: number | SizeTokens | undefined;
|
|
38
38
|
variant?: "outlined" | undefined;
|
|
39
39
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -41,8 +41,8 @@ declare const ButtonComponent: import("@gui/web").GuiComponent<Omit<import("@gui
|
|
|
41
41
|
chromeless?: boolean | "all" | undefined;
|
|
42
42
|
disabled?: boolean | undefined;
|
|
43
43
|
unstyled?: boolean | undefined;
|
|
44
|
-
}, import("@
|
|
45
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@
|
|
44
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
45
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
46
46
|
size?: number | SizeTokens | undefined;
|
|
47
47
|
variant?: "outlined" | undefined;
|
|
48
48
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -50,7 +50,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
50
50
|
chromeless?: boolean | "all" | undefined;
|
|
51
51
|
disabled?: boolean | undefined;
|
|
52
52
|
unstyled?: boolean | undefined;
|
|
53
|
-
}>, keyof ButtonExtraProps> & ButtonExtraProps & import("react").RefAttributes<import("@
|
|
53
|
+
}>, keyof ButtonExtraProps> & ButtonExtraProps & import("react").RefAttributes<import("@hanzogui/web").HanzoguiElement>> & import("@hanzogui/web").StaticComponentObject<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
54
54
|
size?: number | SizeTokens | undefined;
|
|
55
55
|
variant?: "outlined" | undefined;
|
|
56
56
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -58,7 +58,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
58
58
|
chromeless?: boolean | "all" | undefined;
|
|
59
59
|
disabled?: boolean | undefined;
|
|
60
60
|
unstyled?: boolean | undefined;
|
|
61
|
-
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@
|
|
61
|
+
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/web").StackNonStyleProps & ButtonExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
62
62
|
size?: number | SizeTokens | undefined;
|
|
63
63
|
variant?: "outlined" | undefined;
|
|
64
64
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -66,8 +66,8 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
66
66
|
chromeless?: boolean | "all" | undefined;
|
|
67
67
|
disabled?: boolean | undefined;
|
|
68
68
|
unstyled?: boolean | undefined;
|
|
69
|
-
}, import("@
|
|
70
|
-
__tama: [Omit<import("@
|
|
69
|
+
}, import("@hanzogui/web").StaticConfigPublic> & Omit<import("@hanzogui/web").StaticConfigPublic, "staticConfig" | "styleable"> & {
|
|
70
|
+
__tama: [Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
71
71
|
size?: number | SizeTokens | undefined;
|
|
72
72
|
variant?: "outlined" | undefined;
|
|
73
73
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -75,7 +75,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
75
75
|
chromeless?: boolean | "all" | undefined;
|
|
76
76
|
disabled?: boolean | undefined;
|
|
77
77
|
unstyled?: boolean | undefined;
|
|
78
|
-
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@
|
|
78
|
+
}>, keyof ButtonExtraProps> & ButtonExtraProps, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/web").StackNonStyleProps & ButtonExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
79
79
|
size?: number | SizeTokens | undefined;
|
|
80
80
|
variant?: "outlined" | undefined;
|
|
81
81
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -83,7 +83,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
83
83
|
chromeless?: boolean | "all" | undefined;
|
|
84
84
|
disabled?: boolean | undefined;
|
|
85
85
|
unstyled?: boolean | undefined;
|
|
86
|
-
}, import("@
|
|
86
|
+
}, import("@hanzogui/web").StaticConfigPublic];
|
|
87
87
|
} & {
|
|
88
88
|
Apply: import("react").Provider<{
|
|
89
89
|
size?: SizeTokens;
|
|
@@ -99,7 +99,7 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
99
99
|
children?: import("react").ReactNode;
|
|
100
100
|
scope?: string;
|
|
101
101
|
}>;
|
|
102
|
-
Frame: import("@
|
|
102
|
+
Frame: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/web").StackNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
103
103
|
size?: number | SizeTokens | undefined;
|
|
104
104
|
variant?: "outlined" | undefined;
|
|
105
105
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -107,11 +107,11 @@ export declare const Button: import("react").ForwardRefExoticComponent<Omit<impo
|
|
|
107
107
|
chromeless?: boolean | "all" | undefined;
|
|
108
108
|
disabled?: boolean | undefined;
|
|
109
109
|
unstyled?: boolean | undefined;
|
|
110
|
-
}, import("@
|
|
111
|
-
Text: import("@
|
|
112
|
-
size?: import("@
|
|
110
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
111
|
+
Text: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").HanzoguiTextElement, import("@hanzogui/web").TextNonStyleProps, import("@hanzogui/web").TextStylePropsBase, {
|
|
112
|
+
size?: import("@hanzogui/web").FontSizeTokens | undefined;
|
|
113
113
|
unstyled?: boolean | undefined;
|
|
114
|
-
}, import("@
|
|
114
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
115
115
|
Icon: (props: {
|
|
116
116
|
children: React.ReactNode;
|
|
117
117
|
scaleIcon?: number;
|
package/types/v1/Button.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { TextContextStyles, TextParentStyles } from '@
|
|
2
|
-
import type { FontSizeTokens, GetProps, SizeTokens, ThemeableProps } from '@
|
|
1
|
+
import type { TextContextStyles, TextParentStyles } from '@hanzogui/text';
|
|
2
|
+
import type { FontSizeTokens, GetProps, SizeTokens, ThemeableProps } from '@hanzogui/web';
|
|
3
3
|
import type { FunctionComponent, JSX } from 'react';
|
|
4
4
|
type ButtonVariant = 'outlined';
|
|
5
|
-
export declare const ButtonContext: import("@
|
|
5
|
+
export declare const ButtonContext: import("@hanzogui/web").StyledContext<Partial<TextContextStyles & {
|
|
6
6
|
size: SizeTokens;
|
|
7
7
|
variant?: ButtonVariant;
|
|
8
8
|
}>>;
|
|
@@ -40,7 +40,7 @@ type ButtonExtraProps = TextParentStyles & ThemeableProps & {
|
|
|
40
40
|
unstyled?: boolean;
|
|
41
41
|
};
|
|
42
42
|
type ButtonProps = ButtonExtraProps & GetProps<typeof ButtonFrame>;
|
|
43
|
-
declare const ButtonFrame: import("@
|
|
43
|
+
declare const ButtonFrame: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
44
44
|
size?: number | SizeTokens | undefined;
|
|
45
45
|
variant?: "outlined" | undefined;
|
|
46
46
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -52,20 +52,20 @@ declare const ButtonFrame: import("@gui/web").GuiComponent<import("@gui/web").Ta
|
|
|
52
52
|
fullscreen?: boolean | undefined;
|
|
53
53
|
elevate?: boolean | undefined;
|
|
54
54
|
bordered?: boolean | undefined;
|
|
55
|
-
}, import("@
|
|
56
|
-
declare const ButtonText: import("@
|
|
55
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
56
|
+
declare const ButtonText: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").HanzoguiTextElement, import("@hanzogui/web").TextNonStyleProps, import("@hanzogui/web").TextStylePropsBase, {
|
|
57
57
|
size?: FontSizeTokens | undefined;
|
|
58
58
|
unstyled?: boolean | undefined;
|
|
59
|
-
}, import("@
|
|
59
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
60
60
|
declare const ButtonIcon: (props: {
|
|
61
61
|
children: React.ReactNode;
|
|
62
62
|
scaleIcon?: number;
|
|
63
63
|
}) => any;
|
|
64
64
|
/**
|
|
65
65
|
* @summary A Button is a clickable element that can be used to trigger actions such as submitting forms, navigating to other pages, or performing other actions.
|
|
66
|
-
* @see — Docs https://
|
|
66
|
+
* @see — Docs https://hanzogui.dev/ui/button
|
|
67
67
|
*/
|
|
68
|
-
declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@
|
|
68
|
+
declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
69
69
|
size?: number | SizeTokens | undefined;
|
|
70
70
|
variant?: "outlined" | undefined;
|
|
71
71
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -78,7 +78,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
78
78
|
elevate?: boolean | undefined;
|
|
79
79
|
bordered?: boolean | undefined;
|
|
80
80
|
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | keyof TextContextStyles | "textProps" | "noTextWrap" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
81
|
-
textProps?: Partial<import("@
|
|
81
|
+
textProps?: Partial<import("@hanzogui/text").SizableTextProps>;
|
|
82
82
|
noTextWrap?: boolean;
|
|
83
83
|
} & ThemeableProps & {
|
|
84
84
|
/**
|
|
@@ -107,7 +107,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
107
107
|
* remove default styles
|
|
108
108
|
*/
|
|
109
109
|
unstyled?: boolean;
|
|
110
|
-
} & import("react").RefAttributes<import("@
|
|
110
|
+
} & import("react").RefAttributes<import("@hanzogui/web").HanzoguiElement>> & import("@hanzogui/web").StaticComponentObject<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
111
111
|
size?: number | SizeTokens | undefined;
|
|
112
112
|
variant?: "outlined" | undefined;
|
|
113
113
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -120,7 +120,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
120
120
|
elevate?: boolean | undefined;
|
|
121
121
|
bordered?: boolean | undefined;
|
|
122
122
|
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | keyof TextContextStyles | "textProps" | "noTextWrap" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
123
|
-
textProps?: Partial<import("@
|
|
123
|
+
textProps?: Partial<import("@hanzogui/text").SizableTextProps>;
|
|
124
124
|
noTextWrap?: boolean;
|
|
125
125
|
} & ThemeableProps & {
|
|
126
126
|
/**
|
|
@@ -149,8 +149,8 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
149
149
|
* remove default styles
|
|
150
150
|
*/
|
|
151
151
|
unstyled?: boolean;
|
|
152
|
-
}, import("@
|
|
153
|
-
textProps?: Partial<import("@
|
|
152
|
+
}, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps & TextContextStyles & {
|
|
153
|
+
textProps?: Partial<import("@hanzogui/text").SizableTextProps>;
|
|
154
154
|
noTextWrap?: boolean;
|
|
155
155
|
} & ThemeableProps & {
|
|
156
156
|
/**
|
|
@@ -179,7 +179,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
179
179
|
* remove default styles
|
|
180
180
|
*/
|
|
181
181
|
unstyled?: boolean;
|
|
182
|
-
}, import("@
|
|
182
|
+
}, import("@hanzogui/web").StackStyleBase, {
|
|
183
183
|
size?: number | SizeTokens | undefined;
|
|
184
184
|
variant?: "outlined" | undefined;
|
|
185
185
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -191,8 +191,8 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
191
191
|
fullscreen?: boolean | undefined;
|
|
192
192
|
elevate?: boolean | undefined;
|
|
193
193
|
bordered?: boolean | undefined;
|
|
194
|
-
}, import("@
|
|
195
|
-
__tama: [Omit<import("@
|
|
194
|
+
}, import("@hanzogui/web").StaticConfigPublic> & Omit<import("@hanzogui/web").StaticConfigPublic, "staticConfig" | "styleable"> & {
|
|
195
|
+
__tama: [Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
196
196
|
size?: number | SizeTokens | undefined;
|
|
197
197
|
variant?: "outlined" | undefined;
|
|
198
198
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -205,7 +205,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
205
205
|
elevate?: boolean | undefined;
|
|
206
206
|
bordered?: boolean | undefined;
|
|
207
207
|
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | keyof TextContextStyles | "textProps" | "noTextWrap" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
208
|
-
textProps?: Partial<import("@
|
|
208
|
+
textProps?: Partial<import("@hanzogui/text").SizableTextProps>;
|
|
209
209
|
noTextWrap?: boolean;
|
|
210
210
|
} & ThemeableProps & {
|
|
211
211
|
/**
|
|
@@ -234,8 +234,8 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
234
234
|
* remove default styles
|
|
235
235
|
*/
|
|
236
236
|
unstyled?: boolean;
|
|
237
|
-
}, import("@
|
|
238
|
-
textProps?: Partial<import("@
|
|
237
|
+
}, import("@hanzogui/web").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps & TextContextStyles & {
|
|
238
|
+
textProps?: Partial<import("@hanzogui/text").SizableTextProps>;
|
|
239
239
|
noTextWrap?: boolean;
|
|
240
240
|
} & ThemeableProps & {
|
|
241
241
|
/**
|
|
@@ -264,7 +264,7 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
264
264
|
* remove default styles
|
|
265
265
|
*/
|
|
266
266
|
unstyled?: boolean;
|
|
267
|
-
}, import("@
|
|
267
|
+
}, import("@hanzogui/web").StackStyleBase, {
|
|
268
268
|
size?: number | SizeTokens | undefined;
|
|
269
269
|
variant?: "outlined" | undefined;
|
|
270
270
|
elevation?: number | SizeTokens | undefined;
|
|
@@ -276,24 +276,24 @@ declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@gu
|
|
|
276
276
|
fullscreen?: boolean | undefined;
|
|
277
277
|
elevate?: boolean | undefined;
|
|
278
278
|
bordered?: boolean | undefined;
|
|
279
|
-
}, import("@
|
|
279
|
+
}, import("@hanzogui/web").StaticConfigPublic];
|
|
280
280
|
} & {
|
|
281
|
-
Text: import("@
|
|
281
|
+
Text: import("@hanzogui/web").HanzoguiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").HanzoguiTextElement, import("@hanzogui/web").TextNonStyleProps, import("@hanzogui/web").TextStylePropsBase, {
|
|
282
282
|
size?: FontSizeTokens | undefined;
|
|
283
283
|
unstyled?: boolean | undefined;
|
|
284
|
-
}, import("@
|
|
284
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
285
285
|
Icon: (props: {
|
|
286
286
|
children: React.ReactNode;
|
|
287
287
|
scaleIcon?: number;
|
|
288
288
|
}) => any;
|
|
289
289
|
};
|
|
290
290
|
/**
|
|
291
|
-
* @deprecated Instead of useButton, see the Button docs for the newer and much improved Advanced customization pattern: https://
|
|
291
|
+
* @deprecated Instead of useButton, see the Button docs for the newer and much improved Advanced customization pattern: https://hanzogui.dev/docs/components/button
|
|
292
292
|
*/
|
|
293
293
|
declare function useButton<Props extends ButtonProps>({ textProps, ...propsIn }: Props, { Text }?: {
|
|
294
294
|
Text: any;
|
|
295
295
|
}): {
|
|
296
|
-
spaceSize: number | import("@
|
|
296
|
+
spaceSize: number | import("@hanzogui/web").UnionableString | "unset" | import("@hanzogui/web").Variable<any>;
|
|
297
297
|
isNested: boolean;
|
|
298
298
|
props: Props;
|
|
299
299
|
};
|