@cerberus-design/react 0.5.2-next-c44ca60 → 0.5.2-next-782341c

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.
Files changed (32) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.ts +39 -31
  2. package/build/legacy/{chunk-LQHCCI4H.js → chunk-2ATICEW3.js} +1 -1
  3. package/build/legacy/chunk-2ATICEW3.js.map +1 -0
  4. package/build/{modern/chunk-QILSE3K3.js → legacy/chunk-BJXUBNF2.js} +3 -2
  5. package/build/legacy/chunk-BJXUBNF2.js.map +1 -0
  6. package/build/legacy/{chunk-GQSXLQOD.js → chunk-MFKR532P.js} +1 -1
  7. package/build/legacy/chunk-MFKR532P.js.map +1 -0
  8. package/build/legacy/components/Button.js +1 -1
  9. package/build/legacy/components/IconButton.js +1 -1
  10. package/build/legacy/components/Tag.js +1 -1
  11. package/build/legacy/index.js +3 -3
  12. package/build/modern/_tsup-dts-rollup.d.ts +39 -31
  13. package/build/{legacy/chunk-QILSE3K3.js → modern/chunk-23OSBT4M.js} +3 -2
  14. package/build/modern/chunk-23OSBT4M.js.map +1 -0
  15. package/build/modern/{chunk-LQHCCI4H.js → chunk-2ATICEW3.js} +1 -1
  16. package/build/modern/chunk-2ATICEW3.js.map +1 -0
  17. package/build/modern/{chunk-GQSXLQOD.js → chunk-MFKR532P.js} +1 -1
  18. package/build/modern/chunk-MFKR532P.js.map +1 -0
  19. package/build/modern/components/Button.js +1 -1
  20. package/build/modern/components/IconButton.js +1 -1
  21. package/build/modern/components/Tag.js +1 -1
  22. package/build/modern/index.js +3 -3
  23. package/package.json +2 -2
  24. package/src/components/Button.tsx +3 -6
  25. package/src/components/IconButton.tsx +4 -7
  26. package/src/components/Tag.tsx +20 -17
  27. package/build/legacy/chunk-GQSXLQOD.js.map +0 -1
  28. package/build/legacy/chunk-LQHCCI4H.js.map +0 -1
  29. package/build/legacy/chunk-QILSE3K3.js.map +0 -1
  30. package/build/modern/chunk-GQSXLQOD.js.map +0 -1
  31. package/build/modern/chunk-LQHCCI4H.js.map +0 -1
  32. package/build/modern/chunk-QILSE3K3.js.map +0 -1
@@ -1,15 +1,20 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
+ import { button } from '@cerberus/styled-system/recipes';
2
3
  import { ButtonHTMLAttributes } from 'react';
3
4
  import type { ConditionalValue } from '@cerberus/styled-system/types';
4
5
  import { Context } from 'react';
5
6
  import { ElementType } from 'react';
6
7
  import { HTMLAttributes } from 'react';
8
+ import { iconButton } from '@cerberus/styled-system/recipes';
7
9
  import type { InputHTMLAttributes } from 'react';
8
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
11
  import { MutableRefObject } from 'react';
10
12
  import { PropsWithChildren } from 'react';
11
13
  import { ReactNode } from 'react';
14
+ import { RecipeVariantProps } from '@cerberus/styled-system/css';
15
+ import type { RecipeVariantProps as RecipeVariantProps_2 } from '@cerberus/styled-system/types';
12
16
  import { RefObject } from 'react';
17
+ import { tag } from '@cerberus/styled-system/recipes';
13
18
  import type { TextareaHTMLAttributes } from 'react';
14
19
 
15
20
  /**
@@ -24,20 +29,16 @@ export { Button as Button_alias_1 }
24
29
  * This module contains the Button component.
25
30
  * @module
26
31
  */
27
- declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
28
- palette?: 'action' | 'danger';
29
- usage?: 'filled' | 'outlined' | 'text';
30
- shape?: 'sharp' | 'rounded';
31
- }
32
+ declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & RecipeVariantProps<typeof button>;
32
33
  export { ButtonProps }
33
34
  export { ButtonProps as ButtonProps_alias_1 }
34
35
 
35
- declare interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
36
- palette?: NonActionablePalette;
37
- shape?: 'pill';
36
+ declare type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
37
+ palette?: ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
38
38
  onClick: () => void;
39
- usage?: 'filled';
40
- }
39
+ shape: 'pill';
40
+ usage: 'filled';
41
+ };
41
42
  export { ClickableTagProps }
42
43
  export { ClickableTagProps as ClickableTagProps_alias_1 }
43
44
 
@@ -117,20 +118,24 @@ declare function IconButton(props: IconButtonProps): JSX.Element;
117
118
  export { IconButton }
118
119
  export { IconButton as IconButton_alias_1 }
119
120
 
121
+ declare type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps;
122
+ export { IconButtonProps }
123
+ export { IconButtonProps as IconButtonProps_alias_1 }
124
+
120
125
  /**
121
126
  * This module contains the Icon Button component.
122
127
  * @module
123
128
  */
124
- declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
129
+ declare interface IconButtonRawProps extends ButtonHTMLAttributes<HTMLButtonElement> {
125
130
  ariaLabel: string;
126
- palette?: ButtonProps['palette'];
127
- usage?: ButtonProps['usage'];
128
- shape?: 'circle';
129
- size?: 'sm' | 'lg';
130
131
  tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
131
132
  }
132
- export { IconButtonProps }
133
- export { IconButtonProps as IconButtonProps_alias_1 }
133
+ export { IconButtonRawProps }
134
+ export { IconButtonRawProps as IconButtonRawProps_alias_1 }
135
+
136
+ declare type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>;
137
+ export { IconButtonRecipeProps }
138
+ export { IconButtonRecipeProps as IconButtonRecipeProps_alias_1 }
134
139
 
135
140
  declare function Input(props: InputProps): JSX_2.Element;
136
141
  export { Input }
@@ -263,14 +268,6 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
263
268
  export { NavTriggerRef }
264
269
  export { NavTriggerRef as NavTriggerRef_alias_1 }
265
270
 
266
- /**
267
- * This module contains the tag component.
268
- * @module
269
- */
270
- declare type NonActionablePalette = ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
271
- export { NonActionablePalette }
272
- export { NonActionablePalette as NonActionablePalette_alias_1 }
273
-
274
271
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
275
272
  export { Positions }
276
273
  export { Positions as Positions_alias_1 }
@@ -296,6 +293,12 @@ declare interface ShowProps {
296
293
  export { ShowProps }
297
294
  export { ShowProps as ShowProps_alias_1 }
298
295
 
296
+ declare type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagRecipeProps & {
297
+ onClick?: never;
298
+ };
299
+ export { StaticTagProps }
300
+ export { StaticTagProps as StaticTagProps_alias_1 }
301
+
299
302
  /**
300
303
  * The Tab component provides a tab element to be used in a TabList.
301
304
  * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)
@@ -420,23 +423,28 @@ export { TabsProps as TabsProps_alias_1 }
420
423
 
421
424
  /**
422
425
  * The Tag component is used to display a meta descriptions.
426
+ * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)
423
427
  * @example
424
428
  * ```tsx
425
429
  * <Tag>Tag</Tag>
426
430
  * ```
427
431
  */
428
- declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JSX.Element;
432
+ declare function Tag(props: PropsWithChildren<TagProps>): JSX.Element;
429
433
  export { Tag }
430
434
  export { Tag as Tag_alias_1 }
431
435
 
432
- declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
433
- palette?: NonActionablePalette;
434
- shape?: 'rounded' | 'pill';
435
- usage?: 'filled' | 'outline';
436
- }
436
+ declare type TagProps = StaticTagProps | ClickableTagProps;
437
437
  export { TagProps }
438
438
  export { TagProps as TagProps_alias_1 }
439
439
 
440
+ /**
441
+ * This module contains the tag component.
442
+ * @module
443
+ */
444
+ declare type TagRecipeProps = RecipeVariantProps_2<typeof tag>;
445
+ export { TagRecipeProps }
446
+ export { TagRecipeProps as TagRecipeProps_alias_1 }
447
+
440
448
  /**
441
449
  * A component that allows the user to input large blocks of text.
442
450
  * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
@@ -23,4 +23,4 @@ function Button(props) {
23
23
  export {
24
24
  Button
25
25
  };
26
- //# sourceMappingURL=chunk-LQHCCI4H.js.map
26
+ //# sourceMappingURL=chunk-2ATICEW3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n RecipeVariantProps<typeof button>\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAmC;AAC5C,SAAS,cAAc;AAiBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -8,7 +8,8 @@ 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 { palette, shape: initShape, onClick, usage, ...nativeProps } = props;
11
+ const { shape: initShape, onClick, usage, ...nativeProps } = props;
12
+ const palette = (props == null ? void 0 : props.palette) ?? "neutral";
12
13
  const isClosable = Boolean(onClick);
13
14
  const shape = isClosable ? "pill" : initShape;
14
15
  const closableStyles = isClosable ? css({
@@ -52,4 +53,4 @@ function Tag(props) {
52
53
  export {
53
54
  Tag
54
55
  };
55
- //# sourceMappingURL=chunk-QILSE3K3.js.map
56
+ //# sourceMappingURL=chunk-BJXUBNF2.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 {\n ConditionalValue,\n RecipeVariantProps,\n} from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type TagRecipeProps = RecipeVariantProps<typeof tag>\nexport type StaticTagProps = HTMLAttributes<HTMLSpanElement> &\n TagRecipeProps & {\n onClick?: never\n }\nexport type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {\n palette?: ConditionalValue<\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n >\n onClick: () => void\n shape: 'pill'\n usage: 'filled'\n}\nexport type TagProps = StaticTagProps | ClickableTagProps\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(props: PropsWithChildren<TagProps>): JSX.Element {\n const { shape: initShape, onClick, usage, ...nativeProps } = props\n const palette = props?.palette ?? 'neutral'\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;AAgD5B,SAwBM,KAxBN;AAdG,SAAS,IAAI,OAAiD;AACnE,QAAM,EAAE,OAAO,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AAC7D,QAAM,WAAU,+BAAO,YAAW;AAClC,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":[]}
@@ -26,4 +26,4 @@ function IconButton(props) {
26
26
  export {
27
27
  IconButton
28
28
  };
29
- //# sourceMappingURL=chunk-GQSXLQOD.js.map
29
+ //# sourceMappingURL=chunk-MFKR532P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\n}\nexport type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>\nexport type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAmC;AAC5C,SAAS,kBAAkB;AAsBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button
3
- } from "../chunk-LQHCCI4H.js";
3
+ } from "../chunk-2ATICEW3.js";
4
4
  export {
5
5
  Button
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IconButton
3
- } from "../chunk-GQSXLQOD.js";
3
+ } from "../chunk-MFKR532P.js";
4
4
  export {
5
5
  IconButton
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tag
3
- } from "../chunk-QILSE3K3.js";
3
+ } from "../chunk-BJXUBNF2.js";
4
4
  import "../chunk-4O4QFF4S.js";
5
5
  export {
6
6
  Tag
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YJCWUN33.js";
4
4
  import {
5
5
  Tag
6
- } from "./chunk-QILSE3K3.js";
6
+ } from "./chunk-BJXUBNF2.js";
7
7
  import {
8
8
  Textarea
9
9
  } from "./chunk-5TBINKAO.js";
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-SXXWC6UD.js";
58
58
  import {
59
59
  Button
60
- } from "./chunk-LQHCCI4H.js";
60
+ } from "./chunk-2ATICEW3.js";
61
61
  import {
62
62
  FieldMessage
63
63
  } from "./chunk-YVUZSAJG.js";
@@ -67,7 +67,7 @@ import {
67
67
  } from "./chunk-ZAU4JVLL.js";
68
68
  import {
69
69
  IconButton
70
- } from "./chunk-GQSXLQOD.js";
70
+ } from "./chunk-MFKR532P.js";
71
71
  export {
72
72
  Button,
73
73
  Field,
@@ -1,15 +1,20 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
+ import { button } from '@cerberus/styled-system/recipes';
2
3
  import { ButtonHTMLAttributes } from 'react';
3
4
  import type { ConditionalValue } from '@cerberus/styled-system/types';
4
5
  import { Context } from 'react';
5
6
  import { ElementType } from 'react';
6
7
  import { HTMLAttributes } from 'react';
8
+ import { iconButton } from '@cerberus/styled-system/recipes';
7
9
  import type { InputHTMLAttributes } from 'react';
8
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
11
  import { MutableRefObject } from 'react';
10
12
  import { PropsWithChildren } from 'react';
11
13
  import { ReactNode } from 'react';
14
+ import { RecipeVariantProps } from '@cerberus/styled-system/css';
15
+ import type { RecipeVariantProps as RecipeVariantProps_2 } from '@cerberus/styled-system/types';
12
16
  import { RefObject } from 'react';
17
+ import { tag } from '@cerberus/styled-system/recipes';
13
18
  import type { TextareaHTMLAttributes } from 'react';
14
19
 
15
20
  /**
@@ -24,20 +29,16 @@ export { Button as Button_alias_1 }
24
29
  * This module contains the Button component.
25
30
  * @module
26
31
  */
27
- declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
28
- palette?: 'action' | 'danger';
29
- usage?: 'filled' | 'outlined' | 'text';
30
- shape?: 'sharp' | 'rounded';
31
- }
32
+ declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & RecipeVariantProps<typeof button>;
32
33
  export { ButtonProps }
33
34
  export { ButtonProps as ButtonProps_alias_1 }
34
35
 
35
- declare interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
36
- palette?: NonActionablePalette;
37
- shape?: 'pill';
36
+ declare type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
37
+ palette?: ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
38
38
  onClick: () => void;
39
- usage?: 'filled';
40
- }
39
+ shape: 'pill';
40
+ usage: 'filled';
41
+ };
41
42
  export { ClickableTagProps }
42
43
  export { ClickableTagProps as ClickableTagProps_alias_1 }
43
44
 
@@ -117,20 +118,24 @@ declare function IconButton(props: IconButtonProps): JSX.Element;
117
118
  export { IconButton }
118
119
  export { IconButton as IconButton_alias_1 }
119
120
 
121
+ declare type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps;
122
+ export { IconButtonProps }
123
+ export { IconButtonProps as IconButtonProps_alias_1 }
124
+
120
125
  /**
121
126
  * This module contains the Icon Button component.
122
127
  * @module
123
128
  */
124
- declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
129
+ declare interface IconButtonRawProps extends ButtonHTMLAttributes<HTMLButtonElement> {
125
130
  ariaLabel: string;
126
- palette?: ButtonProps['palette'];
127
- usage?: ButtonProps['usage'];
128
- shape?: 'circle';
129
- size?: 'sm' | 'lg';
130
131
  tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
131
132
  }
132
- export { IconButtonProps }
133
- export { IconButtonProps as IconButtonProps_alias_1 }
133
+ export { IconButtonRawProps }
134
+ export { IconButtonRawProps as IconButtonRawProps_alias_1 }
135
+
136
+ declare type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>;
137
+ export { IconButtonRecipeProps }
138
+ export { IconButtonRecipeProps as IconButtonRecipeProps_alias_1 }
134
139
 
135
140
  declare function Input(props: InputProps): JSX_2.Element;
136
141
  export { Input }
@@ -263,14 +268,6 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
263
268
  export { NavTriggerRef }
264
269
  export { NavTriggerRef as NavTriggerRef_alias_1 }
265
270
 
266
- /**
267
- * This module contains the tag component.
268
- * @module
269
- */
270
- declare type NonActionablePalette = ConditionalValue<'neutral' | 'info' | 'success' | 'warning' | 'danger'>;
271
- export { NonActionablePalette }
272
- export { NonActionablePalette as NonActionablePalette_alias_1 }
273
-
274
271
  declare type Positions = 'top' | 'right' | 'bottom' | 'left';
275
272
  export { Positions }
276
273
  export { Positions as Positions_alias_1 }
@@ -296,6 +293,12 @@ declare interface ShowProps {
296
293
  export { ShowProps }
297
294
  export { ShowProps as ShowProps_alias_1 }
298
295
 
296
+ declare type StaticTagProps = HTMLAttributes<HTMLSpanElement> & TagRecipeProps & {
297
+ onClick?: never;
298
+ };
299
+ export { StaticTagProps }
300
+ export { StaticTagProps as StaticTagProps_alias_1 }
301
+
299
302
  /**
300
303
  * The Tab component provides a tab element to be used in a TabList.
301
304
  * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)
@@ -420,23 +423,28 @@ export { TabsProps as TabsProps_alias_1 }
420
423
 
421
424
  /**
422
425
  * The Tag component is used to display a meta descriptions.
426
+ * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)
423
427
  * @example
424
428
  * ```tsx
425
429
  * <Tag>Tag</Tag>
426
430
  * ```
427
431
  */
428
- declare function Tag(props: PropsWithChildren<TagProps | ClickableTagProps>): JSX.Element;
432
+ declare function Tag(props: PropsWithChildren<TagProps>): JSX.Element;
429
433
  export { Tag }
430
434
  export { Tag as Tag_alias_1 }
431
435
 
432
- declare interface TagProps extends HTMLAttributes<HTMLSpanElement> {
433
- palette?: NonActionablePalette;
434
- shape?: 'rounded' | 'pill';
435
- usage?: 'filled' | 'outline';
436
- }
436
+ declare type TagProps = StaticTagProps | ClickableTagProps;
437
437
  export { TagProps }
438
438
  export { TagProps as TagProps_alias_1 }
439
439
 
440
+ /**
441
+ * This module contains the tag component.
442
+ * @module
443
+ */
444
+ declare type TagRecipeProps = RecipeVariantProps_2<typeof tag>;
445
+ export { TagRecipeProps }
446
+ export { TagRecipeProps as TagRecipeProps_alias_1 }
447
+
440
448
  /**
441
449
  * A component that allows the user to input large blocks of text.
442
450
  * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
@@ -8,7 +8,8 @@ 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 { palette, shape: initShape, onClick, usage, ...nativeProps } = props;
11
+ const { shape: initShape, onClick, usage, ...nativeProps } = props;
12
+ const palette = props?.palette ?? "neutral";
12
13
  const isClosable = Boolean(onClick);
13
14
  const shape = isClosable ? "pill" : initShape;
14
15
  const closableStyles = isClosable ? css({
@@ -52,4 +53,4 @@ function Tag(props) {
52
53
  export {
53
54
  Tag
54
55
  };
55
- //# sourceMappingURL=chunk-QILSE3K3.js.map
56
+ //# sourceMappingURL=chunk-23OSBT4M.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 {\n ConditionalValue,\n RecipeVariantProps,\n} from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type TagRecipeProps = RecipeVariantProps<typeof tag>\nexport type StaticTagProps = HTMLAttributes<HTMLSpanElement> &\n TagRecipeProps & {\n onClick?: never\n }\nexport type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {\n palette?: ConditionalValue<\n 'neutral' | 'info' | 'success' | 'warning' | 'danger'\n >\n onClick: () => void\n shape: 'pill'\n usage: 'filled'\n}\nexport type TagProps = StaticTagProps | ClickableTagProps\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(props: PropsWithChildren<TagProps>): JSX.Element {\n const { shape: initShape, onClick, usage, ...nativeProps } = props\n const palette = props?.palette ?? 'neutral'\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;AAgD5B,SAwBM,KAxBN;AAdG,SAAS,IAAI,OAAiD;AACnE,QAAM,EAAE,OAAO,WAAW,SAAS,OAAO,GAAG,YAAY,IAAI;AAC7D,QAAM,UAAU,OAAO,WAAW;AAClC,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":[]}
@@ -23,4 +23,4 @@ function Button(props) {
23
23
  export {
24
24
  Button
25
25
  };
26
- //# sourceMappingURL=chunk-LQHCCI4H.js.map
26
+ //# sourceMappingURL=chunk-2ATICEW3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n RecipeVariantProps<typeof button>\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAmC;AAC5C,SAAS,cAAc;AAiBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -26,4 +26,4 @@ function IconButton(props) {
26
26
  export {
27
27
  IconButton
28
28
  };
29
- //# sourceMappingURL=chunk-GQSXLQOD.js.map
29
+ //# sourceMappingURL=chunk-MFKR532P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonRawProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\n}\nexport type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>\nexport type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAmC;AAC5C,SAAS,kBAAkB;AAsBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Button
3
- } from "../chunk-LQHCCI4H.js";
3
+ } from "../chunk-2ATICEW3.js";
4
4
  export {
5
5
  Button
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IconButton
3
- } from "../chunk-GQSXLQOD.js";
3
+ } from "../chunk-MFKR532P.js";
4
4
  export {
5
5
  IconButton
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Tag
3
- } from "../chunk-QILSE3K3.js";
3
+ } from "../chunk-23OSBT4M.js";
4
4
  import "../chunk-4O4QFF4S.js";
5
5
  export {
6
6
  Tag
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YJCWUN33.js";
4
4
  import {
5
5
  Tag
6
- } from "./chunk-QILSE3K3.js";
6
+ } from "./chunk-23OSBT4M.js";
7
7
  import {
8
8
  Textarea
9
9
  } from "./chunk-5TBINKAO.js";
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-SXXWC6UD.js";
58
58
  import {
59
59
  Button
60
- } from "./chunk-LQHCCI4H.js";
60
+ } from "./chunk-2ATICEW3.js";
61
61
  import {
62
62
  FieldMessage
63
63
  } from "./chunk-YVUZSAJG.js";
@@ -67,7 +67,7 @@ import {
67
67
  } from "./chunk-ZAU4JVLL.js";
68
68
  import {
69
69
  IconButton
70
- } from "./chunk-GQSXLQOD.js";
70
+ } from "./chunk-MFKR532P.js";
71
71
  export {
72
72
  Button,
73
73
  Field,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerberus-design/react",
3
- "version": "0.5.2-next-c44ca60",
3
+ "version": "0.5.2-next-782341c",
4
4
  "description": "The Cerberus Design React component library.",
5
5
  "browserslist": "> 0.25%, not dead",
6
6
  "sideEffects": false,
@@ -22,7 +22,7 @@
22
22
  "react-dom": "^18",
23
23
  "tsup": "^8.1.0",
24
24
  "@cerberus-design/configs": "0.0.0",
25
- "@cerberus-design/styled-system": "0.5.2-next-c44ca60"
25
+ "@cerberus-design/styled-system": "0.5.2-next-782341c"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  import type { ButtonHTMLAttributes } from 'react'
2
- import { cx } from '@cerberus/styled-system/css'
2
+ import { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'
3
3
  import { button } from '@cerberus/styled-system/recipes'
4
4
 
5
5
  /**
@@ -7,11 +7,8 @@ import { button } from '@cerberus/styled-system/recipes'
7
7
  * @module
8
8
  */
9
9
 
10
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
11
- palette?: 'action' | 'danger'
12
- usage?: 'filled' | 'outlined' | 'text'
13
- shape?: 'sharp' | 'rounded'
14
- }
10
+ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &
11
+ RecipeVariantProps<typeof button>
15
12
 
16
13
  /**
17
14
  * A component that allows the user to perform actions
@@ -1,22 +1,19 @@
1
1
  import type { ButtonHTMLAttributes } from 'react'
2
- import { cx } from '@cerberus/styled-system/css'
2
+ import { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'
3
3
  import { iconButton } from '@cerberus/styled-system/recipes'
4
- import type { ButtonProps } from './Button'
5
4
 
6
5
  /**
7
6
  * This module contains the Icon Button component.
8
7
  * @module
9
8
  */
10
9
 
11
- export interface IconButtonProps
10
+ export interface IconButtonRawProps
12
11
  extends ButtonHTMLAttributes<HTMLButtonElement> {
13
12
  ariaLabel: string
14
- palette?: ButtonProps['palette']
15
- usage?: ButtonProps['usage']
16
- shape?: 'circle'
17
- size?: 'sm' | 'lg'
18
13
  tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'
19
14
  }
15
+ export type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>
16
+ export type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps
20
17
 
21
18
  /**
22
19
  * A component that allows the user to perform actions using an icon
@@ -3,39 +3,42 @@ import { Close } from '@cerberus/icons'
3
3
  import { Show } from './Show'
4
4
  import { css, cx } from '@cerberus/styled-system/css'
5
5
  import { iconButton, tag } from '@cerberus/styled-system/recipes'
6
- import type { ConditionalValue } from '@cerberus/styled-system/types'
6
+ import type {
7
+ ConditionalValue,
8
+ RecipeVariantProps,
9
+ } from '@cerberus/styled-system/types'
7
10
 
8
11
  /**
9
12
  * This module contains the tag component.
10
13
  * @module
11
14
  */
12
15
 
13
- export type NonActionablePalette = ConditionalValue<
14
- 'neutral' | 'info' | 'success' | 'warning' | 'danger'
15
- >
16
- export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
17
- palette?: NonActionablePalette
18
- shape?: 'rounded' | 'pill'
19
- usage?: 'filled' | 'outline'
20
- }
21
- export interface ClickableTagProps extends HTMLAttributes<HTMLSpanElement> {
22
- palette?: NonActionablePalette
23
- shape?: 'pill'
16
+ export type TagRecipeProps = RecipeVariantProps<typeof tag>
17
+ export type StaticTagProps = HTMLAttributes<HTMLSpanElement> &
18
+ TagRecipeProps & {
19
+ onClick?: never
20
+ }
21
+ export type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
22
+ palette?: ConditionalValue<
23
+ 'neutral' | 'info' | 'success' | 'warning' | 'danger'
24
+ >
24
25
  onClick: () => void
25
- usage?: 'filled'
26
+ shape: 'pill'
27
+ usage: 'filled'
26
28
  }
29
+ export type TagProps = StaticTagProps | ClickableTagProps
27
30
 
28
31
  /**
29
32
  * The Tag component is used to display a meta descriptions.
33
+ * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)
30
34
  * @example
31
35
  * ```tsx
32
36
  * <Tag>Tag</Tag>
33
37
  * ```
34
38
  */
35
- export function Tag(
36
- props: PropsWithChildren<TagProps | ClickableTagProps>,
37
- ): JSX.Element {
38
- const { palette, shape: initShape, onClick, usage, ...nativeProps } = props
39
+ export function Tag(props: PropsWithChildren<TagProps>): JSX.Element {
40
+ const { shape: initShape, onClick, usage, ...nativeProps } = props
41
+ const palette = props?.palette ?? 'neutral'
39
42
  const isClosable = Boolean(onClick)
40
43
  const shape = isClosable ? 'pill' : initShape
41
44
  const closableStyles = isClosable
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: ButtonProps['usage']\n shape?: 'circle'\n size?: 'sm' | 'lg'\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAyBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outlined' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;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 { 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 +0,0 @@
1
- {"version":3,"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { iconButton } from '@cerberus/styled-system/recipes'\nimport type { ButtonProps } from './Button'\n\n/**\n * This module contains the Icon Button component.\n * @module\n */\n\nexport interface IconButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n ariaLabel: string\n palette?: ButtonProps['palette']\n usage?: ButtonProps['usage']\n shape?: 'circle'\n size?: 'sm' | 'lg'\n tooltipPosition?: 'top' | 'bottom' | 'left' | 'right'\n}\n\n/**\n * A component that allows the user to perform actions using an icon\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx\n */\nexport function IconButton(props: IconButtonProps): JSX.Element {\n const { ariaLabel, palette, usage, size, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n data-tooltip\n data-position={props.tooltipPosition ?? 'top'}\n aria-label={ariaLabel ?? 'Icon Button'}\n className={cx(\n nativeProps.className,\n iconButton({\n palette,\n usage,\n size,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAyBvB;AAHG,SAAS,WAAW,OAAqC;AAC9D,QAAM,EAAE,WAAW,SAAS,OAAO,MAAM,GAAG,YAAY,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,gBAAY;AAAA,MACZ,iBAAe,MAAM,mBAAmB;AAAA,MACxC,cAAY,aAAa;AAAA,MACzB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { button } from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n palette?: 'action' | 'danger'\n usage?: 'filled' | 'outlined' | 'text'\n shape?: 'sharp' | 'rounded'\n}\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";AACA,SAAS,UAAU;AACnB,SAAS,cAAc;AAoBnB;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;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 { 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":[]}