@cerberus-design/react 0.4.0-next-6c85a51 → 0.4.0-next-af3a77f

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.
@@ -1,5 +1,6 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
+ import type { ConditionalValue } from '@cerberus/styled-system/types';
3
4
  import { Context } from 'react';
4
5
  import { ElementType } from 'react';
5
6
  import { HTMLAttributes } from 'react';
@@ -9,7 +10,6 @@ import { MutableRefObject } from 'react';
9
10
  import { PropsWithChildren } from 'react';
10
11
  import { ReactNode } from 'react';
11
12
  import { RefObject } from 'react';
12
- import { Sentiment } from '@cerberus/panda-preset';
13
13
  import type { TextareaHTMLAttributes } from 'react';
14
14
 
15
15
  /**
@@ -33,7 +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
+ palette?: NonActionablePalette;
37
37
  shape?: 'pill';
38
38
  onClick: () => void;
39
39
  usage?: 'filled';
@@ -267,6 +267,14 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
267
267
  export { NavTriggerRef }
268
268
  export { NavTriggerRef as NavTriggerRef_alias_1 }
269
269
 
270
+ /**
271
+ * This module contains the tag component.
272
+ * @module
273
+ */
274
+ declare type NonActionablePalette = ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
275
+ export { NonActionablePalette }
276
+ export { NonActionablePalette as NonActionablePalette_alias_1 }
277
+
270
278
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
271
279
  export { Positions }
272
280
  export { Positions as Positions_alias_1 }
@@ -425,12 +433,8 @@ declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JS
425
433
  export { Tag }
426
434
  export { Tag as Tag_alias_1 }
427
435
 
428
- /**
429
- * This module contains the tag component.
430
- * @module
431
- */
432
436
  declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
433
- palette?: Sentiment;
437
+ palette?: NonActionablePalette;
434
438
  shape?: 'rounded' | 'pill';
435
439
  usage?: 'filled' | 'outline';
436
440
  }
@@ -8,18 +8,12 @@ import { css, cx } from "@cerberus/styled-system/css";
8
8
  import { iconButton, tag } from "@cerberus/styled-system/recipes";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  function Tag(props) {
11
- const {
12
- palette: initPalette,
13
- shape: initShape,
14
- onClick,
15
- usage,
16
- ...nativeProps
17
- } = props;
11
+ const { palette, shape: initShape, onClick, usage, ...nativeProps } = props;
18
12
  const isClosable = Boolean(onClick);
19
13
  const shape = isClosable ? "pill" : initShape;
20
- const palette = isClosable ? "action" : initPalette;
21
14
  const closableStyles = isClosable ? css({
22
15
  bgColor: "action.bg.active",
16
+ color: "action.text.initial",
23
17
  paddingInlineEnd: "0"
24
18
  }) : "";
25
19
  return /* @__PURE__ */ jsxs(
@@ -58,4 +52,4 @@ function Tag(props) {
58
52
  export {
59
53
  Tag
60
54
  };
61
- //# sourceMappingURL=chunk-ULXTQXVY.js.map
55
+ //# sourceMappingURL=chunk-7BXBIDZB.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 { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\nimport type { ConditionalValue } from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type NonActionablePalette = ConditionalValue<\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n>\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: NonActionablePalette\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: NonActionablePalette\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 { palette, shape: initShape, onClick, usage, ...nativeProps } = props\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const closableStyles = isClosable\n ? css({\n bgColor: 'action.bg.active',\n color: 'action.text.initial',\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 usage: 'filled',\n size: 'sm',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAEtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AA6C5B,SAwBM,KAxBN;AAfG,SAAS,IACd,OACa;AACb,QAAM,EAAE,SAAS,OAAO,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtE,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,iBAAiB,aACnB,IAAI;AAAA,IACF,SAAS;AAAA,IACT,OAAO;AAAA,IACP,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,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,3 +1,4 @@
1
1
  export { Tag_alias_1 as Tag } from '../_tsup-dts-rollup';
2
+ export { NonActionablePalette_alias_1 as NonActionablePalette } from '../_tsup-dts-rollup';
2
3
  export { TagProps_alias_1 as TagProps } from '../_tsup-dts-rollup';
3
4
  export { ClickableTagProps_alias_1 as ClickableTagProps } from '../_tsup-dts-rollup';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tag
3
- } from "../chunk-ULXTQXVY.js";
3
+ } from "../chunk-7BXBIDZB.js";
4
4
  import "../chunk-R4H3352X.js";
5
5
  export {
6
6
  Tag
@@ -23,6 +23,7 @@ export { TabListProps } from './_tsup-dts-rollup';
23
23
  export { TabPanel } from './_tsup-dts-rollup';
24
24
  export { TabPanelProps } from './_tsup-dts-rollup';
25
25
  export { Tag } from './_tsup-dts-rollup';
26
+ export { NonActionablePalette } from './_tsup-dts-rollup';
26
27
  export { TagProps } from './_tsup-dts-rollup';
27
28
  export { ClickableTagProps } from './_tsup-dts-rollup';
28
29
  export { Textarea } from './_tsup-dts-rollup';
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SVZU6LPF.js";
4
4
  import {
5
5
  Tag
6
- } from "./chunk-ULXTQXVY.js";
6
+ } from "./chunk-7BXBIDZB.js";
7
7
  import {
8
8
  Textarea
9
9
  } from "./chunk-5TBINKAO.js";
@@ -1,5 +1,6 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
+ import type { ConditionalValue } from '@cerberus/styled-system/types';
3
4
  import { Context } from 'react';
4
5
  import { ElementType } from 'react';
5
6
  import { HTMLAttributes } from 'react';
@@ -9,7 +10,6 @@ import { MutableRefObject } from 'react';
9
10
  import { PropsWithChildren } from 'react';
10
11
  import { ReactNode } from 'react';
11
12
  import { RefObject } from 'react';
12
- import { Sentiment } from '@cerberus/panda-preset';
13
13
  import type { TextareaHTMLAttributes } from 'react';
14
14
 
15
15
  /**
@@ -33,7 +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
+ palette?: NonActionablePalette;
37
37
  shape?: 'pill';
38
38
  onClick: () => void;
39
39
  usage?: 'filled';
@@ -267,6 +267,14 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
267
267
  export { NavTriggerRef }
268
268
  export { NavTriggerRef as NavTriggerRef_alias_1 }
269
269
 
270
+ /**
271
+ * This module contains the tag component.
272
+ * @module
273
+ */
274
+ declare type NonActionablePalette = ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
275
+ export { NonActionablePalette }
276
+ export { NonActionablePalette as NonActionablePalette_alias_1 }
277
+
270
278
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
271
279
  export { Positions }
272
280
  export { Positions as Positions_alias_1 }
@@ -425,12 +433,8 @@ declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JS
425
433
  export { Tag }
426
434
  export { Tag as Tag_alias_1 }
427
435
 
428
- /**
429
- * This module contains the tag component.
430
- * @module
431
- */
432
436
  declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
433
- palette?: Sentiment;
437
+ palette?: NonActionablePalette;
434
438
  shape?: 'rounded' | 'pill';
435
439
  usage?: 'filled' | 'outline';
436
440
  }
@@ -8,18 +8,12 @@ import { css, cx } from "@cerberus/styled-system/css";
8
8
  import { iconButton, tag } from "@cerberus/styled-system/recipes";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  function Tag(props) {
11
- const {
12
- palette: initPalette,
13
- shape: initShape,
14
- onClick,
15
- usage,
16
- ...nativeProps
17
- } = props;
11
+ const { palette, shape: initShape, onClick, usage, ...nativeProps } = props;
18
12
  const isClosable = Boolean(onClick);
19
13
  const shape = isClosable ? "pill" : initShape;
20
- const palette = isClosable ? "action" : initPalette;
21
14
  const closableStyles = isClosable ? css({
22
15
  bgColor: "action.bg.active",
16
+ color: "action.text.initial",
23
17
  paddingInlineEnd: "0"
24
18
  }) : "";
25
19
  return /* @__PURE__ */ jsxs(
@@ -58,4 +52,4 @@ function Tag(props) {
58
52
  export {
59
53
  Tag
60
54
  };
61
- //# sourceMappingURL=chunk-ULXTQXVY.js.map
55
+ //# sourceMappingURL=chunk-7BXBIDZB.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 { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\nimport type { ConditionalValue } from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type NonActionablePalette = ConditionalValue<\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n>\nexport interface TagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: NonActionablePalette\n shape?: 'rounded' | 'pill'\n usage?: 'filled' | 'outline'\n}\nexport interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {\n palette?: NonActionablePalette\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 { palette, shape: initShape, onClick, usage, ...nativeProps } = props\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const closableStyles = isClosable\n ? css({\n bgColor: 'action.bg.active',\n color: 'action.text.initial',\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 usage: 'filled',\n size: 'sm',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAEtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AA6C5B,SAwBM,KAxBN;AAfG,SAAS,IACd,OACa;AACb,QAAM,EAAE,SAAS,OAAO,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AACtE,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,iBAAiB,aACnB,IAAI;AAAA,IACF,SAAS;AAAA,IACT,OAAO;AAAA,IACP,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,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,3 +1,4 @@
1
1
  export { Tag_alias_1 as Tag } from '../_tsup-dts-rollup';
2
+ export { NonActionablePalette_alias_1 as NonActionablePalette } from '../_tsup-dts-rollup';
2
3
  export { TagProps_alias_1 as TagProps } from '../_tsup-dts-rollup';
3
4
  export { ClickableTagProps_alias_1 as ClickableTagProps } from '../_tsup-dts-rollup';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tag
3
- } from "../chunk-ULXTQXVY.js";
3
+ } from "../chunk-7BXBIDZB.js";
4
4
  import "../chunk-R4H3352X.js";
5
5
  export {
6
6
  Tag
@@ -23,6 +23,7 @@ export { TabListProps } from './_tsup-dts-rollup';
23
23
  export { TabPanel } from './_tsup-dts-rollup';
24
24
  export { TabPanelProps } from './_tsup-dts-rollup';
25
25
  export { Tag } from './_tsup-dts-rollup';
26
+ export { NonActionablePalette } from './_tsup-dts-rollup';
26
27
  export { TagProps } from './_tsup-dts-rollup';
27
28
  export { ClickableTagProps } from './_tsup-dts-rollup';
28
29
  export { Textarea } from './_tsup-dts-rollup';
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SVZU6LPF.js";
4
4
  import {
5
5
  Tag
6
- } from "./chunk-ULXTQXVY.js";
6
+ } from "./chunk-7BXBIDZB.js";
7
7
  import {
8
8
  Textarea
9
9
  } from "./chunk-5TBINKAO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.4.0-next-6c85a51",
3
+ "version": "0.4.0-next-af3a77f",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -1,22 +1,25 @@
1
1
  import type { HTMLAttributes, PropsWithChildren } from 'react'
2
2
  import { Close } from '@cerberus/icons'
3
- import { type Sentiment } from '@cerberus/panda-preset'
4
3
  import { Show } from './Show'
5
4
  import { css, cx } from '@cerberus/styled-system/css'
6
5
  import { iconButton, tag } from '@cerberus/styled-system/recipes'
6
+ import type { ConditionalValue } from '@cerberus/styled-system/types'
7
7
 
8
8
  /**
9
9
  * This module contains the tag component.
10
10
  * @module
11
11
  */
12
12
 
13
+ export type NonActionablePalette = ConditionalValue<
14
+ 'neutral' | 'info' | 'success' | 'warning' | 'danger'
15
+ >
13
16
  export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
14
- palette?: Sentiment
17
+ palette?: NonActionablePalette
15
18
  shape?: 'rounded' | 'pill'
16
19
  usage?: 'filled' | 'outline'
17
20
  }
18
21
  export interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
19
- palette?: Sentiment
22
+ palette?: NonActionablePalette
20
23
  shape?: 'pill'
21
24
  onClick: () => void
22
25
  usage?: 'filled'
@@ -32,19 +35,13 @@ export interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
32
35
  export function Tag(
33
36
  props: PropsWithChildren<TagProps | ClickableTagProps>,
34
37
  ): JSX.Element {
35
- const {
36
- palette: initPalette,
37
- shape: initShape,
38
- onClick,
39
- usage,
40
- ...nativeProps
41
- } = props
38
+ const { palette, shape: initShape, onClick, usage, ...nativeProps } = props
42
39
  const isClosable = Boolean(onClick)
43
40
  const shape = isClosable ? 'pill' : initShape
44
- const palette = isClosable ? 'action' : initPalette
45
41
  const closableStyles = isClosable
46
42
  ? css({
47
43
  bgColor: 'action.bg.active',
44
+ color: 'action.text.initial',
48
45
  paddingInlineEnd: '0',
49
46
  })
50
47
  : ''
@@ -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 { 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 bgColor: 'action.bg.active',\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 usage: 'filled',\n size: 'sm',\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;AA+C5B,SAwBM,KAxBN;AArBG,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,SAAS;AAAA,IACT,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,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -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 { 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 bgColor: 'action.bg.active',\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 usage: 'filled',\n size: 'sm',\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;AA+C5B,SAwBM,KAxBN;AArBG,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,SAAS;AAAA,IACT,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,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}