@a-type/ui 6.0.35 → 6.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arbor/arbor.js +1 -1
- package/dist/arbor/arbor.js.map +1 -1
- package/dist/components/button/Button.d.ts +3 -1
- package/dist/components/button/Button.js +2 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.module.css +19 -0
- package/dist/components/button/Button.stories.d.ts +1 -0
- package/dist/components/button/Button.stories.js +5 -0
- package/dist/components/button/Button.stories.js.map +1 -1
- package/dist/components/forms/SubmitButton.js +1 -3
- package/dist/components/forms/SubmitButton.js.map +1 -1
- package/dist/components/numberStepper/NumberStepper.d.ts +2 -1
- package/dist/components/numberStepper/NumberStepper.js.map +1 -1
- package/dist/css/arbor.css +1 -1398
- package/package.json +2 -3
- package/src/arbor/arbor.ts +1 -1
- package/src/components/button/Button.module.css +19 -0
- package/src/components/button/Button.stories.tsx +24 -0
- package/src/components/button/Button.tsx +6 -0
- package/src/components/forms/SubmitButton.tsx +2 -3
- package/src/components/numberStepper/NumberStepper.tsx +2 -1
- package/dist/components/forms/SubmitButton.module.css +0 -3
- package/src/components/forms/SubmitButton.module.css +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-type/ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/a-type/ui"
|
|
@@ -99,8 +99,7 @@
|
|
|
99
99
|
"scripts": {
|
|
100
100
|
"build:transpile": "tsc",
|
|
101
101
|
"build:copy": "node --experimental-strip-types ./scripts/copy.ts",
|
|
102
|
-
"build
|
|
103
|
-
"build": "pnpm run build:transpile && pnpm run build:copy && pnpm run build:arbor",
|
|
102
|
+
"build": "pnpm run build:transpile && pnpm run build:copy",
|
|
104
103
|
"prepublish": "pnpm run build",
|
|
105
104
|
"icons": "node ./scripts/generateIcons.js",
|
|
106
105
|
"storybook": "storybook dev -p 6006",
|
package/src/arbor/arbor.ts
CHANGED
|
@@ -186,7 +186,7 @@ export function presetAtype<
|
|
|
186
186
|
accent: $.mode.color.palette.leek,
|
|
187
187
|
},
|
|
188
188
|
action: {
|
|
189
|
-
roundness: config?.roundActions === false ? undefined :
|
|
189
|
+
roundness: config?.roundActions === false ? undefined : 2,
|
|
190
190
|
|
|
191
191
|
light: {
|
|
192
192
|
bg: $.mode.color.main.light,
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: row;
|
|
9
9
|
align-items: center;
|
|
10
|
+
justify-content: start;
|
|
10
11
|
gap: var(--m-space-sm);
|
|
11
12
|
align-self: center;
|
|
12
13
|
|
|
@@ -73,6 +74,24 @@
|
|
|
73
74
|
padding: 0;
|
|
74
75
|
width: fit-content;
|
|
75
76
|
}
|
|
77
|
+
&[data-full='width'],
|
|
78
|
+
&[data-full='both'] {
|
|
79
|
+
width: 100%;
|
|
80
|
+
}
|
|
81
|
+
&[data-full='height'],
|
|
82
|
+
&[data-full='both'] {
|
|
83
|
+
height: 100%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&[data-align='start'] {
|
|
87
|
+
align-self: start;
|
|
88
|
+
}
|
|
89
|
+
&[data-align='center'] {
|
|
90
|
+
align-self: center;
|
|
91
|
+
}
|
|
92
|
+
&[data-align='end'] {
|
|
93
|
+
align-self: end;
|
|
94
|
+
}
|
|
76
95
|
|
|
77
96
|
@apply --mx-hover;
|
|
78
97
|
@apply --mx-active;
|
|
@@ -270,3 +270,27 @@ export const SkeletonTest: Story = {
|
|
|
270
270
|
);
|
|
271
271
|
},
|
|
272
272
|
};
|
|
273
|
+
|
|
274
|
+
export const FullSizeTest: Story = {
|
|
275
|
+
render(args) {
|
|
276
|
+
return (
|
|
277
|
+
<Box col gap full="width">
|
|
278
|
+
<Button {...args} full="width">
|
|
279
|
+
<Icon name="placeholder" />
|
|
280
|
+
Full Width
|
|
281
|
+
</Button>
|
|
282
|
+
<div style={{ width: '100%', aspectRatio: 1 }}>
|
|
283
|
+
<Button {...args} full="height">
|
|
284
|
+
<Icon name="placeholder" />
|
|
285
|
+
Full Height
|
|
286
|
+
</Button>
|
|
287
|
+
</div>
|
|
288
|
+
<div style={{ width: '100%', aspectRatio: 1 }}>
|
|
289
|
+
<Button {...args} full>
|
|
290
|
+
Full Both
|
|
291
|
+
</Button>
|
|
292
|
+
</div>
|
|
293
|
+
</Box>
|
|
294
|
+
);
|
|
295
|
+
},
|
|
296
|
+
};
|
|
@@ -37,6 +37,8 @@ export interface ButtonProps
|
|
|
37
37
|
* Shortcuts for @mode-* classes.
|
|
38
38
|
*/
|
|
39
39
|
color?: 'primary' | 'accent' | 'success' | 'attention';
|
|
40
|
+
full?: 'width' | 'height' | boolean;
|
|
41
|
+
align?: 'start' | 'center' | 'end';
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export function ButtonRoot({
|
|
@@ -55,6 +57,8 @@ export function ButtonRoot({
|
|
|
55
57
|
forceIconMode,
|
|
56
58
|
disableDropdownTriggerIcon,
|
|
57
59
|
disableDefaultLoadingIndicator,
|
|
60
|
+
full,
|
|
61
|
+
align,
|
|
58
62
|
ref,
|
|
59
63
|
...props
|
|
60
64
|
}: ButtonProps) {
|
|
@@ -88,6 +92,8 @@ export function ButtonRoot({
|
|
|
88
92
|
'data-disable-icon-mode': disableIconMode,
|
|
89
93
|
'data-force-icon-mode': forceIconMode,
|
|
90
94
|
'data-emphasis': emphasis,
|
|
95
|
+
'data-full': full === true ? 'both' : full,
|
|
96
|
+
'data-align': align,
|
|
91
97
|
className: clsx(
|
|
92
98
|
emphasis === 'unstyled' ? cls.unstyled : cls.root,
|
|
93
99
|
emphasis === 'ghost' && '@mode-bold',
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
1
|
import { useFormikContext } from 'formik';
|
|
3
2
|
import { Button, ButtonProps } from '../button/Button.js';
|
|
4
|
-
import cls from './SubmitButton.module.css';
|
|
5
3
|
|
|
6
4
|
export function SubmitButton({ className, ...props }: ButtonProps) {
|
|
7
5
|
const { isSubmitting, isValid } = useFormikContext();
|
|
@@ -10,7 +8,8 @@ export function SubmitButton({ className, ...props }: ButtonProps) {
|
|
|
10
8
|
loading={isSubmitting}
|
|
11
9
|
disabled={!isValid}
|
|
12
10
|
emphasis="primary"
|
|
13
|
-
|
|
11
|
+
align="end"
|
|
12
|
+
className={className}
|
|
14
13
|
{...props}
|
|
15
14
|
type="submit"
|
|
16
15
|
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fractionToText } from '@a-type/utils';
|
|
2
2
|
import classNames from 'clsx';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
3
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { Button } from '../button/index.js';
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
6
|
import cls from './NumberStepper.module.css';
|
|
@@ -18,6 +18,7 @@ export interface NumberStepperProps {
|
|
|
18
18
|
max?: number;
|
|
19
19
|
id?: string;
|
|
20
20
|
defaultValue?: number;
|
|
21
|
+
style?: CSSProperties;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export function NumberStepper({
|