@ttoss/ui 1.31.16 → 1.31.17
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 +28 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +31 -2
- package/package.json +3 -3
- package/src/components/CloseButton.tsx +29 -0
- package/src/index.ts +1 -0
package/dist/esm/index.js
CHANGED
|
@@ -346,4 +346,31 @@ var HelpText = ({
|
|
|
346
346
|
...props
|
|
347
347
|
});
|
|
348
348
|
};
|
|
349
|
-
|
|
349
|
+
|
|
350
|
+
// src/components/CloseButton.tsx
|
|
351
|
+
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(({
|
|
355
|
+
label,
|
|
356
|
+
sx,
|
|
357
|
+
...props
|
|
358
|
+
}, ref) => {
|
|
359
|
+
return /* @__PURE__ */jsxs7(Button2, {
|
|
360
|
+
variant: "buttons.closeButton",
|
|
361
|
+
type: "button",
|
|
362
|
+
"aria-label": label,
|
|
363
|
+
sx: {
|
|
364
|
+
gap: "sm",
|
|
365
|
+
padding: 0,
|
|
366
|
+
...sx
|
|
367
|
+
},
|
|
368
|
+
...props,
|
|
369
|
+
ref,
|
|
370
|
+
children: [label, /* @__PURE__ */jsx11(Icon, {
|
|
371
|
+
icon: "close"
|
|
372
|
+
})]
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
CloseButton.displayName = "CloseButton";
|
|
376
|
+
export { Badge, BaseStyles, Box, Button, Card, Checkbox, CloseButton, Container, Divider, Flex, Grid, Heading, HelpText, Icon, IconButton, Image, InfiniteLinearProgress, Input, Label, Progress as LinearProgress, Link, Radio, Select, Slider, Spinner, Text, Textarea, ThemeProvider, useBreakpointIndex, useResponsiveValue, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -59,4 +59,9 @@ type HelpTextProps = Omit<TextProps, 'variant'> & {
|
|
|
59
59
|
};
|
|
60
60
|
declare const HelpText: ({ disabled, negative, ...props }: HelpTextProps) => JSX.Element;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
type CloseButtonProps = ButtonProps$1 & {
|
|
63
|
+
label?: string;
|
|
64
|
+
};
|
|
65
|
+
declare const CloseButton: React__default.ForwardRefExoticComponent<Omit<CloseButtonProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
|
|
67
|
+
export { Badge, BadgeProps, Button, ButtonProps, CloseButton, CloseButtonProps, HelpText, HelpTextProps, Icon, IconButton, IconProps, IconType, InfiniteLinearProgress, Input, InputProps, Label, LabelProps, Select, SelectProps, ThemeProvider, ThemeProviderProps, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -39,11 +39,12 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
39
39
|
var src_exports = {};
|
|
40
40
|
__export(src_exports, {
|
|
41
41
|
Badge: () => Badge,
|
|
42
|
-
BaseStyles: () =>
|
|
42
|
+
BaseStyles: () => import_theme_ui26.BaseStyles,
|
|
43
43
|
Box: () => import_theme_ui4.Box,
|
|
44
44
|
Button: () => Button,
|
|
45
45
|
Card: () => import_theme_ui6.Card,
|
|
46
46
|
Checkbox: () => import_theme_ui22.Checkbox,
|
|
47
|
+
CloseButton: () => CloseButton,
|
|
47
48
|
Container: () => import_theme_ui24.Container,
|
|
48
49
|
Divider: () => import_theme_ui7.Divider,
|
|
49
50
|
Flex: () => import_theme_ui8.Flex,
|
|
@@ -70,7 +71,7 @@ __export(src_exports, {
|
|
|
70
71
|
useTheme: () => useTheme
|
|
71
72
|
});
|
|
72
73
|
module.exports = __toCommonJS(src_exports);
|
|
73
|
-
var
|
|
74
|
+
var import_theme_ui26 = require("theme-ui");
|
|
74
75
|
var import_match_media = require("@theme-ui/match-media");
|
|
75
76
|
|
|
76
77
|
// src/theme/ThemeProvider.tsx
|
|
@@ -415,6 +416,33 @@ var HelpText = ({
|
|
|
415
416
|
...props
|
|
416
417
|
});
|
|
417
418
|
};
|
|
419
|
+
|
|
420
|
+
// src/components/CloseButton.tsx
|
|
421
|
+
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(({
|
|
425
|
+
label,
|
|
426
|
+
sx,
|
|
427
|
+
...props
|
|
428
|
+
}, ref) => {
|
|
429
|
+
return /* @__PURE__ */(0, import_jsx_runtime11.jsxs)(import_theme_ui25.Button, {
|
|
430
|
+
variant: "buttons.closeButton",
|
|
431
|
+
type: "button",
|
|
432
|
+
"aria-label": label,
|
|
433
|
+
sx: {
|
|
434
|
+
gap: "sm",
|
|
435
|
+
padding: 0,
|
|
436
|
+
...sx
|
|
437
|
+
},
|
|
438
|
+
...props,
|
|
439
|
+
ref,
|
|
440
|
+
children: [label, /* @__PURE__ */(0, import_jsx_runtime11.jsx)(Icon, {
|
|
441
|
+
icon: "close"
|
|
442
|
+
})]
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
CloseButton.displayName = "CloseButton";
|
|
418
446
|
// Annotate the CommonJS export names for ESM import in node:
|
|
419
447
|
0 && (module.exports = {
|
|
420
448
|
Badge,
|
|
@@ -423,6 +451,7 @@ var HelpText = ({
|
|
|
423
451
|
Button,
|
|
424
452
|
Card,
|
|
425
453
|
Checkbox,
|
|
454
|
+
CloseButton,
|
|
426
455
|
Container,
|
|
427
456
|
Divider,
|
|
428
457
|
Flex,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/ui",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.17",
|
|
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.
|
|
27
|
+
"@ttoss/theme": "^1.4.14",
|
|
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": "
|
|
49
|
+
"gitHead": "f7ce64308917a032fdd64066b00d26f12702ef83"
|
|
50
50
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button, type ButtonProps } from 'theme-ui';
|
|
2
|
+
import { Icon } from './Icon';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
export type CloseButtonProps = ButtonProps & {
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const CloseButton = React.forwardRef<
|
|
10
|
+
HTMLButtonElement,
|
|
11
|
+
CloseButtonProps
|
|
12
|
+
>(({ label, sx, ...props }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
<Button
|
|
15
|
+
variant="buttons.closeButton"
|
|
16
|
+
type="button"
|
|
17
|
+
aria-label={label}
|
|
18
|
+
sx={{ gap: 'sm', padding: 0, ...sx }}
|
|
19
|
+
{...props}
|
|
20
|
+
ref={ref}
|
|
21
|
+
>
|
|
22
|
+
{label}
|
|
23
|
+
|
|
24
|
+
<Icon icon="close" />
|
|
25
|
+
</Button>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
CloseButton.displayName = 'CloseButton';
|
package/src/index.ts
CHANGED
|
@@ -33,3 +33,4 @@ export { InfiniteLinearProgress } from './components/InfiniteLinearProgress';
|
|
|
33
33
|
export { Textarea, type TextareaProps } from './components/Textarea';
|
|
34
34
|
export { Container, type ContainerProps } from './components/Container';
|
|
35
35
|
export { HelpText, type HelpTextProps } from './components/HelpText';
|
|
36
|
+
export { CloseButton, type CloseButtonProps } from './components/CloseButton';
|