@ttoss/ui 1.21.1 → 1.21.2

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
@@ -182,6 +182,18 @@ import { Spinner } from "theme-ui";
182
182
 
183
183
  // src/components/Radio/Radio.tsx
184
184
  import { Radio } from "theme-ui";
185
+
186
+ // src/components/Icon/Icon.tsx
187
+ import { Icon as IconUI } from "@iconify/react";
188
+ import { jsx as jsx3 } from "react/jsx-runtime";
189
+ var Icon = ({ icon, sx }) => {
190
+ return /* @__PURE__ */ jsx3(Text, {
191
+ sx,
192
+ children: /* @__PURE__ */ jsx3(IconUI, {
193
+ icon
194
+ })
195
+ });
196
+ };
185
197
  export {
186
198
  Box,
187
199
  Button,
@@ -190,6 +202,7 @@ export {
190
202
  Flex,
191
203
  Grid,
192
204
  Heading,
205
+ Icon,
193
206
  Image,
194
207
  Input,
195
208
  Label,
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import * as theme_ui from 'theme-ui';
2
- import { Theme, ButtonProps } from 'theme-ui';
2
+ import { Theme, ButtonProps, TextProps } from 'theme-ui';
3
3
  export { Box, BoxProps, ButtonProps, Card, CardProps, Divider, DividerProps, Flex, FlexProps, Grid, GridProps, Heading, HeadingProps, Image, ImageProps, Input, InputProps, Label, LabelProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Link, LinkProps, Radio, RadioProps, Select, SelectProps, 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
+ import { IconProps as IconProps$1 } from '@iconify/react';
6
7
 
7
8
  declare type ThemeProviderProps = {
8
9
  children?: React.ReactNode;
@@ -18,4 +19,10 @@ declare const useTheme: () => theme_ui.ThemeUIContextValue;
18
19
 
19
20
  declare const Button: (props: ButtonProps) => JSX.Element;
20
21
 
21
- export { Button, ThemeProvider, ThemeProviderProps, useTheme };
22
+ declare type IconProps = {
23
+ icon: IconProps$1['icon'];
24
+ sx?: TextProps['sx'];
25
+ };
26
+ declare const Icon: ({ icon, sx }: IconProps) => JSX.Element;
27
+
28
+ export { Button, Icon, IconProps, ThemeProvider, ThemeProviderProps, useTheme };
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ __export(src_exports, {
34
34
  Flex: () => import_theme_ui7.Flex,
35
35
  Grid: () => import_theme_ui8.Grid,
36
36
  Heading: () => import_theme_ui9.Heading,
37
+ Icon: () => Icon,
37
38
  Image: () => import_theme_ui10.Image,
38
39
  Input: () => import_theme_ui11.Input,
39
40
  Label: () => import_theme_ui12.Label,
@@ -230,6 +231,18 @@ var import_theme_ui17 = require("theme-ui");
230
231
 
231
232
  // src/components/Radio/Radio.tsx
232
233
  var import_theme_ui18 = require("theme-ui");
234
+
235
+ // src/components/Icon/Icon.tsx
236
+ var import_react2 = require("@iconify/react");
237
+ var import_jsx_runtime3 = require("react/jsx-runtime");
238
+ var Icon = ({ icon, sx }) => {
239
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_theme_ui15.Text, {
240
+ sx,
241
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react2.Icon, {
242
+ icon
243
+ })
244
+ });
245
+ };
233
246
  // Annotate the CommonJS export names for ESM import in node:
234
247
  0 && (module.exports = {
235
248
  Box,
@@ -239,6 +252,7 @@ var import_theme_ui18 = require("theme-ui");
239
252
  Flex,
240
253
  Grid,
241
254
  Heading,
255
+ Icon,
242
256
  Image,
243
257
  Input,
244
258
  Label,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/ui",
3
- "version": "1.21.1",
3
+ "version": "1.21.2",
4
4
  "description": "Primitive layout, typographic, and other components for styling applications.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "typings": "dist/index.d.ts",
22
22
  "dependencies": {
23
+ "@iconify/react": "^4.0.0",
23
24
  "@theme-ui/match-media": "^0.15.1",
24
25
  "theme-ui": "^0.15.1"
25
26
  },
@@ -31,7 +32,7 @@
31
32
  "@emotion/react": "^11.10.4",
32
33
  "@ttoss/config": "^1.18.3",
33
34
  "@ttoss/test-utils": "^1.16.10",
34
- "@ttoss/theme": "^1.0.1",
35
+ "@ttoss/theme": "^1.0.2",
35
36
  "@types/jest": "^29.1.1",
36
37
  "jest": "^29.1.2",
37
38
  "tsup": "^6.2.3"
@@ -44,5 +45,5 @@
44
45
  "publishConfig": {
45
46
  "access": "public"
46
47
  },
47
- "gitHead": "3879642eff43efd073abf52595ed0efe7196946a"
48
+ "gitHead": "b939e6a717618f4cc06605df922e37f89b877561"
48
49
  }
@@ -0,0 +1,15 @@
1
+ import { IconProps as IconPropsUI, Icon as IconUI } from '@iconify/react';
2
+ import { Text, TextProps } from '../Text/Text';
3
+
4
+ export type IconProps = {
5
+ icon: IconPropsUI['icon'];
6
+ sx?: TextProps['sx'];
7
+ };
8
+
9
+ export const Icon = ({ icon, sx }: IconProps) => {
10
+ return (
11
+ <Text sx={sx}>
12
+ <IconUI icon={icon} />
13
+ </Text>
14
+ );
15
+ };
package/src/index.ts CHANGED
@@ -27,3 +27,4 @@ export { Text, type TextProps } from './components/Text/Text';
27
27
  export { Select, type SelectProps } from './components/Select/Select';
28
28
  export { Spinner, type SpinnerProps } from './components/Spinner/Spinner';
29
29
  export { Radio, type RadioProps } from './components/Radio/Radio';
30
+ export { Icon, type IconProps } from './components/Icon/Icon';