@ttoss/ui 1.31.11 → 1.31.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.
- package/dist/esm/index.js +14 -10
- package/dist/index.js +14 -10
- package/package.json +4 -4
- package/src/components/Input.tsx +11 -10
package/dist/esm/index.js
CHANGED
|
@@ -129,50 +129,54 @@ import { Heading } from "theme-ui";
|
|
|
129
129
|
import { Image } from "theme-ui";
|
|
130
130
|
|
|
131
131
|
// src/components/Input.tsx
|
|
132
|
-
import React4 from "react";
|
|
133
132
|
import { Input as InputUI } from "theme-ui";
|
|
133
|
+
import React4 from "react";
|
|
134
134
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
135
135
|
var Input = /*#__PURE__*/React4.forwardRef(({
|
|
136
136
|
leadingIcon,
|
|
137
137
|
trailingIcon,
|
|
138
|
+
className,
|
|
138
139
|
sx,
|
|
139
140
|
...inputProps
|
|
140
141
|
}, ref) => {
|
|
141
142
|
return /* @__PURE__ */jsxs4(Flex, {
|
|
143
|
+
className,
|
|
142
144
|
sx: {
|
|
145
|
+
...sx,
|
|
143
146
|
position: "relative",
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
padding: 0,
|
|
148
|
+
border: "none"
|
|
146
149
|
},
|
|
147
150
|
children: [leadingIcon && /* @__PURE__ */jsx5(Text, {
|
|
148
151
|
sx: {
|
|
149
152
|
position: "absolute",
|
|
150
153
|
alignSelf: "center",
|
|
151
|
-
|
|
152
|
-
left: "1rem",
|
|
153
|
-
lineHeight: 0
|
|
154
|
+
left: "1rem"
|
|
154
155
|
},
|
|
155
156
|
variant: "leading-icon",
|
|
156
157
|
children: /* @__PURE__ */jsx5(Icon, {
|
|
158
|
+
inline: true,
|
|
157
159
|
icon: leadingIcon
|
|
158
160
|
})
|
|
159
161
|
}), /* @__PURE__ */jsx5(InputUI, {
|
|
160
162
|
ref,
|
|
161
163
|
sx: {
|
|
164
|
+
...sx,
|
|
162
165
|
paddingLeft: leadingIcon ? "3xl" : void 0,
|
|
163
|
-
paddingRight: trailingIcon ? "3xl" : void 0
|
|
166
|
+
paddingRight: trailingIcon ? "3xl" : void 0,
|
|
167
|
+
margin: 0
|
|
164
168
|
},
|
|
169
|
+
className,
|
|
165
170
|
...inputProps
|
|
166
171
|
}), trailingIcon && /* @__PURE__ */jsx5(Text, {
|
|
167
172
|
sx: {
|
|
168
173
|
position: "absolute",
|
|
169
174
|
right: "1rem",
|
|
170
|
-
alignSelf: "center"
|
|
171
|
-
fontSize: "base",
|
|
172
|
-
lineHeight: 0
|
|
175
|
+
alignSelf: "center"
|
|
173
176
|
},
|
|
174
177
|
variant: "trailing-icon",
|
|
175
178
|
children: /* @__PURE__ */jsx5(Icon, {
|
|
179
|
+
inline: true,
|
|
176
180
|
icon: trailingIcon
|
|
177
181
|
})
|
|
178
182
|
})]
|
package/dist/index.js
CHANGED
|
@@ -198,50 +198,54 @@ var import_theme_ui10 = require("theme-ui");
|
|
|
198
198
|
var import_theme_ui11 = require("theme-ui");
|
|
199
199
|
|
|
200
200
|
// src/components/Input.tsx
|
|
201
|
-
var import_react3 = __toESM(require("react"));
|
|
202
201
|
var import_theme_ui12 = require("theme-ui");
|
|
202
|
+
var import_react3 = __toESM(require("react"));
|
|
203
203
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
204
204
|
var Input = import_react3.default.forwardRef(({
|
|
205
205
|
leadingIcon,
|
|
206
206
|
trailingIcon,
|
|
207
|
+
className,
|
|
207
208
|
sx,
|
|
208
209
|
...inputProps
|
|
209
210
|
}, ref) => {
|
|
210
211
|
return /* @__PURE__ */(0, import_jsx_runtime5.jsxs)(import_theme_ui8.Flex, {
|
|
212
|
+
className,
|
|
211
213
|
sx: {
|
|
214
|
+
...sx,
|
|
212
215
|
position: "relative",
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
padding: 0,
|
|
217
|
+
border: "none"
|
|
215
218
|
},
|
|
216
219
|
children: [leadingIcon && /* @__PURE__ */(0, import_jsx_runtime5.jsx)(import_theme_ui16.Text, {
|
|
217
220
|
sx: {
|
|
218
221
|
position: "absolute",
|
|
219
222
|
alignSelf: "center",
|
|
220
|
-
|
|
221
|
-
left: "1rem",
|
|
222
|
-
lineHeight: 0
|
|
223
|
+
left: "1rem"
|
|
223
224
|
},
|
|
224
225
|
variant: "leading-icon",
|
|
225
226
|
children: /* @__PURE__ */(0, import_jsx_runtime5.jsx)(Icon, {
|
|
227
|
+
inline: true,
|
|
226
228
|
icon: leadingIcon
|
|
227
229
|
})
|
|
228
230
|
}), /* @__PURE__ */(0, import_jsx_runtime5.jsx)(import_theme_ui12.Input, {
|
|
229
231
|
ref,
|
|
230
232
|
sx: {
|
|
233
|
+
...sx,
|
|
231
234
|
paddingLeft: leadingIcon ? "3xl" : void 0,
|
|
232
|
-
paddingRight: trailingIcon ? "3xl" : void 0
|
|
235
|
+
paddingRight: trailingIcon ? "3xl" : void 0,
|
|
236
|
+
margin: 0
|
|
233
237
|
},
|
|
238
|
+
className,
|
|
234
239
|
...inputProps
|
|
235
240
|
}), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime5.jsx)(import_theme_ui16.Text, {
|
|
236
241
|
sx: {
|
|
237
242
|
position: "absolute",
|
|
238
243
|
right: "1rem",
|
|
239
|
-
alignSelf: "center"
|
|
240
|
-
fontSize: "base",
|
|
241
|
-
lineHeight: 0
|
|
244
|
+
alignSelf: "center"
|
|
242
245
|
},
|
|
243
246
|
variant: "trailing-icon",
|
|
244
247
|
children: /* @__PURE__ */(0, import_jsx_runtime5.jsx)(Icon, {
|
|
248
|
+
inline: true,
|
|
245
249
|
icon: trailingIcon
|
|
246
250
|
})
|
|
247
251
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.12",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@emotion/react": "^11.10.6",
|
|
25
25
|
"@iconify-icon/react": "^1.0.7",
|
|
26
26
|
"@theme-ui/match-media": "^0.15.5",
|
|
27
|
-
"@ttoss/theme": "^1.4.
|
|
27
|
+
"@ttoss/theme": "^1.4.11",
|
|
28
28
|
"theme-ui": "^0.15.5"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@ttoss/config": "^1.29.3",
|
|
35
|
-
"@ttoss/test-utils": "^1.21.
|
|
35
|
+
"@ttoss/test-utils": "^1.21.2",
|
|
36
36
|
"@types/jest": "^29.5.0",
|
|
37
37
|
"jest": "^29.5.0",
|
|
38
38
|
"react": "^18.2.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "6f711c5bb31c7b7b347477910cc0da1fe165509e"
|
|
50
50
|
}
|
package/src/components/Input.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Flex, Icon, type IconType, Text } from '..';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
2
|
import { type InputProps as InputPropsUI, Input as InputUI } from 'theme-ui';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
|
|
6
5
|
export type InputProps = InputPropsUI & {
|
|
7
6
|
leadingIcon?: IconType;
|
|
@@ -9,29 +8,33 @@ export type InputProps = InputPropsUI & {
|
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
12
|
-
({ leadingIcon, trailingIcon, sx, ...inputProps }, ref) => {
|
|
11
|
+
({ leadingIcon, trailingIcon, className, sx, ...inputProps }, ref) => {
|
|
13
12
|
return (
|
|
14
|
-
<Flex
|
|
13
|
+
<Flex
|
|
14
|
+
className={className}
|
|
15
|
+
sx={{ ...sx, position: 'relative', padding: 0, border: 'none' }}
|
|
16
|
+
>
|
|
15
17
|
{leadingIcon && (
|
|
16
18
|
<Text
|
|
17
19
|
sx={{
|
|
18
20
|
position: 'absolute',
|
|
19
21
|
alignSelf: 'center',
|
|
20
|
-
fontSize: 'base',
|
|
21
22
|
left: '1rem',
|
|
22
|
-
lineHeight: 0,
|
|
23
23
|
}}
|
|
24
24
|
variant="leading-icon"
|
|
25
25
|
>
|
|
26
|
-
<Icon icon={leadingIcon} />
|
|
26
|
+
<Icon inline icon={leadingIcon} />
|
|
27
27
|
</Text>
|
|
28
28
|
)}
|
|
29
29
|
<InputUI
|
|
30
30
|
ref={ref}
|
|
31
31
|
sx={{
|
|
32
|
+
...sx,
|
|
32
33
|
paddingLeft: leadingIcon ? '3xl' : undefined,
|
|
33
34
|
paddingRight: trailingIcon ? '3xl' : undefined,
|
|
35
|
+
margin: 0,
|
|
34
36
|
}}
|
|
37
|
+
className={className}
|
|
35
38
|
{...inputProps}
|
|
36
39
|
/>
|
|
37
40
|
|
|
@@ -41,12 +44,10 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
41
44
|
position: 'absolute',
|
|
42
45
|
right: '1rem',
|
|
43
46
|
alignSelf: 'center',
|
|
44
|
-
fontSize: 'base',
|
|
45
|
-
lineHeight: 0,
|
|
46
47
|
}}
|
|
47
48
|
variant="trailing-icon"
|
|
48
49
|
>
|
|
49
|
-
<Icon icon={trailingIcon} />
|
|
50
|
+
<Icon inline icon={trailingIcon} />
|
|
50
51
|
</Text>
|
|
51
52
|
)}
|
|
52
53
|
</Flex>
|