@bolttech/atoms-segmented-control 0.15.0 → 0.16.1
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/README.md +11 -11
- package/index.cjs +4 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -64,17 +64,17 @@ export default App;
|
|
|
64
64
|
|
|
65
65
|
The **SegmentedControl** component accepts the following props:
|
|
66
66
|
|
|
67
|
-
| Prop | Type | Description
|
|
68
|
-
| -------------- | -------- |
|
|
69
|
-
| `id` | string | The HTML `id` attribute for the segmented control.
|
|
70
|
-
| `dataTestId` | string | The data-testid attribute for testing purposes.
|
|
71
|
-
| `value` | string | The currently selected option value.
|
|
72
|
-
| `options` | Option[] | An array of option objects to be displayed.
|
|
73
|
-
| `fullWidth` | boolean | Boolean representing if should take full width.
|
|
74
|
-
| `errorMessage` | string | An optional error message to display.
|
|
75
|
-
| `onChange` | function | A callback function triggered on option change.
|
|
76
|
-
| `onBlur` | function | A callback function triggered on blur event.
|
|
77
|
-
| `onFocus` | function | A callback function triggered on focus event.
|
|
67
|
+
| Prop | Type | Description |
|
|
68
|
+
| -------------- | -------- | --------------------------------------------------------------------------------- |
|
|
69
|
+
| `id` | string | The HTML `id` attribute for the segmented control. |
|
|
70
|
+
| `dataTestId` | string | The data-testid attribute for testing purposes. |
|
|
71
|
+
| `value` | string | The currently selected option value. |
|
|
72
|
+
| `options` | Option[] | An array of option objects to be displayed. |
|
|
73
|
+
| `fullWidth` | boolean | Boolean representing if should take the containers full width on desktop devices. |
|
|
74
|
+
| `errorMessage` | string | An optional error message to display. |
|
|
75
|
+
| `onChange` | function | A callback function triggered on option change. |
|
|
76
|
+
| `onBlur` | function | A callback function triggered on blur event. |
|
|
77
|
+
| `onFocus` | function | A callback function triggered on focus event. |
|
|
78
78
|
|
|
79
79
|
## Example
|
|
80
80
|
|
package/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var react = require('react');
|
|
8
|
+
var frontendFoundations = require('@bolttech/frontend-foundations');
|
|
8
9
|
var styled = require('styled-components');
|
|
9
10
|
var uiUtils = require('@bolttech/ui-utils');
|
|
10
11
|
|
|
@@ -1853,15 +1854,15 @@ const Option = /*#__PURE__*/styled__default["default"].button.withConfig({
|
|
|
1853
1854
|
theme
|
|
1854
1855
|
}) => `${theme.components.segmentControl.paddingVertical} ${theme.components.segmentControl.paddingVertical}`, ({
|
|
1855
1856
|
theme
|
|
1856
|
-
}) => tokenToInteger(theme.components.segmentControl.gap) === 0 && styled.css(["&:
|
|
1857
|
+
}) => tokenToInteger(theme.components.segmentControl.gap) === 0 && styled.css(["&:last-of-type{border-left:0;}&:first-of-type:nth-last-child(3){border-right:0;}&:not(:first-of-type) + &:not(:last-of-type){border-right:0;border-left:0;}"]));
|
|
1857
1858
|
const SegmentedControlContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
1858
1859
|
displayName: "atoms-segmented-controlstyles__SegmentedControlContainer",
|
|
1859
1860
|
componentId: "sc-1lpqq2u-1"
|
|
1860
|
-
})(["display:flex;flex-direction:column;gap:", ";", ";"], ({
|
|
1861
|
+
})(["display:flex;flex-direction:column;gap:", ";", ";@media only screen and (max-width:", "px){button{flex:1;}}"], ({
|
|
1861
1862
|
theme
|
|
1862
1863
|
}) => theme.tokens.padding.XS, ({
|
|
1863
1864
|
$fullWidth
|
|
1864
|
-
}) => $fullWidth && styled.css(["button{flex:1;}"]));
|
|
1865
|
+
}) => $fullWidth && styled.css(["button{flex:1;}"]), frontendFoundations.ScreenSizes.SM.max);
|
|
1865
1866
|
const SegmentedControlWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
1866
1867
|
displayName: "atoms-segmented-controlstyles__SegmentedControlWrapper",
|
|
1867
1868
|
componentId: "sc-1lpqq2u-2"
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bolttech/atoms-segmented-control",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"main": "./index.cjs",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@bolttech/default-theme": "0.1.0",
|
|
9
9
|
"@bolttech/form-engine": "0.5.0",
|
|
10
|
-
"@bolttech/frontend-foundations": "0.
|
|
11
|
-
"@bolttech/ui-utils": "0.2.
|
|
10
|
+
"@bolttech/frontend-foundations": "0.3.1",
|
|
11
|
+
"@bolttech/ui-utils": "0.2.1",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"styled-components": "6.1.1"
|
|
14
14
|
},
|