@platformatic/ui-components 0.1.117 → 0.1.119
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/.github/workflows/ci.yml +1 -1
- package/.nvmrc +1 -1
- package/dist/assets/index-0313f1c8.js +206 -0
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/src/components/forms/RadioGroup.jsx +1 -1
- package/src/components/forms/Select.jsx +5 -3
- package/src/components/forms/Select.module.css +5 -3
- package/src/components/icons/CircleSubtractIcon.jsx +79 -0
- package/src/components/icons/index.js +2 -0
- package/dist/assets/index-c5108672.js +0 -206
package/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Platformatic UI Components</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-0313f1c8.js"></script>
|
|
8
8
|
<link rel="stylesheet" href="/assets/index-d72b255b.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/ui-components",
|
|
3
3
|
"description": "Platformatic UI Components",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.119",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react-dom": "^18.0.6",
|
|
46
46
|
"@vitejs/plugin-react": "^4.0.0",
|
|
47
47
|
"babel-loader": "^9.0.0",
|
|
48
|
-
"happy-dom": "^
|
|
48
|
+
"happy-dom": "^12.0.0",
|
|
49
49
|
"jsdom": "^22.0.0",
|
|
50
50
|
"react-test-renderer": "^18.2.0",
|
|
51
51
|
"snazzy": "^9.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"storybook": "^7.0.20",
|
|
54
54
|
"tailwindcss": "^3.1.8",
|
|
55
55
|
"vite": "^4.0.0",
|
|
56
|
-
"vitest": "^0.
|
|
56
|
+
"vitest": "^0.34.0"
|
|
57
57
|
},
|
|
58
58
|
"standard": {
|
|
59
59
|
"globals": [
|
|
@@ -15,7 +15,7 @@ function RadioGroup ({ name, radios, errorMessage, onChange, disabled, value })
|
|
|
15
15
|
<div className={styles.radioGroupContainer}>
|
|
16
16
|
{radios.map(radio => (
|
|
17
17
|
<div className={radioContainerClass} key={radio.value}>
|
|
18
|
-
<input className={styles.radio} type='radio' name={name} value={radio.value} onChange={onChange} disabled={disabled} checked={radio.value === value} />
|
|
18
|
+
<input className={styles.radio} type='radio' id={radio.name} name={name} value={radio.value} onChange={onChange} disabled={disabled} checked={radio.value === value} />
|
|
19
19
|
<label className={styles.label} htmlFor={radio.name}>{radio.label}</label>
|
|
20
20
|
</div>
|
|
21
21
|
))}
|
|
@@ -72,8 +72,10 @@ function Select ({
|
|
|
72
72
|
return setSelected(option)
|
|
73
73
|
}}
|
|
74
74
|
>
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
<div className={styles.liContent}>
|
|
76
|
+
{option.iconName && <PlatformaticIcon iconName={option.iconName} color={optionsIconColor} size={SMALL} onClick={null} />}
|
|
77
|
+
<span>{option.label}</span>
|
|
78
|
+
</div>
|
|
77
79
|
</li>
|
|
78
80
|
)
|
|
79
81
|
}
|
|
@@ -117,7 +119,7 @@ function Select ({
|
|
|
117
119
|
if (showOptions) {
|
|
118
120
|
setShowOptions(false)
|
|
119
121
|
}
|
|
120
|
-
},
|
|
122
|
+
}, 250)
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
return (
|
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
}
|
|
10
10
|
.select.active,
|
|
11
11
|
.select:focus {
|
|
12
|
-
@apply shadow-main-dark-blue;
|
|
13
|
-
outline: none;
|
|
12
|
+
@apply shadow-main-dark-blue outline-none;
|
|
14
13
|
}
|
|
15
14
|
.options {
|
|
16
15
|
@apply absolute left-0 top-[42px] bg-white w-full max-h-[216px] overflow-y-scroll z-20;
|
|
17
16
|
box-shadow: 0px 0px 10px rgb(0 40 61 / 25%);
|
|
18
17
|
}
|
|
19
18
|
.option {
|
|
20
|
-
@apply w-full
|
|
19
|
+
@apply w-full border-b border-main-dark-blue/[.15] font-light cursor-pointer hover:bg-main-dark-blue hover:bg-opacity-10 z-10;
|
|
21
20
|
}
|
|
22
21
|
.icons {
|
|
23
22
|
@apply absolute top-[50%] right-[0.5rem] translate-y-[-50%] flex gap-x-2;
|
|
24
23
|
}
|
|
24
|
+
.liContent {
|
|
25
|
+
@apply px-4 py-2 inline-flex items-center gap-x-1 relative z-[-1];
|
|
26
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
3
|
+
import styles from './Icons.module.css'
|
|
4
|
+
import { COLORS_ICON, SIZES, SMALL, MEDIUM, LARGE, MAIN_DARK_BLUE } from '../constants'
|
|
5
|
+
|
|
6
|
+
const CircleSubtractIcon = ({ color, size }) => {
|
|
7
|
+
const className = `${styles.noShrinkForFlex} ` + styles[`${color}`]
|
|
8
|
+
let icon = <></>
|
|
9
|
+
|
|
10
|
+
switch (size) {
|
|
11
|
+
case SMALL:
|
|
12
|
+
icon = (
|
|
13
|
+
<svg
|
|
14
|
+
width={16}
|
|
15
|
+
height={16}
|
|
16
|
+
viewBox='0 0 16 16'
|
|
17
|
+
fill='none'
|
|
18
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
19
|
+
className={className}
|
|
20
|
+
>
|
|
21
|
+
<circle cx={8} cy={8} r={6} stroke='none' />
|
|
22
|
+
<line x1={5} y1={8} x2={11} y2={8} stroke='none' strokeLinecap='round' />
|
|
23
|
+
</svg>
|
|
24
|
+
)
|
|
25
|
+
break
|
|
26
|
+
case MEDIUM:
|
|
27
|
+
icon = (
|
|
28
|
+
<svg
|
|
29
|
+
width={24}
|
|
30
|
+
height={24}
|
|
31
|
+
viewBox='0 0 24 24'
|
|
32
|
+
fill='none'
|
|
33
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
34
|
+
className={className}
|
|
35
|
+
>
|
|
36
|
+
<circle cx={12} cy={12} r={9} stroke='none' strokeWidth={1.5} />
|
|
37
|
+
<line x1={7.5} y1={12} x2={16.5} y2={12} stroke='none' strokeWidth={1.5} strokeLinecap='round' />
|
|
38
|
+
</svg>
|
|
39
|
+
)
|
|
40
|
+
break
|
|
41
|
+
case LARGE:
|
|
42
|
+
icon = (
|
|
43
|
+
<svg
|
|
44
|
+
width={40}
|
|
45
|
+
height={40}
|
|
46
|
+
viewBox='0 0 40 40'
|
|
47
|
+
fill='none'
|
|
48
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
49
|
+
className={className}
|
|
50
|
+
>
|
|
51
|
+
<circle cx={20} cy={20} r={15} stroke='none' strokeWidth={2} />
|
|
52
|
+
<line x1={12.25} y1={20.25} x2={27.75} y2={20.25} stroke='none' strokeWidth={2} strokeLinecap='round' />
|
|
53
|
+
</svg>
|
|
54
|
+
)
|
|
55
|
+
break
|
|
56
|
+
|
|
57
|
+
default:
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
return icon
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
CircleSubtractIcon.propTypes = {
|
|
64
|
+
/**
|
|
65
|
+
* color of text, icon and borders
|
|
66
|
+
*/
|
|
67
|
+
color: PropTypes.oneOf(COLORS_ICON),
|
|
68
|
+
/**
|
|
69
|
+
* Size
|
|
70
|
+
*/
|
|
71
|
+
size: PropTypes.oneOf(SIZES)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
CircleSubtractIcon.defaultProps = {
|
|
75
|
+
color: MAIN_DARK_BLUE,
|
|
76
|
+
size: MEDIUM
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default CircleSubtractIcon
|
|
@@ -34,6 +34,7 @@ import CircleEditIcon from './CircleEditIcon'
|
|
|
34
34
|
import CircleFullIcon from './CircleFullIcon'
|
|
35
35
|
import CircleGearIcon from './CircleGearIcon'
|
|
36
36
|
import CircleRestartIcon from './CircleRestartIcon'
|
|
37
|
+
import CircleSubtractIcon from './CircleSubtractIcon'
|
|
37
38
|
import CircleTwoArrowsDownIcon from './CircleTwoArrowsDownIcon'
|
|
38
39
|
import CircleTwoArrowsUpIcon from './CircleTwoArrowsUpIcon'
|
|
39
40
|
import CloseIcon from './CloseIcon'
|
|
@@ -135,6 +136,7 @@ export default {
|
|
|
135
136
|
CircleFullIcon,
|
|
136
137
|
CircleGearIcon,
|
|
137
138
|
CircleRestartIcon,
|
|
139
|
+
CircleSubtractIcon,
|
|
138
140
|
CircleTwoArrowsDownIcon,
|
|
139
141
|
CircleTwoArrowsUpIcon,
|
|
140
142
|
CloseIcon,
|