@becket-ui/react 0.1.3 → 0.3.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/dist/components/Badge.d.ts +1 -1
- package/dist/components/Badge.js +1 -1
- package/dist/components/Box.d.ts +20 -0
- package/dist/components/Box.d.ts.map +1 -0
- package/dist/components/Box.js +21 -0
- package/dist/components/Box.js.map +1 -0
- package/dist/components/Container.d.ts +21 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/Container.js +21 -0
- package/dist/components/Container.js.map +1 -0
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Drawer.js +1 -1
- package/dist/components/Flex.d.ts +2 -2
- package/dist/components/Flex.js +2 -2
- package/dist/components/Glyphs.d.ts +16 -0
- package/dist/components/Glyphs.d.ts.map +1 -0
- package/dist/components/Glyphs.js +83 -0
- package/dist/components/Glyphs.js.map +1 -0
- package/dist/components/Hide.d.ts +1 -1
- package/dist/components/Hide.js +1 -1
- package/dist/components/Icon.d.ts +20 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/Icon.js +23 -0
- package/dist/components/Icon.js.map +1 -0
- package/dist/components/Prose.d.ts +20 -0
- package/dist/components/Prose.d.ts.map +1 -0
- package/dist/components/Prose.js +14 -0
- package/dist/components/Prose.js.map +1 -0
- package/dist/components/Radio.js +1 -1
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/SimpleGrid.d.ts +1 -1
- package/dist/components/SimpleGrid.js +1 -1
- package/dist/components/Stack.d.ts +2 -2
- package/dist/components/Stack.js +2 -2
- package/dist/components/Tag.d.ts +1 -1
- package/dist/components/Tag.js +1 -1
- package/dist/components/TextField.d.ts +1 -1
- package/dist/components/TextField.js +1 -1
- package/dist/components/Textarea.d.ts +1 -1
- package/dist/components/Textarea.js +1 -1
- package/dist/helpers/responsive.d.ts +1 -1
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/helpers/storybookControls.d.ts +1 -1
- package/dist/helpers/storybookControls.js +1 -1
- package/dist/helpers/storybookControls.js.map +1 -1
- package/dist/index.d.ts +44 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -27
- package/dist/index.js.map +1 -1
- package/guides/building-with-becket.md +39 -33
- package/package.json +4 -4
- package/dist/components/Button.test.js +0 -62
- package/dist/components/Button.test.js.map +0 -1
- package/dist/components/Dialog.test.js +0 -89
- package/dist/components/Dialog.test.js.map +0 -1
- package/dist/components/Drawer.test.js +0 -50
- package/dist/components/Drawer.test.js.map +0 -1
- package/dist/components/Field.test.js +0 -33
- package/dist/components/Field.test.js.map +0 -1
- package/dist/components/Menu.test.js +0 -69
- package/dist/components/Menu.test.js.map +0 -1
- package/dist/components/Switch.test.js +0 -28
- package/dist/components/Switch.test.js.map +0 -1
- package/dist/components/Tabs.test.js +0 -41
- package/dist/components/Tabs.test.js.map +0 -1
- package/dist/components/Tooltip.test.js +0 -58
- package/dist/components/Tooltip.test.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/helpers/storybookControls.ts"],"sourcesContent":["/** Shared Storybook knob values. ConditionalValue props infer as object controls — always override. */\n\nexport const GAP_OPTIONS = ['xs', 'sm', 'md', 'lg', 'xl', '
|
|
1
|
+
{"version":3,"sources":["../../src/helpers/storybookControls.ts"],"sourcesContent":["/** Shared Storybook knob values. ConditionalValue props infer as object controls — always override. */\n\nexport const GAP_OPTIONS = ['xs', 'sm', 'md', 'lg', 'xl', '2xl'] as const;\n\nexport const FLEX_DIRECTION_OPTIONS = [\n 'row',\n 'column',\n 'row-reverse',\n 'column-reverse',\n] as const;\n\nexport const STACK_DIRECTION_OPTIONS = ['row', 'column'] as const;\n\nexport const ALIGN_OPTIONS = ['start', 'center', 'end', 'stretch', 'baseline'] as const;\n\nexport const JUSTIFY_OPTIONS = ['start', 'center', 'end', 'between', 'around', 'evenly'] as const;\n\nexport const FLEX_WRAP_OPTIONS = ['wrap', 'nowrap', 'wrap-reverse'] as const;\n\nexport const FLEX_BASIS_OPTIONS = ['auto', '0', 'full', '8', '13', '21', '34', '1/2', '1/3'] as const;\n\nexport const GRADIENT_BORDER_OPTIONS = ['primary', 'secondary', 'neutral'] as const;\n\nexport const BREAKPOINT_OPTIONS = [\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n 'mobile',\n 'tablet',\n 'desktop',\n 'largeDesktop',\n] as const;\n\nexport function knobs(include: string[]) {\n return { controls: { include } };\n}\n"],"mappings":"AAEO,MAAM,cAAc,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAExD,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,0BAA0B,CAAC,OAAO,QAAQ;AAEhD,MAAM,gBAAgB,CAAC,SAAS,UAAU,OAAO,WAAW,UAAU;AAEtE,MAAM,kBAAkB,CAAC,SAAS,UAAU,OAAO,WAAW,UAAU,QAAQ;AAEhF,MAAM,oBAAoB,CAAC,QAAQ,UAAU,cAAc;AAE3D,MAAM,qBAAqB,CAAC,QAAQ,KAAK,QAAQ,KAAK,MAAM,MAAM,MAAM,OAAO,KAAK;AAEpF,MAAM,0BAA0B,CAAC,WAAW,aAAa,SAAS;AAElE,MAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,MAAM,SAAmB;AACvC,SAAO,EAAE,UAAU,EAAE,QAAQ,EAAE;AACjC;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
export { Button } from './components/Button';
|
|
2
|
-
export { Heading } from './components/Heading';
|
|
3
|
-
export { Text } from './components/Text';
|
|
4
|
-
export { Flex } from './components/Flex';
|
|
5
|
-
export { Stack, HStack, VStack } from './components/Stack';
|
|
6
|
-
export { Tag } from './components/Tag';
|
|
7
|
-
export { Badge } from './components/Badge';
|
|
8
|
-
export { Switch } from './components/Switch';
|
|
9
|
-
export type { SwitchProps } from './components/Switch';
|
|
10
|
-
export { Field, FieldLabel, FieldHelper, FieldError, FieldControl, FieldSelect, FieldTextarea, useField, } from './components/Field';
|
|
11
|
-
export type { FieldSize, FieldContextValue } from './components/Field';
|
|
12
|
-
export { TextField } from './components/TextField';
|
|
13
|
-
export { Checkbox } from './components/Checkbox';
|
|
14
|
-
export { Radio, RadioGroup } from './components/Radio';
|
|
15
|
-
export type { RadioProps, RadioGroupProps } from './components/Radio';
|
|
16
|
-
export { Select } from './components/Select';
|
|
17
|
-
export { Textarea } from './components/Textarea';
|
|
18
|
-
export { Card, CardHeader, CardBody, CardFooter, CardTitle, CardDescription, } from './components/Card';
|
|
19
|
-
export { SimpleGrid } from './components/SimpleGrid';
|
|
20
|
-
export {
|
|
21
|
-
export type {
|
|
22
|
-
export {
|
|
23
|
-
export type {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export {
|
|
1
|
+
export { Button } from './components/Button.js';
|
|
2
|
+
export { Heading } from './components/Heading.js';
|
|
3
|
+
export { Text } from './components/Text.js';
|
|
4
|
+
export { Flex } from './components/Flex.js';
|
|
5
|
+
export { Stack, HStack, VStack } from './components/Stack.js';
|
|
6
|
+
export { Tag } from './components/Tag.js';
|
|
7
|
+
export { Badge } from './components/Badge.js';
|
|
8
|
+
export { Switch } from './components/Switch.js';
|
|
9
|
+
export type { SwitchProps } from './components/Switch.js';
|
|
10
|
+
export { Field, FieldLabel, FieldHelper, FieldError, FieldControl, FieldSelect, FieldTextarea, useField, } from './components/Field.js';
|
|
11
|
+
export type { FieldSize, FieldContextValue } from './components/Field.js';
|
|
12
|
+
export { TextField } from './components/TextField.js';
|
|
13
|
+
export { Checkbox } from './components/Checkbox.js';
|
|
14
|
+
export { Radio, RadioGroup } from './components/Radio.js';
|
|
15
|
+
export type { RadioProps, RadioGroupProps } from './components/Radio.js';
|
|
16
|
+
export { Select } from './components/Select.js';
|
|
17
|
+
export { Textarea } from './components/Textarea.js';
|
|
18
|
+
export { Card, CardHeader, CardBody, CardFooter, CardTitle, CardDescription, } from './components/Card.js';
|
|
19
|
+
export { SimpleGrid } from './components/SimpleGrid.js';
|
|
20
|
+
export { Container } from './components/Container.js';
|
|
21
|
+
export type { ContainerProps } from './components/Container.js';
|
|
22
|
+
export { Box } from './components/Box.js';
|
|
23
|
+
export type { BoxProps } from './components/Box.js';
|
|
24
|
+
export { Hide } from './components/Hide.js';
|
|
25
|
+
export type { HideProps } from './components/Hide.js';
|
|
26
|
+
export { Tooltip } from './components/Tooltip.js';
|
|
27
|
+
export type { TooltipPlacement, TooltipProps } from './components/Tooltip.js';
|
|
28
|
+
export { Dialog, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogClose, } from './components/Dialog.js';
|
|
29
|
+
export { Drawer, DrawerHeader, DrawerBody, DrawerFooter, DrawerTitle, DrawerClose, } from './components/Drawer.js';
|
|
30
|
+
export { Menu, MenuItem } from './components/Menu.js';
|
|
31
|
+
export { Tabs, TabList, Tab, TabPanel } from './components/Tabs.js';
|
|
32
|
+
export { Table, TableCaption, TableHeader, TableBody, TableFooter, TableRow, TableColumnHeader, TableCell, Thead, Tbody, Tfoot, Tr, Th, Td, } from './components/Table.js';
|
|
33
|
+
export { Spinner } from './components/Spinner.js';
|
|
34
|
+
export { Icon } from './components/Icon.js';
|
|
35
|
+
export type { IconProps } from './components/Icon.js';
|
|
36
|
+
export { CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, ExternalLinkIcon, InfoIcon, LinkIcon, MenuIcon, MoonIcon, SearchIcon, SunIcon, WarningIcon, } from './components/Glyphs.js';
|
|
37
|
+
export type { GlyphProps } from './components/Glyphs.js';
|
|
38
|
+
export { Link } from './components/Link.js';
|
|
39
|
+
export { Prose } from './components/Prose.js';
|
|
40
|
+
export type { ProseProps } from './components/Prose.js';
|
|
41
|
+
export { Separator } from './components/Separator.js';
|
|
42
|
+
export type { LabelCustomColors, LabelVisual } from './helpers/labelColors.js';
|
|
43
|
+
export type { Breakpoint, BreakpointAlias, BreakpointMap, ResponsiveValue, GapValue, SpacingScale, SpacingStep, SpacingSemantic, SemanticBreakpoint, } from './helpers/responsive.js';
|
|
44
|
+
export { BREAKPOINTS, SEMANTIC_BREAKPOINTS, SEMANTIC_TO_BREAKPOINT, SPACING_SCALE, normalizeResponsiveValue, normalizeGapValue, resolveBreakpointAlias, } from './helpers/responsive.js';
|
|
35
45
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,SAAS,E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jB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Button } from "./components/Button";
|
|
2
|
-
import { Heading } from "./components/Heading";
|
|
3
|
-
import { Text } from "./components/Text";
|
|
4
|
-
import { Flex } from "./components/Flex";
|
|
5
|
-
import { Stack, HStack, VStack } from "./components/Stack";
|
|
6
|
-
import { Tag } from "./components/Tag";
|
|
7
|
-
import { Badge } from "./components/Badge";
|
|
8
|
-
import { Switch } from "./components/Switch";
|
|
1
|
+
import { Button } from "./components/Button.js";
|
|
2
|
+
import { Heading } from "./components/Heading.js";
|
|
3
|
+
import { Text } from "./components/Text.js";
|
|
4
|
+
import { Flex } from "./components/Flex.js";
|
|
5
|
+
import { Stack, HStack, VStack } from "./components/Stack.js";
|
|
6
|
+
import { Tag } from "./components/Tag.js";
|
|
7
|
+
import { Badge } from "./components/Badge.js";
|
|
8
|
+
import { Switch } from "./components/Switch.js";
|
|
9
9
|
import {
|
|
10
10
|
Field,
|
|
11
11
|
FieldLabel,
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
FieldSelect,
|
|
16
16
|
FieldTextarea,
|
|
17
17
|
useField
|
|
18
|
-
} from "./components/Field";
|
|
19
|
-
import { TextField } from "./components/TextField";
|
|
20
|
-
import { Checkbox } from "./components/Checkbox";
|
|
21
|
-
import { Radio, RadioGroup } from "./components/Radio";
|
|
22
|
-
import { Select } from "./components/Select";
|
|
23
|
-
import { Textarea } from "./components/Textarea";
|
|
18
|
+
} from "./components/Field.js";
|
|
19
|
+
import { TextField } from "./components/TextField.js";
|
|
20
|
+
import { Checkbox } from "./components/Checkbox.js";
|
|
21
|
+
import { Radio, RadioGroup } from "./components/Radio.js";
|
|
22
|
+
import { Select } from "./components/Select.js";
|
|
23
|
+
import { Textarea } from "./components/Textarea.js";
|
|
24
24
|
import {
|
|
25
25
|
Card,
|
|
26
26
|
CardHeader,
|
|
@@ -28,10 +28,12 @@ import {
|
|
|
28
28
|
CardFooter,
|
|
29
29
|
CardTitle,
|
|
30
30
|
CardDescription
|
|
31
|
-
} from "./components/Card";
|
|
32
|
-
import { SimpleGrid } from "./components/SimpleGrid";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
31
|
+
} from "./components/Card.js";
|
|
32
|
+
import { SimpleGrid } from "./components/SimpleGrid.js";
|
|
33
|
+
import { Container } from "./components/Container.js";
|
|
34
|
+
import { Box } from "./components/Box.js";
|
|
35
|
+
import { Hide } from "./components/Hide.js";
|
|
36
|
+
import { Tooltip } from "./components/Tooltip.js";
|
|
35
37
|
import {
|
|
36
38
|
Dialog,
|
|
37
39
|
DialogHeader,
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
DialogFooter,
|
|
40
42
|
DialogTitle,
|
|
41
43
|
DialogClose
|
|
42
|
-
} from "./components/Dialog";
|
|
44
|
+
} from "./components/Dialog.js";
|
|
43
45
|
import {
|
|
44
46
|
Drawer,
|
|
45
47
|
DrawerHeader,
|
|
@@ -47,9 +49,9 @@ import {
|
|
|
47
49
|
DrawerFooter,
|
|
48
50
|
DrawerTitle,
|
|
49
51
|
DrawerClose
|
|
50
|
-
} from "./components/Drawer";
|
|
51
|
-
import { Menu, MenuItem } from "./components/Menu";
|
|
52
|
-
import { Tabs, TabList, Tab, TabPanel } from "./components/Tabs";
|
|
52
|
+
} from "./components/Drawer.js";
|
|
53
|
+
import { Menu, MenuItem } from "./components/Menu.js";
|
|
54
|
+
import { Tabs, TabList, Tab, TabPanel } from "./components/Tabs.js";
|
|
53
55
|
import {
|
|
54
56
|
Table,
|
|
55
57
|
TableCaption,
|
|
@@ -65,10 +67,27 @@ import {
|
|
|
65
67
|
Tr,
|
|
66
68
|
Th,
|
|
67
69
|
Td
|
|
68
|
-
} from "./components/Table";
|
|
69
|
-
import { Spinner } from "./components/Spinner";
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
70
|
+
} from "./components/Table.js";
|
|
71
|
+
import { Spinner } from "./components/Spinner.js";
|
|
72
|
+
import { Icon } from "./components/Icon.js";
|
|
73
|
+
import {
|
|
74
|
+
CheckIcon,
|
|
75
|
+
ChevronDownIcon,
|
|
76
|
+
ChevronRightIcon,
|
|
77
|
+
CloseIcon,
|
|
78
|
+
CopyIcon,
|
|
79
|
+
ExternalLinkIcon,
|
|
80
|
+
InfoIcon,
|
|
81
|
+
LinkIcon,
|
|
82
|
+
MenuIcon,
|
|
83
|
+
MoonIcon,
|
|
84
|
+
SearchIcon,
|
|
85
|
+
SunIcon,
|
|
86
|
+
WarningIcon
|
|
87
|
+
} from "./components/Glyphs.js";
|
|
88
|
+
import { Link } from "./components/Link.js";
|
|
89
|
+
import { Prose } from "./components/Prose.js";
|
|
90
|
+
import { Separator } from "./components/Separator.js";
|
|
72
91
|
import {
|
|
73
92
|
BREAKPOINTS,
|
|
74
93
|
SEMANTIC_BREAKPOINTS,
|
|
@@ -77,10 +96,11 @@ import {
|
|
|
77
96
|
normalizeResponsiveValue,
|
|
78
97
|
normalizeGapValue,
|
|
79
98
|
resolveBreakpointAlias
|
|
80
|
-
} from "./helpers/responsive";
|
|
99
|
+
} from "./helpers/responsive.js";
|
|
81
100
|
export {
|
|
82
101
|
BREAKPOINTS,
|
|
83
102
|
Badge,
|
|
103
|
+
Box,
|
|
84
104
|
Button,
|
|
85
105
|
Card,
|
|
86
106
|
CardBody,
|
|
@@ -88,7 +108,13 @@ export {
|
|
|
88
108
|
CardFooter,
|
|
89
109
|
CardHeader,
|
|
90
110
|
CardTitle,
|
|
111
|
+
CheckIcon,
|
|
91
112
|
Checkbox,
|
|
113
|
+
ChevronDownIcon,
|
|
114
|
+
ChevronRightIcon,
|
|
115
|
+
CloseIcon,
|
|
116
|
+
Container,
|
|
117
|
+
CopyIcon,
|
|
92
118
|
Dialog,
|
|
93
119
|
DialogBody,
|
|
94
120
|
DialogClose,
|
|
@@ -101,6 +127,7 @@ export {
|
|
|
101
127
|
DrawerFooter,
|
|
102
128
|
DrawerHeader,
|
|
103
129
|
DrawerTitle,
|
|
130
|
+
ExternalLinkIcon,
|
|
104
131
|
Field,
|
|
105
132
|
FieldControl,
|
|
106
133
|
FieldError,
|
|
@@ -112,19 +139,27 @@ export {
|
|
|
112
139
|
HStack,
|
|
113
140
|
Heading,
|
|
114
141
|
Hide,
|
|
142
|
+
Icon,
|
|
143
|
+
InfoIcon,
|
|
115
144
|
Link,
|
|
145
|
+
LinkIcon,
|
|
116
146
|
Menu,
|
|
147
|
+
MenuIcon,
|
|
117
148
|
MenuItem,
|
|
149
|
+
MoonIcon,
|
|
150
|
+
Prose,
|
|
118
151
|
Radio,
|
|
119
152
|
RadioGroup,
|
|
120
153
|
SEMANTIC_BREAKPOINTS,
|
|
121
154
|
SEMANTIC_TO_BREAKPOINT,
|
|
122
155
|
SPACING_SCALE,
|
|
156
|
+
SearchIcon,
|
|
123
157
|
Select,
|
|
124
158
|
Separator,
|
|
125
159
|
SimpleGrid,
|
|
126
160
|
Spinner,
|
|
127
161
|
Stack,
|
|
162
|
+
SunIcon,
|
|
128
163
|
Switch,
|
|
129
164
|
Tab,
|
|
130
165
|
TabList,
|
|
@@ -150,6 +185,7 @@ export {
|
|
|
150
185
|
Tooltip,
|
|
151
186
|
Tr,
|
|
152
187
|
VStack,
|
|
188
|
+
WarningIcon,
|
|
153
189
|
normalizeGapValue,
|
|
154
190
|
normalizeResponsiveValue,
|
|
155
191
|
resolveBreakpointAlias,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Button } from './components/Button';\nexport { Heading } from './components/Heading';\nexport { Text } from './components/Text';\nexport { Flex } from './components/Flex';\nexport { Stack, HStack, VStack } from './components/Stack';\nexport { Tag } from './components/Tag';\nexport { Badge } from './components/Badge';\nexport { Switch } from './components/Switch';\nexport type { SwitchProps } from './components/Switch';\nexport {\n Field,\n FieldLabel,\n FieldHelper,\n FieldError,\n FieldControl,\n FieldSelect,\n FieldTextarea,\n useField,\n} from './components/Field';\nexport type { FieldSize, FieldContextValue } from './components/Field';\nexport { TextField } from './components/TextField';\nexport { Checkbox } from './components/Checkbox';\nexport { Radio, RadioGroup } from './components/Radio';\nexport type { RadioProps, RadioGroupProps } from './components/Radio';\nexport { Select } from './components/Select';\nexport { Textarea } from './components/Textarea';\nexport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n CardTitle,\n CardDescription,\n} from './components/Card';\nexport { SimpleGrid } from './components/SimpleGrid';\nexport { Hide } from './components/Hide';\nexport type { HideProps } from './components/Hide';\nexport { Tooltip } from './components/Tooltip';\nexport type { TooltipPlacement, TooltipProps } from './components/Tooltip';\nexport {\n Dialog,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogClose,\n} from './components/Dialog';\nexport {\n Drawer,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerClose,\n} from './components/Drawer';\nexport { Menu, MenuItem } from './components/Menu';\nexport { Tabs, TabList, Tab, TabPanel } from './components/Tabs';\nexport {\n Table,\n TableCaption,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableColumnHeader,\n TableCell,\n Thead,\n Tbody,\n Tfoot,\n Tr,\n Th,\n Td,\n} from './components/Table';\nexport { Spinner } from './components/Spinner';\nexport { Link } from './components/Link';\nexport { Separator } from './components/Separator';\nexport type { LabelCustomColors, LabelVisual } from './helpers/labelColors';\nexport type {\n Breakpoint,\n BreakpointAlias,\n BreakpointMap,\n ResponsiveValue,\n GapValue,\n SpacingScale,\n SpacingStep,\n SpacingSemantic,\n SemanticBreakpoint,\n} from './helpers/responsive';\nexport {\n BREAKPOINTS,\n SEMANTIC_BREAKPOINTS,\n SEMANTIC_TO_BREAKPOINT,\n SPACING_SCALE,\n normalizeResponsiveValue,\n normalizeGapValue,\n resolveBreakpointAlias,\n} from './helpers/responsive';\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,kBAAkB;AAElC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAErB,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,gBAAgB;AAC/B,SAAS,MAAM,SAAS,KAAK,gBAAgB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAa1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Button } from './components/Button';\nexport { Heading } from './components/Heading';\nexport { Text } from './components/Text';\nexport { Flex } from './components/Flex';\nexport { Stack, HStack, VStack } from './components/Stack';\nexport { Tag } from './components/Tag';\nexport { Badge } from './components/Badge';\nexport { Switch } from './components/Switch';\nexport type { SwitchProps } from './components/Switch';\nexport {\n Field,\n FieldLabel,\n FieldHelper,\n FieldError,\n FieldControl,\n FieldSelect,\n FieldTextarea,\n useField,\n} from './components/Field';\nexport type { FieldSize, FieldContextValue } from './components/Field';\nexport { TextField } from './components/TextField';\nexport { Checkbox } from './components/Checkbox';\nexport { Radio, RadioGroup } from './components/Radio';\nexport type { RadioProps, RadioGroupProps } from './components/Radio';\nexport { Select } from './components/Select';\nexport { Textarea } from './components/Textarea';\nexport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n CardTitle,\n CardDescription,\n} from './components/Card';\nexport { SimpleGrid } from './components/SimpleGrid';\nexport { Container } from './components/Container';\nexport type { ContainerProps } from './components/Container';\nexport { Box } from './components/Box';\nexport type { BoxProps } from './components/Box';\nexport { Hide } from './components/Hide';\nexport type { HideProps } from './components/Hide';\nexport { Tooltip } from './components/Tooltip';\nexport type { TooltipPlacement, TooltipProps } from './components/Tooltip';\nexport {\n Dialog,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogClose,\n} from './components/Dialog';\nexport {\n Drawer,\n DrawerHeader,\n DrawerBody,\n DrawerFooter,\n DrawerTitle,\n DrawerClose,\n} from './components/Drawer';\nexport { Menu, MenuItem } from './components/Menu';\nexport { Tabs, TabList, Tab, TabPanel } from './components/Tabs';\nexport {\n Table,\n TableCaption,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableColumnHeader,\n TableCell,\n Thead,\n Tbody,\n Tfoot,\n Tr,\n Th,\n Td,\n} from './components/Table';\nexport { Spinner } from './components/Spinner';\nexport { Icon } from './components/Icon';\nexport type { IconProps } from './components/Icon';\nexport {\n CheckIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CloseIcon,\n CopyIcon,\n ExternalLinkIcon,\n InfoIcon,\n LinkIcon,\n MenuIcon,\n MoonIcon,\n SearchIcon,\n SunIcon,\n WarningIcon,\n} from './components/Glyphs';\nexport type { GlyphProps } from './components/Glyphs';\nexport { Link } from './components/Link';\nexport { Prose } from './components/Prose';\nexport type { ProseProps } from './components/Prose';\nexport { Separator } from './components/Separator';\nexport type { LabelCustomColors, LabelVisual } from './helpers/labelColors';\nexport type {\n Breakpoint,\n BreakpointAlias,\n BreakpointMap,\n ResponsiveValue,\n GapValue,\n SpacingScale,\n SpacingStep,\n SpacingSemantic,\n SemanticBreakpoint,\n} from './helpers/responsive';\nexport {\n BREAKPOINTS,\n SEMANTIC_BREAKPOINTS,\n SEMANTIC_TO_BREAKPOINT,\n SPACING_SCALE,\n normalizeResponsiveValue,\n normalizeGapValue,\n resolveBreakpointAlias,\n} from './helpers/responsive';\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,WAAW;AACpB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,kBAAkB;AAElC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAE1B,SAAS,WAAW;AAEpB,SAAS,YAAY;AAErB,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,gBAAgB;AAC/B,SAAS,MAAM,SAAS,KAAK,gBAAgB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,YAAY;AAErB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,aAAa;AAEtB,SAAS,iBAAiB;AAa1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -21,25 +21,29 @@ comment).
|
|
|
21
21
|
|
|
22
22
|
Raw elements with inline styles are the most common mistake. Use this table:
|
|
23
23
|
|
|
24
|
-
| Instead of
|
|
25
|
-
|
|
|
26
|
-
| `div`
|
|
27
|
-
| `div` with
|
|
28
|
-
| `div` with `display:
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
|
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
|
|
|
37
|
-
| `
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
|
|
|
24
|
+
| Instead of | Use |
|
|
25
|
+
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| page wrapper `div` (max width, centering, gutters) | `Container as="main" size="md"` |
|
|
27
|
+
| plain block `div` with padding, background or radius | `Box padding="md" background="subtle" radius="md"` |
|
|
28
|
+
| `div` with `display: flex; flex-direction: column` | `VStack` / `Stack` |
|
|
29
|
+
| `div` with `display: flex` (row) | `HStack`, or `Flex` for wrap, grow and basis |
|
|
30
|
+
| `div` with `display: grid` | `SimpleGrid columns={{ base: 1, md: 2 }}` |
|
|
31
|
+
| `h1`–`h6` with font styles | `Heading as="h1" size="2xl"` |
|
|
32
|
+
| `p` / `span` with font size or color | `Text fontSize="sm" color="muted"` |
|
|
33
|
+
| bold `span` | `Text as="strong"` |
|
|
34
|
+
| `hr`, or a 1px `div` | `Separator` (`orientation="vertical"` inside a row) |
|
|
35
|
+
| `button` | `Button visual="primary\|secondary\|neutral\|outline"` |
|
|
36
|
+
| `input` + `label` | `Field` + `FieldLabel` + `FieldControl`, or `TextField label` |
|
|
37
|
+
| `select` / `textarea` | `Select` / `Textarea` (or `FieldSelect` / `FieldTextarea` inside `Field`) |
|
|
38
|
+
| checkbox / radio / toggle `input` | `Checkbox`, `RadioGroup` + `Radio`, `Switch` |
|
|
39
|
+
| `table`, `tr`, `td` | `Table`, `Thead`, `Tbody`, `Tr`, `Th`, `Td` |
|
|
40
|
+
| panel `div` with border and padding | `Card` + `CardHeader` / `CardBody` / `CardFooter` |
|
|
41
|
+
| pill `span` | `Tag` (label) or `Badge` (count or status) |
|
|
42
|
+
| inline `svg` icon | `Icon` around your SVG, or a built-in glyph (`SearchIcon`, `ChevronDownIcon`, …); add `label` only when it carries meaning |
|
|
43
|
+
| `a` | `Link` |
|
|
44
|
+
| `a` styled as a button (call to action) | `Button as="a" href="…"` (anchor props are typed) |
|
|
45
|
+
| HTML from Markdown or MDX (blog posts, docs) | `<Prose as="article">`; wrap embedded components in `data-not-prose` |
|
|
46
|
+
| custom modal, side panel, dropdown, tabs or tooltip | `Dialog`, `Drawer`, `Menu`, `Tabs`, `Tooltip` |
|
|
43
47
|
|
|
44
48
|
Raw elements are fine for semantics Becket doesn't cover (`form`, `main`, `nav`, `section`,
|
|
45
49
|
`ul`/`li`). Render them through a layout component's `as` prop when they also lay things out:
|
|
@@ -48,7 +52,6 @@ Raw elements are fine for semantics Becket doesn't cover (`form`, `main`, `nav`,
|
|
|
48
52
|
**Known gaps** (until these ship, an inline `style` with tokens is allowed, with a `TODO` naming the
|
|
49
53
|
ticket):
|
|
50
54
|
|
|
51
|
-
- Page width, padding and centering: no `Container` yet (MAV-90).
|
|
52
55
|
- Font weight on `Text`: no `weight` prop yet (MAV-106). Use `Text as="strong"` for bold.
|
|
53
56
|
- Status colors on `Badge` and `Tag`: no `success` / `warning` / `danger` visuals yet (MAV-107).
|
|
54
57
|
Don't use a brand visual (`primary`, `secondary`) to mean a status.
|
|
@@ -126,7 +129,7 @@ that holds state or handlers, never on a whole page or barrel file.
|
|
|
126
129
|
initialisms in one case (`userID`, `inviteURL`).
|
|
127
130
|
- Sort imports: third-party (React, then `@becket-ui/react`), then absolute app modules, then
|
|
128
131
|
relative.
|
|
129
|
-
- Comment **why**, not what. A `TODO` names its ticket: `// TODO (MAV-
|
|
132
|
+
- Comment **why**, not what. A `TODO` names its ticket: `// TODO (MAV-106): use Text weight`.
|
|
130
133
|
|
|
131
134
|
## 10. Example: a settings screen
|
|
132
135
|
|
|
@@ -169,7 +172,17 @@ What's wrong:
|
|
|
169
172
|
|
|
170
173
|
```tsx
|
|
171
174
|
import { useState } from "react";
|
|
172
|
-
import {
|
|
175
|
+
import {
|
|
176
|
+
Card,
|
|
177
|
+
CardBody,
|
|
178
|
+
Container,
|
|
179
|
+
Heading,
|
|
180
|
+
HStack,
|
|
181
|
+
Separator,
|
|
182
|
+
Switch,
|
|
183
|
+
Text,
|
|
184
|
+
VStack,
|
|
185
|
+
} from "@becket-ui/react";
|
|
173
186
|
|
|
174
187
|
const PREFERENCES = [
|
|
175
188
|
{
|
|
@@ -199,14 +212,7 @@ export function WorkspaceSettings() {
|
|
|
199
212
|
});
|
|
200
213
|
|
|
201
214
|
return (
|
|
202
|
-
|
|
203
|
-
<div
|
|
204
|
-
style={{
|
|
205
|
-
maxWidth: "var(--beckui--sizes-4xl)",
|
|
206
|
-
marginInline: "auto",
|
|
207
|
-
padding: "var(--beckui--spacing-xl)",
|
|
208
|
-
}}
|
|
209
|
-
>
|
|
215
|
+
<Container as="main" size="md">
|
|
210
216
|
<VStack gap="xl">
|
|
211
217
|
<VStack gap="xs">
|
|
212
218
|
<Heading as="h1" size="2xl">
|
|
@@ -246,13 +252,13 @@ export function WorkspaceSettings() {
|
|
|
246
252
|
</CardBody>
|
|
247
253
|
</Card>
|
|
248
254
|
</VStack>
|
|
249
|
-
</
|
|
255
|
+
</Container>
|
|
250
256
|
);
|
|
251
257
|
}
|
|
252
258
|
```
|
|
253
259
|
|
|
254
|
-
|
|
255
|
-
|
|
260
|
+
No raw layout or text elements are left: `Container` renders the `main` landmark, and every visual
|
|
261
|
+
decision is a prop with a token value.
|
|
256
262
|
|
|
257
263
|
## 11. Before you finish
|
|
258
264
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@becket-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Becket React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@becket-ui/tokens": "^0.
|
|
41
|
+
"@becket-ui/tokens": "^0.3.0",
|
|
42
42
|
"react": ">=19",
|
|
43
43
|
"react-dom": ">=19"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@becket-ui/a11y": "0.0.0",
|
|
47
|
-
"@becket-ui/tokens": "0.
|
|
47
|
+
"@becket-ui/tokens": "0.3.0",
|
|
48
48
|
"@pandacss/dev": "^1.12.1",
|
|
49
49
|
"@storybook/react": "^10.6.0",
|
|
50
50
|
"@storybook/react-vite": "^10.6.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vitest": "^5.0.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
|
-
"build": "tsup && tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
65
|
+
"build": "tsup && tsc --emitDeclarationOnly -p tsconfig.build.json && node scripts/add-js-extensions.mjs",
|
|
66
66
|
"test": "vitest run",
|
|
67
67
|
"storybook": "storybook dev -p 6006 -c ../../apps/docs/.storybook --project-root ../../apps/docs",
|
|
68
68
|
"build-storybook": "storybook build -c ../../apps/docs/.storybook --project-root ../../apps/docs"
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { render, screen } from "@testing-library/react";
|
|
4
|
-
import userEvent from "@testing-library/user-event";
|
|
5
|
-
import { assertNoAxeViolations } from "@becket-ui/a11y";
|
|
6
|
-
import { Button } from "./Button";
|
|
7
|
-
describe("Button", () => {
|
|
8
|
-
it('defaults to type="button"', () => {
|
|
9
|
-
render(/* @__PURE__ */ jsx(Button, { children: "Save" }));
|
|
10
|
-
expect(screen.getByRole("button", { name: "Save" }).getAttribute("type")).toBe("button");
|
|
11
|
-
});
|
|
12
|
-
it('keeps an explicit type="submit"', () => {
|
|
13
|
-
render(/* @__PURE__ */ jsx(Button, { type: "submit", children: "Send" }));
|
|
14
|
-
expect(screen.getByRole("button", { name: "Send" }).getAttribute("type")).toBe("submit");
|
|
15
|
-
});
|
|
16
|
-
it("does not set type when as is not button", () => {
|
|
17
|
-
render(
|
|
18
|
-
/* @__PURE__ */ jsx(Button, { as: "a", href: "#save", children: "Save" })
|
|
19
|
-
);
|
|
20
|
-
expect(screen.getByRole("link", { name: "Save" }).hasAttribute("type")).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
it('renders a link with anchor props when as="a"', () => {
|
|
23
|
-
render(
|
|
24
|
-
/* @__PURE__ */ jsx(Button, { as: "a", href: "https://example.com", target: "_blank", rel: "noopener noreferrer", visual: "primary", children: "Get started" })
|
|
25
|
-
);
|
|
26
|
-
const link = screen.getByRole("link", { name: "Get started" });
|
|
27
|
-
expect(link.getAttribute("href")).toBe("https://example.com");
|
|
28
|
-
expect(link.getAttribute("target")).toBe("_blank");
|
|
29
|
-
expect(link.className).toMatch(/beckui--button/);
|
|
30
|
-
});
|
|
31
|
-
it("types props by the rendered element", () => {
|
|
32
|
-
const typed = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(Button, { as: "a", href: "/docs", download: true, children: "Docs" }),
|
|
34
|
-
/* @__PURE__ */ jsx(Button, { href: "/docs", children: "Docs" }),
|
|
35
|
-
/* @__PURE__ */ jsx(Button, { as: "a", href: "/docs", disabled: true, children: "Docs" })
|
|
36
|
-
] });
|
|
37
|
-
expect(typed).toBeTruthy();
|
|
38
|
-
});
|
|
39
|
-
it("does not submit a wrapping form", async () => {
|
|
40
|
-
const onSubmit = vi.fn((event) => event.preventDefault());
|
|
41
|
-
const user = userEvent.setup();
|
|
42
|
-
render(
|
|
43
|
-
/* @__PURE__ */ jsx(
|
|
44
|
-
"form",
|
|
45
|
-
{
|
|
46
|
-
onSubmit: (event) => {
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
onSubmit(event.nativeEvent);
|
|
49
|
-
},
|
|
50
|
-
children: /* @__PURE__ */ jsx(Button, { children: "Confirm" })
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
);
|
|
54
|
-
await user.click(screen.getByRole("button", { name: "Confirm" }));
|
|
55
|
-
expect(onSubmit).not.toHaveBeenCalled();
|
|
56
|
-
});
|
|
57
|
-
it("has no axe violations on a named button", async () => {
|
|
58
|
-
const { container } = render(/* @__PURE__ */ jsx(Button, { children: "Save" }));
|
|
59
|
-
await assertNoAxeViolations(container);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=Button.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Button.test.tsx"],"sourcesContent":["import { describe, expect, it, vi } from 'vitest';\nimport { render, screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { assertNoAxeViolations } from '@becket-ui/a11y';\n\nimport { Button } from './Button';\n\ndescribe('Button', () => {\n it('defaults to type=\"button\"', () => {\n render(<Button>Save</Button>);\n expect(screen.getByRole('button', { name: 'Save' }).getAttribute('type')).toBe('button');\n });\n\n it('keeps an explicit type=\"submit\"', () => {\n render(<Button type=\"submit\">Send</Button>);\n expect(screen.getByRole('button', { name: 'Send' }).getAttribute('type')).toBe('submit');\n });\n\n it('does not set type when as is not button', () => {\n render(\n <Button as=\"a\" href=\"#save\">\n Save\n </Button>,\n );\n expect(screen.getByRole('link', { name: 'Save' }).hasAttribute('type')).toBe(false);\n });\n\n it('renders a link with anchor props when as=\"a\"', () => {\n render(\n <Button as=\"a\" href=\"https://example.com\" target=\"_blank\" rel=\"noopener noreferrer\" visual=\"primary\">\n Get started\n </Button>,\n );\n const link = screen.getByRole('link', { name: 'Get started' });\n expect(link.getAttribute('href')).toBe('https://example.com');\n expect(link.getAttribute('target')).toBe('_blank');\n expect(link.className).toMatch(/beckui--button/);\n });\n\n it('types props by the rendered element', () => {\n // Compile-time checks: these lines fail `tsc` if the polymorphic types regress.\n const typed = (\n <>\n <Button as=\"a\" href=\"/docs\" download>\n Docs\n </Button>\n {/* @ts-expect-error href is not a button prop */}\n <Button href=\"/docs\">Docs</Button>\n {/* @ts-expect-error disabled is not an anchor prop */}\n <Button as=\"a\" href=\"/docs\" disabled>\n Docs\n </Button>\n </>\n );\n expect(typed).toBeTruthy();\n });\n\n it('does not submit a wrapping form', async () => {\n const onSubmit = vi.fn((event: SubmitEvent) => event.preventDefault());\n const user = userEvent.setup();\n render(\n <form\n onSubmit={(event) => {\n event.preventDefault();\n onSubmit(event.nativeEvent);\n }}\n >\n <Button>Confirm</Button>\n </form>,\n );\n\n await user.click(screen.getByRole('button', { name: 'Confirm' }));\n expect(onSubmit).not.toHaveBeenCalled();\n });\n\n it('has no axe violations on a named button', async () => {\n const { container } = render(<Button>Save</Button>);\n await assertNoAxeViolations(container);\n });\n});\n"],"mappings":"AASW,SAiCL,UAjCK,K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