@basic-ui/material 0.1.14 → 0.1.15
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/build/cjs/index.js +6 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/Chip/ButtonChip.js +4 -0
- package/build/esm/Chip/ButtonChip.js.map +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +6 -6
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Select/Select.js +2 -2
- package/build/esm/Select/Select.js.map +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/LoremIpsum.d.ts +4 -4
- package/build/esm/Text/LoremIpsum.js.map +1 -1
- package/build/esm/Text/Text.d.ts +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/TextField/TextField.js +2 -2
- package/build/esm/TextField/TextField.js.map +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/tsconfig.tsbuildinfo +1 -4757
- package/package.json +13 -13
- package/src/Chip/ButtonChip.tsx +3 -1
- package/src/Chip/Chip.story.tsx +52 -0
- package/src/Combobox/Combobox.story.tsx +0 -3
- package/src/Select/Select.tsx +1 -1
- package/src/Text/LoremIpsum.tsx +3 -1
- package/src/TextField/TextField.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basic-ui/material",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Accessible React Components used as building blocks for UI patterns",
|
|
5
5
|
"author": "Lucas Terra <lucasterra7@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "concurrently \"yarn:build:*\"",
|
|
18
|
-
"build:dts": "tsc -p ./tsconfig.json --isolatedModules false --declaration --emitDeclarationOnly",
|
|
19
|
-
"build:cjs": "rollup -c ../../rollup.config.js",
|
|
20
|
-
"build:esm": "cross-env NODE_ENV=production BABEL_ENV=esm babel --config-file ../../babel.config.js ./src --extensions \".ts,.tsx,.js,.jsx\" --source-maps --out-dir ./build/esm --ignore \"**/*.story.tsx,**/*.story.ts,**/*.test.tsx,**/*.test.ts\"",
|
|
21
|
-
"build-storybook": "build-storybook -c ../../scripts/storybook -o .out",
|
|
22
|
-
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
|
|
23
|
-
"format": "prettier --write '**/*.js'",
|
|
24
|
-
"start": "
|
|
25
|
-
"serve": "http-server .out",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
17
|
+
"build": "run -T concurrently \"yarn:build:*\"",
|
|
18
|
+
"build:dts": "run -T tsc -p ./tsconfig.json --isolatedModules false --declaration --emitDeclarationOnly",
|
|
19
|
+
"build:cjs": "run -T rollup -c ../../rollup.config.js",
|
|
20
|
+
"build:esm": "run -T cross-env NODE_ENV=production BABEL_ENV=esm run -T babel --config-file ../../babel.config.js ./src --extensions \".ts,.tsx,.js,.jsx\" --source-maps --out-dir ./build/esm --ignore \"**/*.story.tsx,**/*.story.ts,**/*.test.tsx,**/*.test.ts\"",
|
|
21
|
+
"build-storybook": "run -T build-storybook -c ../../scripts/storybook -o .out",
|
|
22
|
+
"lint": "run -T eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
|
|
23
|
+
"format": "run -T prettier --write '**/*.js'",
|
|
24
|
+
"start": "run -T start-storybook -p 9001 -c ./scripts/storybook",
|
|
25
|
+
"serve": "run -T http-server .out",
|
|
26
|
+
"typecheck": "run -T tsc --noEmit -p ./tsconfig.json",
|
|
27
27
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@basic-ui/core": "^0.0.
|
|
30
|
+
"@basic-ui/core": "^0.0.38",
|
|
31
31
|
"@styled-system/should-forward-prop": "5.1.5",
|
|
32
32
|
"@types/styled-system": "^5.1.10",
|
|
33
33
|
"@types/styled-system__css": "^5.0.14",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0",
|
|
51
51
|
"react-spring": "^9.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f3a2affbe87fb4f5e59f5528f9e3af53fc311120"
|
|
54
54
|
}
|
package/src/Chip/ButtonChip.tsx
CHANGED
|
@@ -77,7 +77,9 @@ export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
|
|
|
77
77
|
<Box as="span" pl={rem(4)} pr={rem(8)}>
|
|
78
78
|
{leftIcon}
|
|
79
79
|
</Box>
|
|
80
|
-
<Box as="span"
|
|
80
|
+
<Box as="span" __css={{ minWidth: 'auto', whiteSpace: 'nowrap' }}>
|
|
81
|
+
{children}
|
|
82
|
+
</Box>
|
|
81
83
|
<Box as="span" pl={rem(6)} pr={rem(6)}>
|
|
82
84
|
{rightIcon}
|
|
83
85
|
</Box>
|
package/src/Chip/Chip.story.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Text } from '../Text';
|
|
|
4
4
|
import { alpha } from '../color';
|
|
5
5
|
import { RadioGroup } from '../RadioButton';
|
|
6
6
|
import { ChoiceChip } from './ChoiceChip';
|
|
7
|
+
import { LoremIpsum } from '../Text/LoremIpsum';
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
title: 'components/Chip',
|
|
@@ -167,3 +168,54 @@ export const AllVariants = () => {
|
|
|
167
168
|
</>
|
|
168
169
|
);
|
|
169
170
|
};
|
|
171
|
+
|
|
172
|
+
export const HorizontallyScrollableExample = () => {
|
|
173
|
+
const texts = [
|
|
174
|
+
'Temakis',
|
|
175
|
+
'Sushis',
|
|
176
|
+
'Beers',
|
|
177
|
+
'Wine',
|
|
178
|
+
'Soft drinks',
|
|
179
|
+
'Cold drinks',
|
|
180
|
+
];
|
|
181
|
+
return (
|
|
182
|
+
<Box maxWidth="300px" sx={{ backgroundColor: '#ccc' }}>
|
|
183
|
+
<Box
|
|
184
|
+
as="nav"
|
|
185
|
+
sx={{
|
|
186
|
+
position: 'sticky',
|
|
187
|
+
top: 0,
|
|
188
|
+
overflowX: 'auto',
|
|
189
|
+
bg: 'surface',
|
|
190
|
+
py: 3,
|
|
191
|
+
zIndex: 1,
|
|
192
|
+
borderColor: '#aeaeae',
|
|
193
|
+
borderWidth: '1px',
|
|
194
|
+
borderStyle: 'solid',
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
<Box
|
|
198
|
+
sx={{
|
|
199
|
+
px: 3,
|
|
200
|
+
display: 'flex',
|
|
201
|
+
minWidth: 'auto',
|
|
202
|
+
width: 'auto',
|
|
203
|
+
scrollbarWidth: 'none',
|
|
204
|
+
'& > :not(first-of-type)': {
|
|
205
|
+
marginLeft: 2,
|
|
206
|
+
},
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
{texts.map((text) => (
|
|
210
|
+
<Box key={text} sx={{ minWidth: 'auto' }}>
|
|
211
|
+
<Chip key={text}>{text}</Chip>
|
|
212
|
+
</Box>
|
|
213
|
+
))}
|
|
214
|
+
</Box>
|
|
215
|
+
</Box>
|
|
216
|
+
<Box>
|
|
217
|
+
<LoremIpsum count={20} />
|
|
218
|
+
</Box>
|
|
219
|
+
</Box>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
@@ -2,7 +2,6 @@ import { useMemo, useState } from 'react';
|
|
|
2
2
|
import type * as React from 'react';
|
|
3
3
|
import {
|
|
4
4
|
Combobox,
|
|
5
|
-
ComboboxLabel,
|
|
6
5
|
ComboboxOption,
|
|
7
6
|
ComboboxList,
|
|
8
7
|
ComboboxPopover,
|
|
@@ -107,8 +106,6 @@ function ControlledClientSideExample({ initialValue = '' }) {
|
|
|
107
106
|
<p>Selection: {selected}</p>
|
|
108
107
|
<p>Term: {term}</p>
|
|
109
108
|
<Combobox onSelect={handleSelect} selectOnBlur>
|
|
110
|
-
<ComboboxLabel>Enter a city name</ComboboxLabel>
|
|
111
|
-
<br />
|
|
112
109
|
<Box position="relative">
|
|
113
110
|
<ComboboxInput
|
|
114
111
|
onChange={handleChange}
|
package/src/Select/Select.tsx
CHANGED
package/src/Text/LoremIpsum.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { Text } from '.';
|
|
2
3
|
|
|
3
4
|
const phrase =
|
|
4
5
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tincidunt sem ut tincidunt eleifend. Cras eget sem nisi. Mauris at orci pretium, auctor ex non, vestibulum mauris. Etiam at nisi eu enim volutpat semper. Phasellus interdum tincidunt eleifend. Suspendisse potenti. Nulla dapibus felis in purus tristique pharetra. Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
export const LoremIpsum: FC<{ count: number }> = ({ count = 50 }) => {
|
|
6
8
|
const phrases = [];
|
|
7
9
|
for (let i = 0; i < count; i++) {
|
|
8
10
|
phrases.push(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { forwardRef, useState } from 'react';
|
|
1
|
+
import { forwardRef, useState, useId } from 'react';
|
|
2
2
|
import type * as React from 'react';
|
|
3
|
-
import { wrapEvent,
|
|
3
|
+
import { wrapEvent, useControlledState } from '@basic-ui/core';
|
|
4
4
|
import { Input, InputProps } from './Input';
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
6
|
import { FilledContainer } from './FilledContainer';
|