@smart-react-components/ui 2.0.10 → 2.0.12

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.
@@ -43,7 +43,9 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
43
43
  }
44
44
  }
45
45
  `,
46
- }))(({ theme, hasButtonContainer, hasHover, hasLeftAddon, hasRightAddon, hasSeparatedLeftAddon, hasSeparatedRightAddon, isActive, isBlock, isDisabled, isFixedSize, isLink, isLoading, isSoft, isOutline, palette, shape }) => `
46
+ }))(({ theme, hasButtonContainer, hasHover, hasLeftAddon, hasRightAddon, hasSeparatedLeftAddon, hasSeparatedRightAddon, isActive, isBlock, isDisabled, isFixedSize, isLink, isLoading, isSoft, isOutline, palette, shape }) => {
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43;
48
+ return `
47
49
  align-items: stretch;
48
50
  background: transparent;
49
51
  border: 0;
@@ -59,87 +61,93 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
59
61
  }
60
62
 
61
63
  ${isSoft
62
- ? `
64
+ ? `
63
65
  font-weight: ${theme.$.fontWeight.bold};
64
66
  `
65
- : ''}
67
+ : ''}
66
68
 
67
69
  ${!isFixedSize
68
- ? `
69
- ${(!isBlock)
70
70
  ? `
71
+ ${(!isBlock)
72
+ ? `
71
73
  display: inline-flex;
72
74
  flex: 0 1 auto;
73
75
  `
74
- : `
76
+ : `
75
77
  display: flex;
76
78
  flex: 1 1 auto;
77
79
  width: 100%;
78
80
  `}
79
81
  `
80
- : ''}
82
+ : ''}
81
83
 
82
84
  ${(isBlock || isFixedSize)
83
- ? `
85
+ ? `
84
86
  .src-button-content {
85
87
  justify-content: center;
86
88
  }
87
89
  `
88
- : ''}
90
+ : ''}
89
91
 
90
92
  ${!isLink
91
- ? `
92
- ${!isOutline
93
93
  ? `
94
- ${!isSoft
94
+ ${!isOutline
95
95
  ? `
96
+ ${!isSoft
97
+ ? `
96
98
  .src-button-content {
97
- color: ${theme.$.palette[palette].font};
98
-
99
99
  ${!isActive
100
- ? `
101
- background: ${theme.$.palette[palette].main};
102
- border-color: ${theme.$.palette[palette].main};
100
+ ? `
101
+ background: ${(_b = (_a = theme.$.palette[palette].button) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.palette[palette].main};
102
+ border-color: ${(_d = (_c = theme.$.palette[palette].button) === null || _c === void 0 ? void 0 : _c.border) !== null && _d !== void 0 ? _d : theme.$.palette[palette].main};
103
+ color: ${(_f = (_e = theme.$.palette[palette].button) === null || _e === void 0 ? void 0 : _e.font) !== null && _f !== void 0 ? _f : theme.$.palette[palette].font};
103
104
  `
104
- : `
105
- background: ${theme.$.palette[palette].dynamicer};
106
- border-color: ${theme.$.palette[palette].dynamicer};
105
+ : `
106
+ background: ${(_j = (_h = (_g = theme.$.palette[palette].button) === null || _g === void 0 ? void 0 : _g.active) === null || _h === void 0 ? void 0 : _h.background) !== null && _j !== void 0 ? _j : theme.$.palette[palette].dynamicer};
107
+ border-color: ${(_m = (_l = (_k = theme.$.palette[palette].button) === null || _k === void 0 ? void 0 : _k.active) === null || _l === void 0 ? void 0 : _l.border) !== null && _m !== void 0 ? _m : theme.$.palette[palette].dynamicer};
108
+ color: ${(_q = (_p = (_o = theme.$.palette[palette].button) === null || _o === void 0 ? void 0 : _o.active) === null || _p === void 0 ? void 0 : _p.font) !== null && _q !== void 0 ? _q : theme.$.palette[palette].font};
107
109
  `}
108
110
  }
109
111
 
110
112
  ${(!isActive && hasHover)
111
- ? `
113
+ ? `
112
114
  &:hover {
113
115
  .src-button-content {
114
- background: ${theme.$.palette[palette].dynamic};
115
- border-color: ${theme.$.palette[palette].dynamic};
116
+ background: ${(_t = (_s = (_r = theme.$.palette[palette].button) === null || _r === void 0 ? void 0 : _r.hover) === null || _s === void 0 ? void 0 : _s.background) !== null && _t !== void 0 ? _t : theme.$.palette[palette].dynamic};
117
+ border-color: ${(_w = (_v = (_u = theme.$.palette[palette].button) === null || _u === void 0 ? void 0 : _u.hover) === null || _v === void 0 ? void 0 : _v.border) !== null && _w !== void 0 ? _w : theme.$.palette[palette].dynamic};
118
+
119
+ ${((_y = (_x = theme.$.palette[palette].button) === null || _x === void 0 ? void 0 : _x.hover) === null || _y === void 0 ? void 0 : _y.font)
120
+ ? `
121
+ color: ${(_0 = (_z = theme.$.palette[palette].button) === null || _z === void 0 ? void 0 : _z.hover) === null || _0 === void 0 ? void 0 : _0.font};
122
+ `
123
+ : ''}
116
124
  }
117
125
 
118
126
  .src-button-addon {
119
- background: ${theme.$.palette[palette].dynamicest};
120
- border-color: ${theme.$.palette[palette].dynamicest};
127
+ background: ${(_4 = (_3 = (_2 = (_1 = theme.$.palette[palette].button) === null || _1 === void 0 ? void 0 : _1.hover) === null || _2 === void 0 ? void 0 : _2.addon) === null || _3 === void 0 ? void 0 : _3.background) !== null && _4 !== void 0 ? _4 : theme.$.palette[palette].dynamicest};
128
+ border-color: ${(_8 = (_7 = (_6 = (_5 = theme.$.palette[palette].button) === null || _5 === void 0 ? void 0 : _5.hover) === null || _6 === void 0 ? void 0 : _6.addon) === null || _7 === void 0 ? void 0 : _7.border) !== null && _8 !== void 0 ? _8 : theme.$.palette[palette].dynamicest};
121
129
  }
122
130
  }
123
131
  `
124
- : ''}
132
+ : ''}
125
133
  `
126
- : `
134
+ : `
127
135
  .src-button-content {
128
136
  color: ${theme.$.palette[palette].softFont};
129
137
 
130
138
  ${!isActive
131
- ? `
139
+ ? `
132
140
  background: ${theme.$.palette[palette].soft};
133
141
  border-color: ${theme.$.palette[palette].soft};
134
142
  `
135
- : `
143
+ : `
136
144
  background: ${theme.$.palette[palette].softDynamicer};
137
145
  border-color: ${theme.$.palette[palette].softDynamicer};
138
146
  `}
139
147
  }
140
148
 
141
149
  ${(!isActive && hasHover)
142
- ? `
150
+ ? `
143
151
  &:hover {
144
152
  .src-button-content {
145
153
  background: ${theme.$.palette[palette].softDynamic};
@@ -152,41 +160,41 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
152
160
  }
153
161
  }
154
162
  `
155
- : ''}
163
+ : ''}
156
164
  `}
157
165
  `
158
- : `
166
+ : `
159
167
  ${!isSoft
160
- ? `
168
+ ? `
161
169
  .src-button-content {
162
- border-color: ${theme.$.palette[palette].main};
163
- color: ${theme.$.palette[palette].main};
170
+ border-color: ${(_11 = (_10 = (_9 = theme.$.palette[palette].button) === null || _9 === void 0 ? void 0 : _9.outline) === null || _10 === void 0 ? void 0 : _10.border) !== null && _11 !== void 0 ? _11 : theme.$.palette[palette].main};
171
+ color: ${(_14 = (_13 = (_12 = theme.$.palette[palette].button) === null || _12 === void 0 ? void 0 : _12.outline) === null || _13 === void 0 ? void 0 : _13.font) !== null && _14 !== void 0 ? _14 : theme.$.palette[palette].main};
164
172
  }
165
173
 
166
174
  ${hasHover
167
- ? `
175
+ ? `
168
176
  &:hover {
169
177
  .src-button-content {
170
- background: ${theme.$.palette[palette].main};
171
- color: ${theme.$.palette[palette].font};
178
+ background: ${(_18 = (_17 = (_16 = (_15 = theme.$.palette[palette].button) === null || _15 === void 0 ? void 0 : _15.outline) === null || _16 === void 0 ? void 0 : _16.hover) === null || _17 === void 0 ? void 0 : _17.background) !== null && _18 !== void 0 ? _18 : theme.$.palette[palette].main};
179
+ color: ${(_22 = (_21 = (_20 = (_19 = theme.$.palette[palette].button) === null || _19 === void 0 ? void 0 : _19.outline) === null || _20 === void 0 ? void 0 : _20.hover) === null || _21 === void 0 ? void 0 : _21.font) !== null && _22 !== void 0 ? _22 : theme.$.palette[palette].font};
172
180
  }
173
181
 
174
182
  .src-button-addon {
175
- background: ${theme.$.palette[palette].dynamicer};
176
- color: ${theme.$.palette[palette].font};
183
+ background: ${(_26 = (_25 = (_24 = (_23 = theme.$.palette[palette].button) === null || _23 === void 0 ? void 0 : _23.hover) === null || _24 === void 0 ? void 0 : _24.addon) === null || _25 === void 0 ? void 0 : _25.background) !== null && _26 !== void 0 ? _26 : theme.$.palette[palette].dynamicer};
184
+ color: ${(_30 = (_29 = (_28 = (_27 = theme.$.palette[palette].button) === null || _27 === void 0 ? void 0 : _27.hover) === null || _28 === void 0 ? void 0 : _28.addon) === null || _29 === void 0 ? void 0 : _29.font) !== null && _30 !== void 0 ? _30 : theme.$.palette[palette].font};
177
185
  }
178
186
  }
179
187
  `
180
- : ''}
188
+ : ''}
181
189
  `
182
- : `
190
+ : `
183
191
  .src-button-content {
184
192
  border-color: ${theme.$.palette[palette].soft};
185
193
  color: ${theme.$.palette[palette].soft};
186
194
  }
187
195
 
188
196
  ${hasHover
189
- ? `
197
+ ? `
190
198
  &:hover {
191
199
  .src-button-content {
192
200
  background: ${theme.$.palette[palette].soft};
@@ -199,46 +207,46 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
199
207
  }
200
208
  }
201
209
  `
202
- : ''}
210
+ : ''}
203
211
  `}
204
212
  `}
205
213
  `
206
- : `
214
+ : `
207
215
  .src-button-content {
208
216
  border-color: transparent;
209
- color: ${theme.$.palette[palette].main};
210
- fill: ${theme.$.palette[palette].main};
217
+ color: ${(_34 = (_33 = (_32 = (_31 = theme.$.palette[palette]) === null || _31 === void 0 ? void 0 : _31.button) === null || _32 === void 0 ? void 0 : _32.link) === null || _33 === void 0 ? void 0 : _33.font) !== null && _34 !== void 0 ? _34 : theme.$.palette[palette].main};
218
+ fill: ${(_38 = (_37 = (_36 = (_35 = theme.$.palette[palette]) === null || _35 === void 0 ? void 0 : _35.button) === null || _36 === void 0 ? void 0 : _36.link) === null || _37 === void 0 ? void 0 : _37.font) !== null && _38 !== void 0 ? _38 : theme.$.palette[palette].main};
211
219
  }
212
220
 
213
221
  ${hasHover
214
- ? `
222
+ ? `
215
223
  &:hover {
216
224
  .src-button-content {
217
- color: ${theme.$.palette[palette].dynamicest};
225
+ color: ${(_43 = (_42 = (_41 = (_40 = (_39 = theme.$.palette[palette]) === null || _39 === void 0 ? void 0 : _39.button) === null || _40 === void 0 ? void 0 : _40.link) === null || _41 === void 0 ? void 0 : _41.hover) === null || _42 === void 0 ? void 0 : _42.font) !== null && _43 !== void 0 ? _43 : theme.$.palette[palette].dynamicest};
218
226
  text-decoration: underline;
219
227
  }
220
228
  }
221
229
  `
222
- : ''}
230
+ : ''}
223
231
  `}
224
232
 
225
233
  ${!hasButtonContainer
226
- ? `
234
+ ? `
227
235
  &:focus {
228
236
  box-shadow: 0 0 0 .15rem ${theme.$.palette[palette].shadow};
229
237
  }
230
238
  `
231
- : ''}
239
+ : ''}
232
240
 
233
241
  ${isDisabled
234
- ? `
242
+ ? `
235
243
  opacity: ${theme.$.opacity.buttonDisabled};
236
244
  pointer-events: none;
237
245
  `
238
- : ''}
246
+ : ''}
239
247
 
240
248
  ${isLoading
241
- ? `
249
+ ? `
242
250
  pointer-events: none;
243
251
 
244
252
  .src-button-content,
@@ -250,53 +258,54 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
250
258
  }
251
259
  }
252
260
  `
253
- : ''}
261
+ : ''}
254
262
 
255
263
  ${hasSeparatedLeftAddon
256
- ? `
264
+ ? `
257
265
  border-top-left-radius: 0;
258
266
  border-bottom-left-radius: 0;
259
267
  `
260
- : ''}
268
+ : ''}
261
269
 
262
270
  ${hasSeparatedRightAddon
263
- ? `
271
+ ? `
264
272
  border-top-right-radius: 0;
265
273
  border-bottom-right-radius: 0;
266
274
  `
267
- : ''}
275
+ : ''}
268
276
 
269
277
  .src-button-content {
270
278
  border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' : theme.$.radius.button[shape]};
271
279
 
272
280
  ${hasLeftAddon
273
- ? `
281
+ ? `
274
282
  border-left: 0;
275
283
  border-top-left-radius: 0;
276
284
  border-bottom-left-radius: 0;
277
285
  `
278
- : ''}
286
+ : ''}
279
287
 
280
288
  ${hasRightAddon
281
- ? `
289
+ ? `
282
290
  border-right: 0;
283
291
  border-top-right-radius: 0;
284
292
  border-bottom-right-radius: 0;
285
293
  `
286
- : ''}
294
+ : ''}
287
295
 
288
296
  ${hasSeparatedLeftAddon
289
- ? `
297
+ ? `
290
298
  border-top-left-radius: 0;
291
299
  border-bottom-left-radius: 0;
292
300
  `
293
- : ''}
301
+ : ''}
294
302
 
295
303
  ${hasSeparatedRightAddon
296
- ? `
304
+ ? `
297
305
  border-top-right-radius: 0;
298
306
  border-bottom-right-radius: 0;
299
307
  `
300
- : ''}
308
+ : ''}
301
309
  }
302
- `);
310
+ `;
311
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-react-components/ui",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "description": "SRC UI includes React and Styled components.",
@@ -64,9 +64,9 @@
64
64
  "test": "jest"
65
65
  },
66
66
  "devDependencies": {
67
- "@smart-react-components/core": "2.0.7",
68
- "@smart-react-components/router": "2.0.6",
69
- "@smart-react-components/transition": "2.0.7",
67
+ "@smart-react-components/core": "2.0.10",
68
+ "@smart-react-components/router": "2.0.8",
69
+ "@smart-react-components/transition": "2.0.9",
70
70
  "@testing-library/react": "13.4.0",
71
71
  "@types/jest": "29.0.1",
72
72
  "@types/react": "18.0.19",
@@ -83,9 +83,9 @@
83
83
  "typescript": "4.8.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "@smart-react-components/core": "^2.0.7",
87
- "@smart-react-components/router": "^2.0.6",
88
- "@smart-react-components/transition": "^2.0.7",
86
+ "@smart-react-components/core": "^2.0.10",
87
+ "@smart-react-components/router": "^2.0.8",
88
+ "@smart-react-components/transition": "^2.0.9",
89
89
  "react": "^18.2.0",
90
90
  "react-dom": "^18.2.0",
91
91
  "styled-components": "^5.3.5"