@redsift/design-system 11.9.4 → 12.0.0-muiv6
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/CONTRIBUTING.md +1 -5
- package/_internal/Alert2.js +9 -4
- package/_internal/Alert2.js.map +1 -1
- package/_internal/AppContent.js +9 -4
- package/_internal/AppContent.js.map +1 -1
- package/_internal/Badge2.js +9 -4
- package/_internal/Badge2.js.map +1 -1
- package/_internal/Breadcrumbs2.js +9 -4
- package/_internal/Breadcrumbs2.js.map +1 -1
- package/_internal/Button2.js +9 -4
- package/_internal/Button2.js.map +1 -1
- package/_internal/ButtonGroup.js +15 -6
- package/_internal/ButtonGroup.js.map +1 -1
- package/_internal/ButtonLink.js +1 -1
- package/_internal/Card2.js +9 -4
- package/_internal/Card2.js.map +1 -1
- package/_internal/CardActions.js +16 -12
- package/_internal/CardActions.js.map +1 -1
- package/_internal/CardBody.js +9 -4
- package/_internal/CardBody.js.map +1 -1
- package/_internal/CardHeader.js +13 -4
- package/_internal/CardHeader.js.map +1 -1
- package/_internal/Checkbox2.js +9 -4
- package/_internal/Checkbox2.js.map +1 -1
- package/_internal/CheckboxGroup.js +9 -4
- package/_internal/CheckboxGroup.js.map +1 -1
- package/_internal/DetailedCard.js +24 -12
- package/_internal/DetailedCard.js.map +1 -1
- package/_internal/Flexbox2.js +21 -16
- package/_internal/Flexbox2.js.map +1 -1
- package/_internal/Grid2.js +21 -16
- package/_internal/Grid2.js.map +1 -1
- package/_internal/GridItem.js +9 -4
- package/_internal/GridItem.js.map +1 -1
- package/_internal/Heading2.js +9 -4
- package/_internal/Heading2.js.map +1 -1
- package/_internal/Icon2.js +10 -5
- package/_internal/Icon2.js.map +1 -1
- package/_internal/IconButton.js +9 -4
- package/_internal/IconButton.js.map +1 -1
- package/_internal/IconButtonLink.js +1 -1
- package/_internal/Item2.js +16 -7
- package/_internal/Item2.js.map +1 -1
- package/_internal/Link2.js +9 -4
- package/_internal/Link2.js.map +1 -1
- package/_internal/LinkButton.js +2 -1
- package/_internal/LinkButton.js.map +1 -1
- package/_internal/Listbox2.js +14 -8
- package/_internal/Listbox2.js.map +1 -1
- package/_internal/Number2.js +10 -5
- package/_internal/Number2.js.map +1 -1
- package/_internal/NumberField.js +11 -6
- package/_internal/NumberField.js.map +1 -1
- package/_internal/Pill2.js +9 -4
- package/_internal/Pill2.js.map +1 -1
- package/_internal/ProgressBar.js +20 -11
- package/_internal/ProgressBar.js.map +1 -1
- package/_internal/Radio2.js +9 -4
- package/_internal/Radio2.js.map +1 -1
- package/_internal/RadioGroup.js +9 -4
- package/_internal/RadioGroup.js.map +1 -1
- package/_internal/Shield2.js +12 -7
- package/_internal/Shield2.js.map +1 -1
- package/_internal/SideNavigationMenu.js +1 -1
- package/_internal/Skeleton2.js +9 -4
- package/_internal/Skeleton2.js.map +1 -1
- package/_internal/SkeletonCircle.js +1 -1
- package/_internal/SkeletonText.js +1 -1
- package/_internal/Spinner2.js +9 -4
- package/_internal/Spinner2.js.map +1 -1
- package/_internal/Switch2.js +9 -4
- package/_internal/Switch2.js.map +1 -1
- package/_internal/SwitchGroup.js +9 -4
- package/_internal/SwitchGroup.js.map +1 -1
- package/_internal/Text2.js +13 -6
- package/_internal/Text2.js.map +1 -1
- package/_internal/TextArea.js +18 -12
- package/_internal/TextArea.js.map +1 -1
- package/_internal/TextField.js +12 -6
- package/_internal/TextField.js.map +1 -1
- package/_internal/_rollupPluginBabelHelpers.js +1 -1
- package/_internal/button.js +1 -1
- package/_internal/colors.js +1 -1
- package/_internal/icon-button.js +1 -1
- package/_internal/link.js +1 -1
- package/_internal/shared.js +1 -1
- package/_internal/styles.js +309 -217
- package/_internal/styles.js.map +1 -1
- package/_internal/styles2.js +202 -14
- package/_internal/styles2.js.map +1 -1
- package/_internal/styles3.js +30 -128
- package/_internal/styles3.js.map +1 -1
- package/_internal/styles4.js +129 -234
- package/_internal/styles4.js.map +1 -1
- package/_internal/styles5.js +227 -118
- package/_internal/styles5.js.map +1 -1
- package/_internal/styles6.js +128 -69
- package/_internal/styles6.js.map +1 -1
- package/_internal/styles7.js +84 -0
- package/_internal/styles7.js.map +1 -0
- package/_internal/text.js +1 -1
- package/_internal/types2.js.map +1 -1
- package/_internal/useFocusOnList.js +1 -1
- package/_internal/useFocusRing.js +1 -1
- package/_internal/useListboxItem.js.map +1 -1
- package/_internal/useLocalizedStringFormatter.js +1 -1
- package/_internal/useMessageFormatter.js +1 -1
- package/_internal/useNumberFormatter.js +1 -1
- package/index.d.ts +227 -136
- package/index.js +8 -164
- package/index.js.map +1 -1
- package/package.json +5 -6
package/_internal/styles.js
CHANGED
|
@@ -1,235 +1,327 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { a as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
|
|
3
|
+
const AlignSelf = {
|
|
4
|
+
auto: 'auto',
|
|
5
|
+
normal: 'normal',
|
|
6
|
+
start: 'start',
|
|
7
|
+
end: 'end',
|
|
8
|
+
center: 'center',
|
|
9
|
+
'flex-start': 'flex-start',
|
|
10
|
+
'flex-end': 'flex-end',
|
|
11
|
+
'self-start': 'self-start',
|
|
12
|
+
'self-end': 'self-end',
|
|
13
|
+
baseline: 'baseline',
|
|
14
|
+
stretch: 'stretch'
|
|
15
|
+
};
|
|
16
|
+
const JustifySelf = {
|
|
17
|
+
auto: 'auto',
|
|
18
|
+
normal: 'normal',
|
|
19
|
+
start: 'start',
|
|
20
|
+
end: 'end',
|
|
21
|
+
center: 'center',
|
|
22
|
+
'flex-start': 'flex-start',
|
|
23
|
+
'flex-end': 'flex-end',
|
|
24
|
+
'self-start': 'self-start',
|
|
25
|
+
'self-end': 'self-end',
|
|
26
|
+
left: 'left',
|
|
27
|
+
right: 'right',
|
|
28
|
+
stretch: 'stretch'
|
|
29
|
+
};
|
|
30
|
+
const AlignContent = {
|
|
31
|
+
'flex-start': 'flex-start',
|
|
32
|
+
'flex-end': 'flex-end',
|
|
33
|
+
center: 'center',
|
|
34
|
+
'space-between': 'space-between',
|
|
35
|
+
'space-around': 'space-around',
|
|
36
|
+
'space-evenly': 'space-evenly',
|
|
37
|
+
stretch: 'stretch',
|
|
38
|
+
start: 'start',
|
|
39
|
+
end: 'end',
|
|
40
|
+
baseline: 'baseline',
|
|
41
|
+
'first baseline': 'first baseline',
|
|
42
|
+
'last baseline': 'last baseline'
|
|
43
|
+
};
|
|
44
|
+
const AlignItems = {
|
|
45
|
+
stretch: 'stretch',
|
|
46
|
+
'flex-start': 'flex-start',
|
|
47
|
+
'flex-end': 'flex-end',
|
|
48
|
+
center: 'center',
|
|
49
|
+
baseline: 'baseline',
|
|
50
|
+
'first baseline': 'first baseline',
|
|
51
|
+
'last baseline': 'last baseline',
|
|
52
|
+
start: 'start',
|
|
53
|
+
end: 'end',
|
|
54
|
+
'self-start': 'self-start',
|
|
55
|
+
'self-end': 'self-end'
|
|
56
|
+
};
|
|
57
|
+
const FlexDirection = {
|
|
58
|
+
row: 'row',
|
|
59
|
+
'row-reverse': 'row-reverse',
|
|
60
|
+
column: 'column',
|
|
61
|
+
'column-reverse': 'column-reverse'
|
|
62
|
+
};
|
|
63
|
+
const FlexWrap = {
|
|
64
|
+
nowrap: 'nowrap',
|
|
65
|
+
wrap: 'wrap',
|
|
66
|
+
'wrap-reverse': 'wrap-reverse'
|
|
67
|
+
};
|
|
68
|
+
const JustifyContent = {
|
|
69
|
+
'flex-start': 'flex-start',
|
|
70
|
+
'flex-end': 'flex-end',
|
|
71
|
+
center: 'center',
|
|
72
|
+
'space-between': 'space-between',
|
|
73
|
+
'space-around': 'space-around',
|
|
74
|
+
'space-evenly': 'space-evenly',
|
|
75
|
+
start: 'start',
|
|
76
|
+
end: 'end',
|
|
77
|
+
left: 'left',
|
|
78
|
+
right: 'right',
|
|
79
|
+
baseline: 'baseline',
|
|
80
|
+
'first baseline': 'first baseline',
|
|
81
|
+
'last baseline': 'last baseline',
|
|
82
|
+
stretch: 'stretch'
|
|
83
|
+
};
|
|
84
|
+
const JustifyItems = {
|
|
85
|
+
start: 'start',
|
|
86
|
+
end: 'end',
|
|
87
|
+
center: 'center',
|
|
88
|
+
stretch: 'stretch'
|
|
89
|
+
};
|
|
90
|
+
const getContainerProps = props => _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, props.alignContent && {
|
|
91
|
+
alignContent: props.alignContent
|
|
92
|
+
}), props.alignItems && {
|
|
93
|
+
alignItems: props.alignItems
|
|
94
|
+
}), props.bottom && {
|
|
95
|
+
bottom: props.bottom
|
|
96
|
+
}), props.flexDirection && {
|
|
97
|
+
flexDirection: props.flexDirection
|
|
98
|
+
}), props.flexWrap && {
|
|
99
|
+
flexWrap: props.flexWrap
|
|
100
|
+
}), props.gap && {
|
|
101
|
+
gap: props.gap
|
|
102
|
+
}), props.gridAutoColumns && {
|
|
103
|
+
gridAutoColumns: props.gridAutoColumns
|
|
104
|
+
}), props.gridAutoRows && {
|
|
105
|
+
gridAutoRows: props.gridAutoRows
|
|
106
|
+
}), props.gridTemplateAreas && {
|
|
107
|
+
gridTemplateAreas: props.gridTemplateAreas
|
|
108
|
+
}), props.gridTemplateColumns && {
|
|
109
|
+
gridTemplateColumns: props.gridTemplateColumns
|
|
110
|
+
}), props.gridTemplateRows && {
|
|
111
|
+
gridTemplateRows: props.gridTemplateRows
|
|
112
|
+
}), props.height && {
|
|
113
|
+
height: props.height
|
|
114
|
+
}), props.justifyContent && {
|
|
115
|
+
justifyContent: props.justifyContent
|
|
116
|
+
}), props.justifyItems && {
|
|
117
|
+
justifyItems: props.justifyItems
|
|
118
|
+
}), props.left && {
|
|
119
|
+
left: props.left
|
|
120
|
+
}), props.margin && {
|
|
121
|
+
margin: props.margin
|
|
122
|
+
}), props.marginBottom && {
|
|
123
|
+
marginBottom: props.marginBottom
|
|
124
|
+
}), props.marginLeft && {
|
|
125
|
+
marginLeft: props.marginLeft
|
|
126
|
+
}), props.marginRight && {
|
|
127
|
+
marginRight: props.marginRight
|
|
128
|
+
}), props.marginTop && {
|
|
129
|
+
marginTop: props.marginTop
|
|
130
|
+
}), props.maxHeight && {
|
|
131
|
+
maxHeight: props.maxHeight
|
|
132
|
+
}), props.maxWidth && {
|
|
133
|
+
maxWidth: props.maxWidth
|
|
134
|
+
}), props.minHeight && {
|
|
135
|
+
minHeight: props.minHeight
|
|
136
|
+
}), props.minWidth && {
|
|
137
|
+
minWidth: props.minWidth
|
|
138
|
+
}), props.padding && {
|
|
139
|
+
padding: props.padding
|
|
140
|
+
}), props.paddingBottom && {
|
|
141
|
+
paddingBottom: props.paddingBottom
|
|
142
|
+
}), props.paddingLeft && {
|
|
143
|
+
paddingLeft: props.paddingLeft
|
|
144
|
+
}), props.paddingRight && {
|
|
145
|
+
paddingRight: props.paddingRight
|
|
146
|
+
}), props.paddingTop && {
|
|
147
|
+
paddingTop: props.paddingTop
|
|
148
|
+
}), props.position && {
|
|
149
|
+
position: props.position
|
|
150
|
+
}), props.right && {
|
|
151
|
+
right: props.right
|
|
152
|
+
}), props.top && {
|
|
153
|
+
top: props.top
|
|
154
|
+
}), props.width && {
|
|
155
|
+
width: props.width
|
|
156
|
+
}), props.zIndex && {
|
|
157
|
+
zIndex: props.zIndex
|
|
158
|
+
});
|
|
3
159
|
|
|
4
160
|
/**
|
|
5
|
-
*
|
|
161
|
+
* Converts styling props to transient props by adding a $ prefix.
|
|
162
|
+
* Filters out undefined values to avoid passing unnecessary props.
|
|
6
163
|
*/
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
164
|
+
const toTransientProps = (props, keys) => {
|
|
165
|
+
return keys.reduce((acc, key) => {
|
|
166
|
+
const value = props[key];
|
|
167
|
+
if (value !== undefined) {
|
|
168
|
+
const transientKey = `$${String(key)}`;
|
|
169
|
+
acc[transientKey] = value;
|
|
170
|
+
}
|
|
171
|
+
return acc;
|
|
172
|
+
}, {});
|
|
11
173
|
};
|
|
174
|
+
const LAYOUT_PROPS_KEYS = ['flex', 'flexGrow', 'flexShrink', 'flexBasis', 'alignSelf', 'justifySelf', 'order', 'gridArea', 'gridColumn', 'gridRow', 'gridColumnStart', 'gridColumnEnd', 'gridRowStart', 'gridRowEnd'];
|
|
175
|
+
const SPACING_PROPS_KEYS = ['margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop'];
|
|
176
|
+
const SIZING_PROPS_KEYS = ['height', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'width'];
|
|
177
|
+
const POSITIONING_PROPS_KEYS = ['position', 'top', 'bottom', 'left', 'right', 'zIndex'];
|
|
178
|
+
const INTERNAL_SPACING_PROPS_KEYS = ['padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'];
|
|
179
|
+
const BORDER_PROPS_KEYS = ['background', 'backgroundColor', 'border', 'borderTop', 'borderBottom', 'borderLeft', 'borderRight', 'borderRadius', 'boxShadow'];
|
|
180
|
+
const FLEX_LAYOUT_PROPS_KEYS = ['alignContent', 'alignItems', 'flexDirection', 'flexWrap', 'gap', 'inline', 'justifyContent'];
|
|
181
|
+
const GRID_LAYOUT_PROPS_KEYS = ['alignContent', 'alignItems', 'gap', 'gridAutoColumns', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'inline', 'justifyContent', 'justifyItems'];
|
|
182
|
+
const STYLING_PROPS_KEYS = [...LAYOUT_PROPS_KEYS, ...SPACING_PROPS_KEYS, ...SIZING_PROPS_KEYS, ...POSITIONING_PROPS_KEYS];
|
|
183
|
+
const CONTAINER_PROPS_KEYS = [...LAYOUT_PROPS_KEYS, ...SPACING_PROPS_KEYS, ...SIZING_PROPS_KEYS, ...POSITIONING_PROPS_KEYS, ...INTERNAL_SPACING_PROPS_KEYS, ...BORDER_PROPS_KEYS, ...FLEX_LAYOUT_PROPS_KEYS, ...GRID_LAYOUT_PROPS_KEYS, 'display'];
|
|
12
184
|
|
|
13
185
|
/**
|
|
14
|
-
*
|
|
186
|
+
* Converts styling props to transient props (with $ prefix) for styled-components.
|
|
187
|
+
* Also returns the original props with styling props removed.
|
|
188
|
+
* @param props - Object containing styling props
|
|
189
|
+
* @returns Object with transientProps (with $ prefix) and otherProps (without styling props)
|
|
15
190
|
*/
|
|
191
|
+
const getStylingTransientProps = props => {
|
|
192
|
+
const transientProps = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, toTransientProps(props, LAYOUT_PROPS_KEYS)), toTransientProps(props, SPACING_PROPS_KEYS)), toTransientProps(props, SIZING_PROPS_KEYS)), toTransientProps(props, POSITIONING_PROPS_KEYS));
|
|
193
|
+
const otherProps = _objectSpread2({}, props);
|
|
194
|
+
STYLING_PROPS_KEYS.forEach(key => {
|
|
195
|
+
delete otherProps[key];
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
transientProps,
|
|
199
|
+
otherProps: otherProps
|
|
200
|
+
};
|
|
201
|
+
};
|
|
16
202
|
|
|
17
203
|
/**
|
|
18
|
-
*
|
|
204
|
+
* Converts flex layout props to transient props (with $ prefix) for styled-components.
|
|
205
|
+
* Used for components that need flexbox-specific props alongside styling props.
|
|
206
|
+
* @param props - Object containing flex layout props
|
|
207
|
+
* @returns Object with transientProps (with $ prefix) and otherProps (without flex layout props)
|
|
19
208
|
*/
|
|
209
|
+
const getFlexLayoutTransientProps = props => {
|
|
210
|
+
const transientProps = toTransientProps(props, FLEX_LAYOUT_PROPS_KEYS);
|
|
211
|
+
const otherProps = _objectSpread2({}, props);
|
|
212
|
+
FLEX_LAYOUT_PROPS_KEYS.forEach(key => {
|
|
213
|
+
delete otherProps[key];
|
|
214
|
+
});
|
|
215
|
+
return {
|
|
216
|
+
transientProps,
|
|
217
|
+
otherProps: otherProps
|
|
218
|
+
};
|
|
219
|
+
};
|
|
20
220
|
|
|
21
221
|
/**
|
|
22
|
-
*
|
|
222
|
+
* Removes styling props from an object to prevent passing them to the DOM.
|
|
223
|
+
* @param props - Object that may contain styling props
|
|
224
|
+
* @returns New object with styling props removed
|
|
23
225
|
*/
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
font-size: var(--redsift-typography-button-font-size);
|
|
32
|
-
font-weight: var(--redsift-typography-button-font-weight);
|
|
33
|
-
gap: 8px;
|
|
34
|
-
height: fit-content;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
line-height: var(--redsift-typography-button-line-height);
|
|
37
|
-
text-decoration: none;
|
|
38
|
-
text-transform: var(--redsift-typography-button-text-transform);
|
|
39
|
-
vertical-align: middle;
|
|
40
|
-
-webkit-font-smoothing: antialiased;
|
|
41
|
-
${baseStyling}
|
|
42
|
-
|
|
43
|
-
${_ref => {
|
|
44
|
-
let {
|
|
45
|
-
$isLoading
|
|
46
|
-
} = _ref;
|
|
47
|
-
return $isLoading ? css`
|
|
48
|
-
& > span {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
& > .redsift-shield {
|
|
53
|
-
position: absolute;
|
|
54
|
-
}
|
|
55
|
-
` : '';
|
|
56
|
-
}}
|
|
57
|
-
|
|
58
|
-
${_ref2 => {
|
|
59
|
-
let {
|
|
60
|
-
$variant,
|
|
61
|
-
$color,
|
|
62
|
-
$isActive,
|
|
63
|
-
$isDisabled,
|
|
64
|
-
$isGradient,
|
|
65
|
-
$isHovered,
|
|
66
|
-
$theme
|
|
67
|
-
} = _ref2;
|
|
68
|
-
return css`
|
|
69
|
-
padding: ${$variant !== ButtonVariant.secondary || $variant === ButtonVariant.secondary && $isGradient && !$isDisabled ? '9px 16px' : '8px 15px'};
|
|
70
|
-
|
|
71
|
-
${!$isGradient ? css`
|
|
72
|
-
background-color: var(
|
|
73
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
74
|
-
);
|
|
75
|
-
&,
|
|
76
|
-
.redsift-icon:not(.colored) {
|
|
77
|
-
color: var(
|
|
78
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
` : css`
|
|
82
|
-
background: var(
|
|
83
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
${$variant === ButtonVariant.primary || $isDisabled ? css`
|
|
87
|
-
&,
|
|
88
|
-
.redsift-icon:not(.colored) {
|
|
89
|
-
color: var(
|
|
90
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
` : ''}
|
|
94
|
-
|
|
95
|
-
${$variant !== ButtonVariant.primary && !$isDisabled ? css`
|
|
96
|
-
path {
|
|
97
|
-
fill: url(#${$color}-gradient-${$isActive ? 'active' : $isHovered ? 'hover' : 'default'});
|
|
98
|
-
}
|
|
99
|
-
` : ''}
|
|
100
|
-
|
|
101
|
-
span {
|
|
102
|
-
background: var(
|
|
103
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
104
|
-
);
|
|
105
|
-
background-clip: text;
|
|
106
|
-
color: transparent;
|
|
107
|
-
}
|
|
108
|
-
`}
|
|
109
|
-
|
|
110
|
-
${$variant === ButtonVariant.secondary ? css`
|
|
111
|
-
border: 1px solid
|
|
112
|
-
var(
|
|
113
|
-
--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-${$isDisabled ? 'disabled' : $isActive ? 'active' : $isHovered ? 'hover' : 'default'}
|
|
114
|
-
);
|
|
115
|
-
` : ''}
|
|
116
|
-
`;
|
|
117
|
-
}};
|
|
118
|
-
|
|
119
|
-
&:hover,
|
|
120
|
-
&:focus-visible {
|
|
121
|
-
outline: none;
|
|
122
|
-
|
|
123
|
-
${_ref3 => {
|
|
124
|
-
let {
|
|
125
|
-
$variant,
|
|
126
|
-
$color,
|
|
127
|
-
$isDisabled,
|
|
128
|
-
$isGradient,
|
|
129
|
-
$theme
|
|
130
|
-
} = _ref3;
|
|
131
|
-
return css`
|
|
132
|
-
cursor: ${$isDisabled ? 'default' : 'pointer'};
|
|
133
|
-
|
|
134
|
-
${!$isGradient ? css`
|
|
135
|
-
background-color: var(
|
|
136
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : 'hover'}
|
|
137
|
-
);
|
|
138
|
-
&,
|
|
139
|
-
.redsift-icon:not(.colored) {
|
|
140
|
-
color: var(
|
|
141
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : 'hover'}
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
${$variant === ButtonVariant.secondary ? css`
|
|
146
|
-
border: 1px solid
|
|
147
|
-
var(
|
|
148
|
-
--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-${$isDisabled ? 'disabled' : 'hover'}
|
|
149
|
-
);
|
|
150
|
-
` : ''}
|
|
151
|
-
` : css`
|
|
152
|
-
background: var(
|
|
153
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : 'hover'}
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
${$variant !== ButtonVariant.primary && !$isDisabled ? css`
|
|
157
|
-
path {
|
|
158
|
-
fill: url(#${$color}-gradient-hover);
|
|
159
|
-
}
|
|
160
|
-
` : ''}
|
|
161
|
-
`}
|
|
162
|
-
`;
|
|
163
|
-
}};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
&:active {
|
|
167
|
-
outline: none;
|
|
168
|
-
|
|
169
|
-
${_ref4 => {
|
|
170
|
-
let {
|
|
171
|
-
$variant,
|
|
172
|
-
$color,
|
|
173
|
-
$isGradient,
|
|
174
|
-
$isHovered,
|
|
175
|
-
$isDisabled,
|
|
176
|
-
$theme
|
|
177
|
-
} = _ref4;
|
|
178
|
-
return css`
|
|
179
|
-
${!$isGradient ? css`
|
|
180
|
-
background-color: var(
|
|
181
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
182
|
-
);
|
|
183
|
-
&,
|
|
184
|
-
.redsift-icon:not(.colored) {
|
|
185
|
-
color: var(
|
|
186
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-text-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
${$variant === ButtonVariant.secondary ? css`
|
|
191
|
-
border: 1px solid
|
|
192
|
-
var(
|
|
193
|
-
--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
194
|
-
);
|
|
195
|
-
` : ''}
|
|
196
|
-
` : css`
|
|
197
|
-
background: var(
|
|
198
|
-
--redsift-color-${$theme}-components-buttons-${$variant}-button-${$color}-background-${$isDisabled ? 'disabled' : $isHovered ? 'hover' : 'active'}
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
${$variant !== ButtonVariant.primary && !$isDisabled ? css`
|
|
202
|
-
path {
|
|
203
|
-
fill: url(#${$color}-gradient-active);
|
|
204
|
-
}
|
|
205
|
-
` : ''}
|
|
206
|
-
`}
|
|
207
|
-
`;
|
|
208
|
-
}};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
${_ref5 => {
|
|
212
|
-
let {
|
|
213
|
-
$fullWidth
|
|
214
|
-
} = _ref5;
|
|
215
|
-
return $fullWidth ? `
|
|
216
|
-
width: 100%;
|
|
217
|
-
flex-grow: 1;
|
|
218
|
-
` : '';
|
|
219
|
-
}}
|
|
226
|
+
const omitStylingProps = props => {
|
|
227
|
+
const result = _objectSpread2({}, props);
|
|
228
|
+
STYLING_PROPS_KEYS.forEach(key => {
|
|
229
|
+
delete result[key];
|
|
230
|
+
});
|
|
231
|
+
return result;
|
|
232
|
+
};
|
|
220
233
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
/**
|
|
235
|
+
* Converts container props (styling + internal spacing + border + flex layout) to transient props for styled-components.
|
|
236
|
+
* Used for Flexbox, Grid, and other container components.
|
|
237
|
+
* @param props - Object containing container props
|
|
238
|
+
* @returns Object with transientProps (with $ prefix) and otherProps (without container props)
|
|
239
|
+
*/
|
|
240
|
+
const getContainerStylingTransientProps = props => {
|
|
241
|
+
const transientProps = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, toTransientProps(props, LAYOUT_PROPS_KEYS)), toTransientProps(props, SPACING_PROPS_KEYS)), toTransientProps(props, SIZING_PROPS_KEYS)), toTransientProps(props, POSITIONING_PROPS_KEYS)), toTransientProps(props, INTERNAL_SPACING_PROPS_KEYS)), toTransientProps(props, BORDER_PROPS_KEYS)), toTransientProps(props, FLEX_LAYOUT_PROPS_KEYS)), toTransientProps(props, GRID_LAYOUT_PROPS_KEYS)), props.display !== undefined && {
|
|
242
|
+
$display: props.display
|
|
243
|
+
});
|
|
244
|
+
const otherProps = _objectSpread2({}, props);
|
|
245
|
+
CONTAINER_PROPS_KEYS.forEach(key => {
|
|
246
|
+
delete otherProps[key];
|
|
247
|
+
});
|
|
248
|
+
return {
|
|
249
|
+
transientProps,
|
|
250
|
+
otherProps: otherProps
|
|
251
|
+
};
|
|
252
|
+
};
|
|
225
253
|
|
|
226
|
-
|
|
227
|
-
margin-left: unset;
|
|
228
|
-
align-items: center;
|
|
229
|
-
}
|
|
254
|
+
/** TRANSIENT PROPS */
|
|
230
255
|
|
|
231
|
-
|
|
232
|
-
|
|
256
|
+
const getContainerTransientProps = props => _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, props.$alignContent && {
|
|
257
|
+
alignContent: props.$alignContent
|
|
258
|
+
}), props.$alignItems && {
|
|
259
|
+
alignItems: props.$alignItems
|
|
260
|
+
}), props.$bottom && {
|
|
261
|
+
bottom: props.$bottom
|
|
262
|
+
}), props.$flexDirection && {
|
|
263
|
+
flexDirection: props.$flexDirection
|
|
264
|
+
}), props.$flexWrap && {
|
|
265
|
+
flexWrap: props.$flexWrap
|
|
266
|
+
}), props.$gap && {
|
|
267
|
+
gap: props.$gap
|
|
268
|
+
}), props.$gridAutoColumns && {
|
|
269
|
+
gridAutoColumns: props.$gridAutoColumns
|
|
270
|
+
}), props.$gridAutoRows && {
|
|
271
|
+
gridAutoRows: props.$gridAutoRows
|
|
272
|
+
}), props.$gridTemplateAreas && {
|
|
273
|
+
gridTemplateAreas: props.$gridTemplateAreas
|
|
274
|
+
}), props.$gridTemplateColumns && {
|
|
275
|
+
gridTemplateColumns: props.$gridTemplateColumns
|
|
276
|
+
}), props.$gridTemplateRows && {
|
|
277
|
+
gridTemplateRows: props.$gridTemplateRows
|
|
278
|
+
}), props.$height && {
|
|
279
|
+
height: props.$height
|
|
280
|
+
}), props.$justifyContent && {
|
|
281
|
+
justifyContent: props.$justifyContent
|
|
282
|
+
}), props.$justifyItems && {
|
|
283
|
+
justifyItems: props.$justifyItems
|
|
284
|
+
}), props.$left && {
|
|
285
|
+
left: props.$left
|
|
286
|
+
}), props.$margin && {
|
|
287
|
+
margin: props.$margin
|
|
288
|
+
}), props.$marginBottom && {
|
|
289
|
+
marginBottom: props.$marginBottom
|
|
290
|
+
}), props.$marginLeft && {
|
|
291
|
+
marginLeft: props.$marginLeft
|
|
292
|
+
}), props.$marginRight && {
|
|
293
|
+
marginRight: props.$marginRight
|
|
294
|
+
}), props.$marginTop && {
|
|
295
|
+
marginTop: props.$marginTop
|
|
296
|
+
}), props.$maxHeight && {
|
|
297
|
+
maxHeight: props.$maxHeight
|
|
298
|
+
}), props.$maxWidth && {
|
|
299
|
+
maxWidth: props.$maxWidth
|
|
300
|
+
}), props.$minHeight && {
|
|
301
|
+
minHeight: props.$minHeight
|
|
302
|
+
}), props.$minWidth && {
|
|
303
|
+
minWidth: props.$minWidth
|
|
304
|
+
}), props.$padding && {
|
|
305
|
+
padding: props.$padding
|
|
306
|
+
}), props.$paddingBottom && {
|
|
307
|
+
paddingBottom: props.$paddingBottom
|
|
308
|
+
}), props.$paddingLeft && {
|
|
309
|
+
paddingLeft: props.$paddingLeft
|
|
310
|
+
}), props.$paddingRight && {
|
|
311
|
+
paddingRight: props.$paddingRight
|
|
312
|
+
}), props.$paddingTop && {
|
|
313
|
+
paddingTop: props.$paddingTop
|
|
314
|
+
}), props.$position && {
|
|
315
|
+
position: props.$position
|
|
316
|
+
}), props.$right && {
|
|
317
|
+
right: props.$right
|
|
318
|
+
}), props.$top && {
|
|
319
|
+
top: props.$top
|
|
320
|
+
}), props.$width && {
|
|
321
|
+
width: props.$width
|
|
322
|
+
}), props.$zIndex && {
|
|
323
|
+
zIndex: props.$zIndex
|
|
324
|
+
});
|
|
233
325
|
|
|
234
|
-
export {
|
|
326
|
+
export { AlignSelf as A, FlexDirection as F, JustifySelf as J, AlignContent as a, AlignItems as b, FlexWrap as c, JustifyContent as d, JustifyItems as e, getStylingTransientProps as f, getContainerProps as g, getFlexLayoutTransientProps as h, getContainerStylingTransientProps as i, getContainerTransientProps as j, omitStylingProps as o };
|
|
235
327
|
//# sourceMappingURL=styles.js.map
|