@ttoss/ui 1.31.17 → 1.31.18

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 CHANGED
@@ -327,20 +327,59 @@ var InfiniteLinearProgress = () => {
327
327
  };
328
328
 
329
329
  // src/components/Textarea.tsx
330
- import { Textarea } from "theme-ui";
330
+ import { Textarea as TextareaUI } from "theme-ui";
331
+ import React8 from "react";
332
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
333
+ var Textarea = /*#__PURE__*/React8.forwardRef(({
334
+ trailingIcon,
335
+ className,
336
+ sx,
337
+ ...textareaProps
338
+ }, ref) => {
339
+ return /* @__PURE__ */jsxs7(Flex, {
340
+ className,
341
+ sx: {
342
+ ...sx,
343
+ position: "relative",
344
+ padding: 0,
345
+ border: "none"
346
+ },
347
+ children: [/* @__PURE__ */jsx10(TextareaUI, {
348
+ ref,
349
+ sx: {
350
+ ...sx,
351
+ paddingRight: trailingIcon ? "3xl" : void 0,
352
+ margin: 0
353
+ },
354
+ className,
355
+ ...textareaProps
356
+ }), trailingIcon && /* @__PURE__ */jsx10(Text, {
357
+ sx: {
358
+ position: "absolute",
359
+ right: "1.25rem",
360
+ top: "0.75rem"
361
+ },
362
+ children: /* @__PURE__ */jsx10(Icon, {
363
+ inline: true,
364
+ icon: trailingIcon
365
+ })
366
+ })]
367
+ });
368
+ });
369
+ Textarea.displayName = "Textarea";
331
370
 
332
371
  // src/components/Container.tsx
333
372
  import { Container } from "theme-ui";
334
373
 
335
374
  // src/components/HelpText.tsx
336
- import { jsx as jsx10 } from "react/jsx-runtime";
375
+ import { jsx as jsx11 } from "react/jsx-runtime";
337
376
  var HelpText = ({
338
377
  disabled,
339
378
  negative,
340
379
  ...props
341
380
  }) => {
342
381
  const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
343
- return /* @__PURE__ */jsx10(Text, {
382
+ return /* @__PURE__ */jsx11(Text, {
344
383
  variant,
345
384
  "aria-disabled": disabled ? "true" : void 0,
346
385
  ...props
@@ -349,14 +388,14 @@ var HelpText = ({
349
388
 
350
389
  // src/components/CloseButton.tsx
351
390
  import { Button as Button2 } from "theme-ui";
352
- import React8 from "react";
353
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
354
- var CloseButton = /*#__PURE__*/React8.forwardRef(({
391
+ import React9 from "react";
392
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
393
+ var CloseButton = /*#__PURE__*/React9.forwardRef(({
355
394
  label,
356
395
  sx,
357
396
  ...props
358
397
  }, ref) => {
359
- return /* @__PURE__ */jsxs7(Button2, {
398
+ return /* @__PURE__ */jsxs8(Button2, {
360
399
  variant: "buttons.closeButton",
361
400
  type: "button",
362
401
  "aria-label": label,
@@ -367,7 +406,7 @@ var CloseButton = /*#__PURE__*/React8.forwardRef(({
367
406
  },
368
407
  ...props,
369
408
  ref,
370
- children: [label, /* @__PURE__ */jsx11(Icon, {
409
+ children: [label, /* @__PURE__ */jsx12(Icon, {
371
410
  icon: "close"
372
411
  })]
373
412
  });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as theme_ui from 'theme-ui';
2
- import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, SelectProps as SelectProps$1, IconButtonProps, TextProps } from 'theme-ui';
3
- export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Link, LinkProps, Radio, RadioProps, Slider, SliderProps, Spinner, SpinnerProps, Text, TextProps, Textarea, TextareaProps, Theme } from 'theme-ui';
2
+ import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, SelectProps as SelectProps$1, IconButtonProps, TextareaProps as TextareaProps$1, TextProps } from 'theme-ui';
3
+ export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Link, LinkProps, Radio, RadioProps, Slider, SliderProps, Spinner, SpinnerProps, Text, TextProps, Theme } from 'theme-ui';
4
4
  export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
5
5
  import * as React from 'react';
6
6
  import React__default from 'react';
@@ -53,6 +53,11 @@ declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps,
53
53
 
54
54
  declare const InfiniteLinearProgress: () => JSX.Element;
55
55
 
56
+ type TextareaProps = TextareaProps$1 & {
57
+ trailingIcon?: IconType;
58
+ };
59
+ declare const Textarea: React__default.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React__default.RefAttributes<HTMLTextAreaElement>>;
60
+
56
61
  type HelpTextProps = Omit<TextProps, 'variant'> & {
57
62
  disabled?: boolean;
58
63
  negative?: boolean;
@@ -64,4 +69,4 @@ type CloseButtonProps = ButtonProps$1 & {
64
69
  };
65
70
  declare const CloseButton: React__default.ForwardRefExoticComponent<Omit<CloseButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
66
71
 
67
- export { Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputProps, Label, LabelProps, Select, SelectProps, ThemeProvider, ThemeProviderProps, useTheme };
72
+ export { Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputProps, Label, LabelProps, Select, SelectProps, Textarea, TextareaProps, ThemeProvider, ThemeProviderProps, useTheme };
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ __export(src_exports, {
64
64
  Slider: () => import_theme_ui21.Slider,
65
65
  Spinner: () => import_theme_ui18.Spinner,
66
66
  Text: () => import_theme_ui16.Text,
67
- Textarea: () => import_theme_ui23.Textarea,
67
+ Textarea: () => Textarea,
68
68
  ThemeProvider: () => ThemeProvider,
69
69
  useBreakpointIndex: () => import_match_media.useBreakpointIndex,
70
70
  useResponsiveValue: () => import_match_media.useResponsiveValue,
@@ -398,19 +398,58 @@ var InfiniteLinearProgress = () => {
398
398
 
399
399
  // src/components/Textarea.tsx
400
400
  var import_theme_ui23 = require("theme-ui");
401
+ var import_react5 = __toESM(require("react"));
402
+ var import_jsx_runtime10 = require("react/jsx-runtime");
403
+ var Textarea = import_react5.default.forwardRef(({
404
+ trailingIcon,
405
+ className,
406
+ sx,
407
+ ...textareaProps
408
+ }, ref) => {
409
+ return /* @__PURE__ */(0, import_jsx_runtime10.jsxs)(import_theme_ui8.Flex, {
410
+ className,
411
+ sx: {
412
+ ...sx,
413
+ position: "relative",
414
+ padding: 0,
415
+ border: "none"
416
+ },
417
+ children: [/* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui23.Textarea, {
418
+ ref,
419
+ sx: {
420
+ ...sx,
421
+ paddingRight: trailingIcon ? "3xl" : void 0,
422
+ margin: 0
423
+ },
424
+ className,
425
+ ...textareaProps
426
+ }), trailingIcon && /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui16.Text, {
427
+ sx: {
428
+ position: "absolute",
429
+ right: "1.25rem",
430
+ top: "0.75rem"
431
+ },
432
+ children: /* @__PURE__ */(0, import_jsx_runtime10.jsx)(Icon, {
433
+ inline: true,
434
+ icon: trailingIcon
435
+ })
436
+ })]
437
+ });
438
+ });
439
+ Textarea.displayName = "Textarea";
401
440
 
402
441
  // src/components/Container.tsx
403
442
  var import_theme_ui24 = require("theme-ui");
404
443
 
405
444
  // src/components/HelpText.tsx
406
- var import_jsx_runtime10 = require("react/jsx-runtime");
445
+ var import_jsx_runtime11 = require("react/jsx-runtime");
407
446
  var HelpText = ({
408
447
  disabled,
409
448
  negative,
410
449
  ...props
411
450
  }) => {
412
451
  const variant = ["text.help", negative ? "negative" : void 0].filter(Boolean).join(".");
413
- return /* @__PURE__ */(0, import_jsx_runtime10.jsx)(import_theme_ui16.Text, {
452
+ return /* @__PURE__ */(0, import_jsx_runtime11.jsx)(import_theme_ui16.Text, {
414
453
  variant,
415
454
  "aria-disabled": disabled ? "true" : void 0,
416
455
  ...props
@@ -419,14 +458,14 @@ var HelpText = ({
419
458
 
420
459
  // src/components/CloseButton.tsx
421
460
  var import_theme_ui25 = require("theme-ui");
422
- var import_react5 = __toESM(require("react"));
423
- var import_jsx_runtime11 = require("react/jsx-runtime");
424
- var CloseButton = import_react5.default.forwardRef(({
461
+ var import_react6 = __toESM(require("react"));
462
+ var import_jsx_runtime12 = require("react/jsx-runtime");
463
+ var CloseButton = import_react6.default.forwardRef(({
425
464
  label,
426
465
  sx,
427
466
  ...props
428
467
  }, ref) => {
429
- return /* @__PURE__ */(0, import_jsx_runtime11.jsxs)(import_theme_ui25.Button, {
468
+ return /* @__PURE__ */(0, import_jsx_runtime12.jsxs)(import_theme_ui25.Button, {
430
469
  variant: "buttons.closeButton",
431
470
  type: "button",
432
471
  "aria-label": label,
@@ -437,7 +476,7 @@ var CloseButton = import_react5.default.forwardRef(({
437
476
  },
438
477
  ...props,
439
478
  ref,
440
- children: [label, /* @__PURE__ */(0, import_jsx_runtime11.jsx)(Icon, {
479
+ children: [label, /* @__PURE__ */(0, import_jsx_runtime12.jsx)(Icon, {
441
480
  icon: "close"
442
481
  })]
443
482
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "1.31.17",
3
+ "version": "1.31.18",
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.7",
27
- "@ttoss/theme": "^1.4.14",
27
+ "@ttoss/theme": "^1.4.15",
28
28
  "theme-ui": "^0.15.7"
29
29
  },
30
30
  "peerDependencies": {
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "f7ce64308917a032fdd64066b00d26f12702ef83"
49
+ "gitHead": "3f398d2717a3ac8f7fecf4c79c028b35f0ef45fb"
50
50
  }
@@ -1 +1,46 @@
1
- export { Textarea, type TextareaProps } from 'theme-ui';
1
+ import { Flex, Icon, type IconType, Text } from '..';
2
+ import {
3
+ type TextareaProps as TextareaPropsUI,
4
+ Textarea as TextareaUI,
5
+ } from 'theme-ui';
6
+ import React from 'react';
7
+
8
+ export type TextareaProps = TextareaPropsUI & {
9
+ trailingIcon?: IconType;
10
+ };
11
+
12
+ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
13
+ ({ trailingIcon, className, sx, ...textareaProps }, ref) => {
14
+ return (
15
+ <Flex
16
+ className={className}
17
+ sx={{ ...sx, position: 'relative', padding: 0, border: 'none' }}
18
+ >
19
+ <TextareaUI
20
+ ref={ref}
21
+ sx={{
22
+ ...sx,
23
+ paddingRight: trailingIcon ? '3xl' : undefined,
24
+ margin: 0,
25
+ }}
26
+ className={className}
27
+ {...textareaProps}
28
+ />
29
+
30
+ {trailingIcon && (
31
+ <Text
32
+ sx={{
33
+ position: 'absolute',
34
+ right: '1.25rem',
35
+ top: '0.75rem',
36
+ }}
37
+ >
38
+ <Icon inline icon={trailingIcon} />
39
+ </Text>
40
+ )}
41
+ </Flex>
42
+ );
43
+ }
44
+ );
45
+
46
+ Textarea.displayName = 'Textarea';