@cerberus-design/react 0.3.2-next-bdab9b9 → 0.3.2-next-cb4907c
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/build/legacy/_tsup-dts-rollup.d.ts +12 -0
- package/build/legacy/chunk-SWUW4BYA.js +58 -0
- package/build/legacy/chunk-SWUW4BYA.js.map +1 -0
- package/build/legacy/components/Tag.js +1 -2
- package/build/legacy/index.js +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +12 -0
- package/build/modern/chunk-SWUW4BYA.js +58 -0
- package/build/modern/chunk-SWUW4BYA.js.map +1 -0
- package/build/modern/components/Tag.js +1 -2
- package/build/modern/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Tag.tsx +46 -9
- package/build/legacy/chunk-YZO3DYQU.js +0 -34
- package/build/legacy/chunk-YZO3DYQU.js.map +0 -1
- package/build/modern/chunk-YZO3DYQU.js +0 -34
- package/build/modern/chunk-YZO3DYQU.js.map +0 -1
|
@@ -33,6 +33,7 @@ export { ButtonProps }
|
|
|
33
33
|
export { ButtonProps as ButtonProps_alias_1 }
|
|
34
34
|
|
|
35
35
|
declare interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
36
|
+
palette?: Sentiment;
|
|
36
37
|
shape?: 'pill';
|
|
37
38
|
onClick: () => void;
|
|
38
39
|
usage?: 'filled';
|
|
@@ -411,10 +412,21 @@ declare interface TabsProps {
|
|
|
411
412
|
export { TabsProps }
|
|
412
413
|
export { TabsProps as TabsProps_alias_1 }
|
|
413
414
|
|
|
415
|
+
/**
|
|
416
|
+
* The Tag component is used to display a meta descriptions.
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* <Tag>Tag</Tag>
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
414
422
|
declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JSX.Element;
|
|
415
423
|
export { Tag }
|
|
416
424
|
export { Tag as Tag_alias_1 }
|
|
417
425
|
|
|
426
|
+
/**
|
|
427
|
+
* This module contains the tag component.
|
|
428
|
+
* @module
|
|
429
|
+
*/
|
|
418
430
|
declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
419
431
|
palette?: Sentiment;
|
|
420
432
|
shape?: 'rounded' | 'pill';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Show
|
|
3
|
+
} from "./chunk-R4H3352X.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Tag.tsx
|
|
6
|
+
import { Close } from "@cerberus/icons";
|
|
7
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
8
|
+
import { iconButton, tag } from "@cerberus/styled-system/recipes";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function Tag(props) {
|
|
11
|
+
const {
|
|
12
|
+
palette: initPalette,
|
|
13
|
+
shape: initShape,
|
|
14
|
+
onClick,
|
|
15
|
+
usage,
|
|
16
|
+
...nativeProps
|
|
17
|
+
} = props;
|
|
18
|
+
const isClosable = Boolean(onClick);
|
|
19
|
+
const shape = isClosable ? "pill" : initShape;
|
|
20
|
+
const palette = isClosable ? "action" : initPalette;
|
|
21
|
+
const closableStyles = isClosable ? css({
|
|
22
|
+
paddingInlineEnd: "0"
|
|
23
|
+
}) : "";
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
...nativeProps,
|
|
28
|
+
className: cx(
|
|
29
|
+
nativeProps.className,
|
|
30
|
+
tag({
|
|
31
|
+
palette,
|
|
32
|
+
shape,
|
|
33
|
+
usage
|
|
34
|
+
}),
|
|
35
|
+
closableStyles
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
props.children,
|
|
39
|
+
/* @__PURE__ */ jsx(Show, { when: isClosable, children: /* @__PURE__ */ jsx(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
"aria-label": "Close",
|
|
43
|
+
className: iconButton({
|
|
44
|
+
palette: "action"
|
|
45
|
+
}),
|
|
46
|
+
onClick,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Close, {})
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Tag
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-SWUW4BYA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { type Sentiment } from '@cerberus/panda-preset'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'pill'\n onClick: () => void\n usage?: 'filled'\n}\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(\n props: PropsWithChildren<TagProps | ClickableTagProps>,\n): JSX.Element {\n const {\n palette: initPalette,\n shape: initShape,\n onClick,\n usage,\n ...nativeProps\n } = props\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const palette = isClosable ? 'action' : initPalette\n const closableStyles = isClosable\n ? css({\n paddingInlineEnd: '0',\n })\n : ''\n\n return (\n <span\n {...nativeProps}\n className={cx(\n nativeProps.className,\n tag({\n palette,\n shape,\n usage,\n }),\n closableStyles,\n )}\n >\n {props.children}\n\n <Show when={isClosable}>\n <button\n aria-label=\"Close\"\n className={iconButton({\n palette: 'action',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAGtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AA8C5B,SAsBM,KAtBN;AApBG,SAAS,IACd,OACa;AACb,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,UAAU,aAAa,WAAW;AACxC,QAAM,iBAAiB,aACnB,IAAI;AAAA,IACF,kBAAkB;AAAA,EACpB,CAAC,IACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,IAAI;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MAEC;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,WAAW;AAAA,cACpB,SAAS;AAAA,YACX,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/legacy/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export { ButtonProps }
|
|
|
33
33
|
export { ButtonProps as ButtonProps_alias_1 }
|
|
34
34
|
|
|
35
35
|
declare interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
36
|
+
palette?: Sentiment;
|
|
36
37
|
shape?: 'pill';
|
|
37
38
|
onClick: () => void;
|
|
38
39
|
usage?: 'filled';
|
|
@@ -411,10 +412,21 @@ declare interface TabsProps {
|
|
|
411
412
|
export { TabsProps }
|
|
412
413
|
export { TabsProps as TabsProps_alias_1 }
|
|
413
414
|
|
|
415
|
+
/**
|
|
416
|
+
* The Tag component is used to display a meta descriptions.
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* <Tag>Tag</Tag>
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
414
422
|
declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JSX.Element;
|
|
415
423
|
export { Tag }
|
|
416
424
|
export { Tag as Tag_alias_1 }
|
|
417
425
|
|
|
426
|
+
/**
|
|
427
|
+
* This module contains the tag component.
|
|
428
|
+
* @module
|
|
429
|
+
*/
|
|
418
430
|
declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
419
431
|
palette?: Sentiment;
|
|
420
432
|
shape?: 'rounded' | 'pill';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Show
|
|
3
|
+
} from "./chunk-R4H3352X.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Tag.tsx
|
|
6
|
+
import { Close } from "@cerberus/icons";
|
|
7
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
8
|
+
import { iconButton, tag } from "@cerberus/styled-system/recipes";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function Tag(props) {
|
|
11
|
+
const {
|
|
12
|
+
palette: initPalette,
|
|
13
|
+
shape: initShape,
|
|
14
|
+
onClick,
|
|
15
|
+
usage,
|
|
16
|
+
...nativeProps
|
|
17
|
+
} = props;
|
|
18
|
+
const isClosable = Boolean(onClick);
|
|
19
|
+
const shape = isClosable ? "pill" : initShape;
|
|
20
|
+
const palette = isClosable ? "action" : initPalette;
|
|
21
|
+
const closableStyles = isClosable ? css({
|
|
22
|
+
paddingInlineEnd: "0"
|
|
23
|
+
}) : "";
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
...nativeProps,
|
|
28
|
+
className: cx(
|
|
29
|
+
nativeProps.className,
|
|
30
|
+
tag({
|
|
31
|
+
palette,
|
|
32
|
+
shape,
|
|
33
|
+
usage
|
|
34
|
+
}),
|
|
35
|
+
closableStyles
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
props.children,
|
|
39
|
+
/* @__PURE__ */ jsx(Show, { when: isClosable, children: /* @__PURE__ */ jsx(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
"aria-label": "Close",
|
|
43
|
+
className: iconButton({
|
|
44
|
+
palette: "action"
|
|
45
|
+
}),
|
|
46
|
+
onClick,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Close, {})
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
Tag
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-SWUW4BYA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { type Sentiment } from '@cerberus/panda-preset'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'pill'\n onClick: () => void\n usage?: 'filled'\n}\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(\n props: PropsWithChildren<TagProps | ClickableTagProps>,\n): JSX.Element {\n const {\n palette: initPalette,\n shape: initShape,\n onClick,\n usage,\n ...nativeProps\n } = props\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const palette = isClosable ? 'action' : initPalette\n const closableStyles = isClosable\n ? css({\n paddingInlineEnd: '0',\n })\n : ''\n\n return (\n <span\n {...nativeProps}\n className={cx(\n nativeProps.className,\n tag({\n palette,\n shape,\n usage,\n }),\n closableStyles,\n )}\n >\n {props.children}\n\n <Show when={isClosable}>\n <button\n aria-label=\"Close\"\n className={iconButton({\n palette: 'action',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAGtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AA8C5B,SAsBM,KAtBN;AApBG,SAAS,IACd,OACa;AACb,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,UAAU,aAAa,WAAW;AACxC,QAAM,iBAAiB,aACnB,IAAI;AAAA,IACF,kBAAkB;AAAA,EACpB,CAAC,IACD;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,IAAI;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MAEC;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,WAAW;AAAA,cACpB,SAAS;AAAA,YACX,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/build/modern/index.js
CHANGED
package/package.json
CHANGED
package/src/components/Tag.tsx
CHANGED
|
@@ -2,8 +2,13 @@ import type { HTMLAttributes, PropsWithChildren } from 'react'
|
|
|
2
2
|
import { Close } from '@cerberus/icons'
|
|
3
3
|
import { type Sentiment } from '@cerberus/panda-preset'
|
|
4
4
|
import { Show } from './Show'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { css, cx } from '@cerberus/styled-system/css'
|
|
6
|
+
import { iconButton, tag } from '@cerberus/styled-system/recipes'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module contains the tag component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
7
12
|
|
|
8
13
|
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
9
14
|
palette?: Sentiment
|
|
@@ -11,31 +16,63 @@ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
11
16
|
usage?: 'filled' | 'outline'
|
|
12
17
|
}
|
|
13
18
|
export interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
19
|
+
palette?: Sentiment
|
|
14
20
|
shape?: 'pill'
|
|
15
21
|
onClick: () => void
|
|
16
22
|
usage?: 'filled'
|
|
17
23
|
}
|
|
18
24
|
|
|
25
|
+
/**
|
|
26
|
+
* The Tag component is used to display a meta descriptions.
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Tag>Tag</Tag>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
19
32
|
export function Tag(
|
|
20
33
|
props: PropsWithChildren<TagProps | ClickableTagProps>,
|
|
21
34
|
): JSX.Element {
|
|
22
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
palette: initPalette,
|
|
37
|
+
shape: initShape,
|
|
38
|
+
onClick,
|
|
39
|
+
usage,
|
|
40
|
+
...nativeProps
|
|
41
|
+
} = props
|
|
23
42
|
const isClosable = Boolean(onClick)
|
|
24
|
-
const
|
|
43
|
+
const shape = isClosable ? 'pill' : initShape
|
|
44
|
+
const palette = isClosable ? 'action' : initPalette
|
|
45
|
+
const closableStyles = isClosable
|
|
46
|
+
? css({
|
|
47
|
+
paddingInlineEnd: '0',
|
|
48
|
+
})
|
|
49
|
+
: ''
|
|
25
50
|
|
|
26
51
|
return (
|
|
27
52
|
<span
|
|
28
53
|
{...nativeProps}
|
|
29
|
-
className={cx(
|
|
30
|
-
|
|
31
|
-
|
|
54
|
+
className={cx(
|
|
55
|
+
nativeProps.className,
|
|
56
|
+
tag({
|
|
57
|
+
palette,
|
|
58
|
+
shape,
|
|
59
|
+
usage,
|
|
60
|
+
}),
|
|
61
|
+
closableStyles,
|
|
62
|
+
)}
|
|
32
63
|
>
|
|
33
64
|
{props.children}
|
|
34
65
|
|
|
35
66
|
<Show when={isClosable}>
|
|
36
|
-
<
|
|
67
|
+
<button
|
|
68
|
+
aria-label="Close"
|
|
69
|
+
className={iconButton({
|
|
70
|
+
palette: 'action',
|
|
71
|
+
})}
|
|
72
|
+
onClick={onClick}
|
|
73
|
+
>
|
|
37
74
|
<Close />
|
|
38
|
-
</
|
|
75
|
+
</button>
|
|
39
76
|
</Show>
|
|
40
77
|
</span>
|
|
41
78
|
)
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Show
|
|
3
|
-
} from "./chunk-R4H3352X.js";
|
|
4
|
-
import {
|
|
5
|
-
IconButton
|
|
6
|
-
} from "./chunk-MRJ3KCHK.js";
|
|
7
|
-
|
|
8
|
-
// src/components/Tag.tsx
|
|
9
|
-
import { Close } from "@cerberus/icons";
|
|
10
|
-
import { cx } from "@cerberus/styled-system/css";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
function Tag(props) {
|
|
13
|
-
const { shape, onClick, usage, ...nativeProps } = props;
|
|
14
|
-
const isClosable = Boolean(onClick);
|
|
15
|
-
const finalShape = isClosable ? "pill" : shape;
|
|
16
|
-
return /* @__PURE__ */ jsxs(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
...nativeProps,
|
|
20
|
-
className: cx(nativeProps.className, "tag"),
|
|
21
|
-
"data-temp-shape": finalShape,
|
|
22
|
-
"data-temp-usage": usage,
|
|
23
|
-
children: [
|
|
24
|
-
props.children,
|
|
25
|
-
/* @__PURE__ */ jsx(Show, { when: isClosable, children: /* @__PURE__ */ jsx(IconButton, { ariaLabel: "Close", onClick, children: /* @__PURE__ */ jsx(Close, {}) }) })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
Tag
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-YZO3DYQU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { type Sentiment } from '@cerberus/panda-preset'\nimport { Show } from './Show'\nimport { IconButton } from './IconButton'\nimport { cx } from '@cerberus/styled-system/css'\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: 'pill'\n onClick: () => void\n usage?: 'filled'\n}\n\nexport function Tag(\n props: PropsWithChildren<TagProps | ClickableTagProps>,\n): JSX.Element {\n const { shape, onClick, usage, ...nativeProps } = props\n const isClosable = Boolean(onClick)\n const finalShape = isClosable ? 'pill' : shape\n\n return (\n <span\n {...nativeProps}\n className={cx(nativeProps.className, 'tag')}\n data-temp-shape={finalShape}\n data-temp-usage={usage}\n >\n {props.children}\n\n <Show when={isClosable}>\n <IconButton ariaLabel=\"Close\" onClick={onClick}>\n <Close />\n </IconButton>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;;;;AACA,SAAS,aAAa;AAItB,SAAS,UAAU;AAqBf,SAUM,KAVN;AARG,SAAS,IACd,OACa;AACb,QAAM,EAAE,OAAO,SAAS,OAAO,GAAG,YAAY,IAAI;AAClD,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,aAAa,aAAa,SAAS;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,YAAY,WAAW,KAAK;AAAA,MAC1C,mBAAiB;AAAA,MACjB,mBAAiB;AAAA,MAEhB;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV,8BAAC,cAAW,WAAU,SAAQ,SAC5B,8BAAC,SAAM,GACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Show
|
|
3
|
-
} from "./chunk-R4H3352X.js";
|
|
4
|
-
import {
|
|
5
|
-
IconButton
|
|
6
|
-
} from "./chunk-MRJ3KCHK.js";
|
|
7
|
-
|
|
8
|
-
// src/components/Tag.tsx
|
|
9
|
-
import { Close } from "@cerberus/icons";
|
|
10
|
-
import { cx } from "@cerberus/styled-system/css";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
function Tag(props) {
|
|
13
|
-
const { shape, onClick, usage, ...nativeProps } = props;
|
|
14
|
-
const isClosable = Boolean(onClick);
|
|
15
|
-
const finalShape = isClosable ? "pill" : shape;
|
|
16
|
-
return /* @__PURE__ */ jsxs(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
...nativeProps,
|
|
20
|
-
className: cx(nativeProps.className, "tag"),
|
|
21
|
-
"data-temp-shape": finalShape,
|
|
22
|
-
"data-temp-usage": usage,
|
|
23
|
-
children: [
|
|
24
|
-
props.children,
|
|
25
|
-
/* @__PURE__ */ jsx(Show, { when: isClosable, children: /* @__PURE__ */ jsx(IconButton, { ariaLabel: "Close", onClick, children: /* @__PURE__ */ jsx(Close, {}) }) })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
Tag
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-YZO3DYQU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { type Sentiment } from '@cerberus/panda-preset'\nimport { Show } from './Show'\nimport { IconButton } from './IconButton'\nimport { cx } from '@cerberus/styled-system/css'\n\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: Sentiment\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: 'pill'\n onClick: () => void\n usage?: 'filled'\n}\n\nexport function Tag(\n props: PropsWithChildren<TagProps | ClickableTagProps>,\n): JSX.Element {\n const { shape, onClick, usage, ...nativeProps } = props\n const isClosable = Boolean(onClick)\n const finalShape = isClosable ? 'pill' : shape\n\n return (\n <span\n {...nativeProps}\n className={cx(nativeProps.className, 'tag')}\n data-temp-shape={finalShape}\n data-temp-usage={usage}\n >\n {props.children}\n\n <Show when={isClosable}>\n <IconButton ariaLabel=\"Close\" onClick={onClick}>\n <Close />\n </IconButton>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;;;;AACA,SAAS,aAAa;AAItB,SAAS,UAAU;AAqBf,SAUM,KAVN;AARG,SAAS,IACd,OACa;AACb,QAAM,EAAE,OAAO,SAAS,OAAO,GAAG,YAAY,IAAI;AAClD,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,aAAa,aAAa,SAAS;AAEzC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,YAAY,WAAW,KAAK;AAAA,MAC1C,mBAAiB;AAAA,MACjB,mBAAiB;AAAA,MAEhB;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV,8BAAC,cAAW,WAAU,SAAQ,SAC5B,8BAAC,SAAM,GACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|