x-ui-design 1.0.2 → 1.0.3

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.
@@ -586,7 +586,9 @@ const Select = ({
586
586
  (e) => e.value === selected || e.label === selected || e.children === selected
587
587
  ) || selected;
588
588
 
589
- return <div style={{ display: 'contents' }}>{typeof option === 'string' ? option : option?.children || option?.label || option?.value || null}</div>;
589
+ const title = typeof option === 'string' ? option : option?.children || option?.label || option?.value || null
590
+
591
+ return <div data-testid={title} style={{ display: 'contents' }}>{title}</div>;
590
592
  }, [extractedOptions, selected]) || selected || null;
591
593
 
592
594
  const hasMaxTagCount = hasMode && (typeof maxTagCount === 'number' || maxTagCount === 'responsive');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-ui-design",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "license": "ISC",
5
5
  "author": "Gabriel Boyajyan",
6
6
  "main": "dist/index.js",
package/src/app/page.tsx CHANGED
@@ -3,33 +3,20 @@
3
3
  import { Result } from "../../lib/components/Result";
4
4
  import { Button } from '../../lib/components/Button';
5
5
  import { Popover } from '../../lib/components/Popover';
6
- import { ClearIcon } from "../../lib/components/Icons/Icons";
6
+ import { Select } from "../../lib/components/Select";
7
+ import Option from "../../lib/components/Select/Option/Option";
8
+ import Tag from "../../lib/components/Select/Tag/Tag";
7
9
 
8
10
  export default function Home() {
9
11
  return (
10
- <div>
11
- <div style={{ height: 200 }} />
12
- <div style={{ display: "flex" }}>
13
- <div style={{ width: '100%' }} />
14
-
15
- <Popover
16
- // placement="bottomRight"
17
- trigger="click"
18
- getPopupContainer={() => document.body}
19
- content={
20
- <Result
21
- status="success"
22
- title="Success"
23
- subTitle="Sorry, you are not authorized to access this page."
24
- extra={<Button type="primary">Back Home</Button>}
25
- />
26
- }
27
- >
28
- <ClearIcon />
29
- </Popover>
30
- <div style={{ width: '100%' }} />
31
- </div>
32
- </div>
12
+ <Select mode="tags"
13
+ tagRender={(tagProps) => {
14
+ return <Tag {...tagProps}>{tagProps.value}</Tag>
15
+ }}
16
+ options={[ {value: 'tag_1', label: 'Tag 1'}]}
17
+ />
18
+ // {/* <Option value={'tag_1'}>tag 1</Option> */}
19
+ // </Select>
33
20
  )
34
21
  }
35
22