Skip to content

Commit d044675

Browse files
committed
Merge branch 'develop' into main
2 parents 354d974 + 994337a commit d044675

File tree

7 files changed

+461
-3
lines changed

7 files changed

+461
-3
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Select } from '@solved-ac/ui-react'
2+
import { ComponentMeta, ComponentStory } from '@storybook/react'
3+
import React from 'react'
4+
5+
export default {
6+
title: 'Components/Select',
7+
component: Select,
8+
argTypes: {
9+
value: {
10+
control: 'text',
11+
description: 'The value of the select',
12+
},
13+
items: {
14+
control: 'none',
15+
},
16+
fullWidth: {
17+
control: 'boolean',
18+
description:
19+
'Whether the selector should take up the full width of its container',
20+
},
21+
},
22+
} as ComponentMeta<typeof Select>
23+
24+
const Template: ComponentStory<typeof Select> = (args) => <Select {...args} />
25+
26+
export const Default = Template.bind({})
27+
Default.args = {
28+
value: 'Select',
29+
items: Array(10)
30+
.fill(undefined)
31+
.map((_, i) => `Item ${i}`),
32+
}
33+
34+
export const LongEntries = Template.bind({})
35+
LongEntries.args = {
36+
value: 'Select',
37+
items: Array(256)
38+
.fill(undefined)
39+
.map((_, i) => `Item ${i}`),
40+
}
41+
42+
export const CustomRender = Template.bind({})
43+
CustomRender.args = {
44+
value: 'Select',
45+
items: ['kr', 'gb', 'us', 'jp'],
46+
render: (s: string) => (
47+
<>
48+
<img
49+
src={`https://flagicons.lipis.dev/flags/4x3/${s}.svg`}
50+
alt={s}
51+
style={{ height: '1em' }}
52+
/>{' '}
53+
{s}
54+
</>
55+
),
56+
}

example/src/stories/Typo.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default {
3333
'readable',
3434
'no-ligatures',
3535
'no-margin',
36+
'ellipsis',
3637
],
3738
},
3839
description: 'The variant of the text',

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solved-ac/ui-react",
3-
"version": "0.2.7",
3+
"version": "0.2.9",
44
"description": "React component library used by solved.ac",
55
"author": "shiftpsh",
66
"license": "MIT",
@@ -76,5 +76,8 @@
7676
},
7777
"files": [
7878
"dist"
79-
]
79+
],
80+
"dependencies": {
81+
"@floating-ui/react-dom-interactions": "^0.8.0"
82+
}
8083
}

0 commit comments

Comments
 (0)