@ttoss/ui 1.33.0 → 1.34.1
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/README.md +14 -0
- package/dist/esm/index.js +7 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -7
- package/package.json +3 -3
- package/src/components/CloseButton.tsx +7 -3
- package/src/index.ts +2 -1
package/README.md
CHANGED
|
@@ -92,3 +92,17 @@ export const Provider = (props) => {
|
|
|
92
92
|
);
|
|
93
93
|
};
|
|
94
94
|
```
|
|
95
|
+
|
|
96
|
+
## Misc
|
|
97
|
+
|
|
98
|
+
### keyframes
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { Box, keyframes } from '@ttoss/ui';
|
|
102
|
+
|
|
103
|
+
const fadeIn = keyframes({ from: { opacity: 0 }, to: { opacity: 1 } });
|
|
104
|
+
|
|
105
|
+
export const Component = (props) => {
|
|
106
|
+
return <Box {...props} sx={{ animation: `${fadeIn} 1s backwards` }} />;
|
|
107
|
+
};
|
|
108
|
+
```
|
package/dist/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { BaseStyles, Global as Global2 } from "theme-ui";
|
|
5
5
|
import { useResponsiveValue, useBreakpointIndex } from "@theme-ui/match-media";
|
|
6
|
+
import { keyframes } from "@emotion/react";
|
|
6
7
|
|
|
7
8
|
// src/theme/ThemeProvider.tsx
|
|
8
9
|
import { BruttalFonts, BruttalTheme } from "@ttoss/theme/Bruttal";
|
|
@@ -406,21 +407,19 @@ import React10 from "react";
|
|
|
406
407
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
407
408
|
var CloseButton = /*#__PURE__*/React10.forwardRef(({
|
|
408
409
|
label,
|
|
409
|
-
|
|
410
|
+
onlyText,
|
|
410
411
|
...props
|
|
411
412
|
}, ref) => {
|
|
413
|
+
if (onlyText && !label) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
412
416
|
return /* @__PURE__ */jsxs8(Button2, {
|
|
413
417
|
variant: "buttons.closeButton",
|
|
414
418
|
type: "button",
|
|
415
419
|
"aria-label": label,
|
|
416
|
-
sx: {
|
|
417
|
-
gap: "sm",
|
|
418
|
-
padding: 0,
|
|
419
|
-
...sx
|
|
420
|
-
},
|
|
421
420
|
...props,
|
|
422
421
|
ref,
|
|
423
|
-
children: [label, /* @__PURE__ */jsx13(Icon, {
|
|
422
|
+
children: [label, !onlyText && /* @__PURE__ */jsx13(Icon, {
|
|
424
423
|
icon: "close"
|
|
425
424
|
})]
|
|
426
425
|
});
|
|
@@ -563,4 +562,4 @@ var Stack = /*#__PURE__*/React12.forwardRef((props, ref) => {
|
|
|
563
562
|
});
|
|
564
563
|
});
|
|
565
564
|
Stack.displayName = "Stack";
|
|
566
|
-
export { Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, Icon, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, Label, Progress as LinearProgress, Link, Radio, Select, Slider, Spinner, Stack, Text, Textarea, ThemeProvider, useBreakpointIndex, useResponsiveValue, useTheme };
|
|
565
|
+
export { Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Global2 as Global, Grid, Heading, HelpText, Icon, IconButton, Image, InfiniteLinearProgress, Input, InputNumber, Label, Progress as LinearProgress, Link, Radio, Select, Slider, Spinner, Stack, Text, Textarea, ThemeProvider, keyframes, useBreakpointIndex, useResponsiveValue, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as theme_ui from 'theme-ui';
|
|
2
2
|
import { Theme, BadgeProps as BadgeProps$1, ButtonProps as ButtonProps$1, InputProps as InputProps$1, LabelProps as LabelProps$1, LinkProps as LinkProps$1, SelectProps, IconButtonProps, TextareaProps as TextareaProps$1, TextProps, FlexProps } from 'theme-ui';
|
|
3
|
-
export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Radio, RadioProps, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, Text, TextProps, Theme } from 'theme-ui';
|
|
3
|
+
export { BaseStyles, Box, BoxProps, Card, CardProps, Checkbox, CheckboxProps, Container, ContainerProps, Divider, DividerProps, Flex, FlexProps, Global, Grid, GridProps, Heading, HeadingProps, IconButtonProps, Image, ImageProps, Progress as LinearProgress, ProgressProps as LinearProgressProps, Radio, RadioProps, SelectProps, Slider, SliderProps, Spinner, SpinnerProps, SxProp, Text, TextProps, Theme } from 'theme-ui';
|
|
4
4
|
export { useBreakpointIndex, useResponsiveValue } from '@theme-ui/match-media';
|
|
5
|
+
export { Keyframes, keyframes } from '@emotion/react';
|
|
5
6
|
import * as React from 'react';
|
|
6
7
|
import React__default from 'react';
|
|
7
8
|
import { IconifyIconProps, IconifyIconHTMLElement } from '@iconify-icon/react';
|
|
@@ -70,6 +71,7 @@ declare const HelpText: ({ disabled, negative, ...props }: HelpTextProps) => JSX
|
|
|
70
71
|
|
|
71
72
|
type CloseButtonProps = ButtonProps$1 & {
|
|
72
73
|
label?: string;
|
|
74
|
+
onlyText?: boolean;
|
|
73
75
|
};
|
|
74
76
|
declare const CloseButton: React__default.ForwardRefExoticComponent<Omit<CloseButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
75
77
|
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ __export(src_exports, {
|
|
|
69
69
|
Text: () => import_theme_ui16.Text,
|
|
70
70
|
Textarea: () => Textarea,
|
|
71
71
|
ThemeProvider: () => ThemeProvider,
|
|
72
|
+
keyframes: () => import_react9.keyframes,
|
|
72
73
|
useBreakpointIndex: () => import_match_media.useBreakpointIndex,
|
|
73
74
|
useResponsiveValue: () => import_match_media.useResponsiveValue,
|
|
74
75
|
useTheme: () => useTheme
|
|
@@ -76,6 +77,7 @@ __export(src_exports, {
|
|
|
76
77
|
module.exports = __toCommonJS(src_exports);
|
|
77
78
|
var import_theme_ui27 = require("theme-ui");
|
|
78
79
|
var import_match_media = require("@theme-ui/match-media");
|
|
80
|
+
var import_react9 = require("@emotion/react");
|
|
79
81
|
|
|
80
82
|
// src/theme/ThemeProvider.tsx
|
|
81
83
|
var import_Bruttal = require("@ttoss/theme/Bruttal");
|
|
@@ -479,21 +481,19 @@ var import_react7 = __toESM(require("react"));
|
|
|
479
481
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
480
482
|
var CloseButton = import_react7.default.forwardRef(({
|
|
481
483
|
label,
|
|
482
|
-
|
|
484
|
+
onlyText,
|
|
483
485
|
...props
|
|
484
486
|
}, ref) => {
|
|
487
|
+
if (onlyText && !label) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
485
490
|
return /* @__PURE__ */(0, import_jsx_runtime13.jsxs)(import_theme_ui25.Button, {
|
|
486
491
|
variant: "buttons.closeButton",
|
|
487
492
|
type: "button",
|
|
488
493
|
"aria-label": label,
|
|
489
|
-
sx: {
|
|
490
|
-
gap: "sm",
|
|
491
|
-
padding: 0,
|
|
492
|
-
...sx
|
|
493
|
-
},
|
|
494
494
|
...props,
|
|
495
495
|
ref,
|
|
496
|
-
children: [label, /* @__PURE__ */(0, import_jsx_runtime13.jsx)(Icon, {
|
|
496
|
+
children: [label, !onlyText && /* @__PURE__ */(0, import_jsx_runtime13.jsx)(Icon, {
|
|
497
497
|
icon: "close"
|
|
498
498
|
})]
|
|
499
499
|
});
|
|
@@ -669,6 +669,7 @@ Stack.displayName = "Stack";
|
|
|
669
669
|
Text,
|
|
670
670
|
Textarea,
|
|
671
671
|
ThemeProvider,
|
|
672
|
+
keyframes,
|
|
672
673
|
useBreakpointIndex,
|
|
673
674
|
useResponsiveValue,
|
|
674
675
|
useTheme
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.1",
|
|
4
4
|
"description": "Primitive layout, typographic, and other components for styling applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@emotion/react": "^11.10.6",
|
|
24
24
|
"@iconify-icon/react": "^1.0.7",
|
|
25
25
|
"@theme-ui/match-media": "^0.15.7",
|
|
26
|
-
"@ttoss/theme": "^1.4.
|
|
26
|
+
"@ttoss/theme": "^1.4.24",
|
|
27
27
|
"theme-ui": "^0.15.7"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "b473ec0322fbe1a459d81339aab3de60d6bebc9a"
|
|
52
52
|
}
|
|
@@ -4,24 +4,28 @@ import React from 'react';
|
|
|
4
4
|
|
|
5
5
|
export type CloseButtonProps = ButtonProps & {
|
|
6
6
|
label?: string;
|
|
7
|
+
onlyText?: boolean;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export const CloseButton = React.forwardRef<
|
|
10
11
|
HTMLButtonElement,
|
|
11
12
|
CloseButtonProps
|
|
12
|
-
>(({ label,
|
|
13
|
+
>(({ label, onlyText, ...props }, ref) => {
|
|
14
|
+
if (onlyText && !label) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
return (
|
|
14
19
|
<Button
|
|
15
20
|
variant="buttons.closeButton"
|
|
16
21
|
type="button"
|
|
17
22
|
aria-label={label}
|
|
18
|
-
sx={{ gap: 'sm', padding: 0, ...sx }}
|
|
19
23
|
{...props}
|
|
20
24
|
ref={ref}
|
|
21
25
|
>
|
|
22
26
|
{label}
|
|
23
27
|
|
|
24
|
-
<Icon icon="close" />
|
|
28
|
+
{!onlyText && <Icon icon="close" />}
|
|
25
29
|
</Button>
|
|
26
30
|
);
|
|
27
31
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { BaseStyles, type Theme, Global } from 'theme-ui';
|
|
1
|
+
export { BaseStyles, type Theme, Global, type SxProp } from 'theme-ui';
|
|
2
2
|
export { useResponsiveValue, useBreakpointIndex } from '@theme-ui/match-media';
|
|
3
|
+
export { keyframes, type Keyframes } from '@emotion/react';
|
|
3
4
|
|
|
4
5
|
export { ThemeProvider, type ThemeProviderProps } from './theme/ThemeProvider';
|
|
5
6
|
|