@stack-spot/citric-react 0.34.0 → 0.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAKpD,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAA;AAExE;;;;;GAKG;AACH,eAAO,MAAM,IAAI,8FAAuG,SAAS,4CAe/H,CAAA"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAKpD,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAA;AAExE;;;;;GAKG;AACH,eAAO,MAAM,IAAI,8FACoF,SAAS,4CAgB7G,CAAA"}
@@ -9,7 +9,7 @@ import { asCitricProps, CitricComponent } from './CitricComponent.js';
9
9
  * Whenever a link is clicked, the function `onClickLink` of the nearest CitricController is called with the event and the value of the
10
10
  * prop `metadata`.
11
11
  */
12
- export const Link = withRef(({ appearance, color, style, className, children, onClick, metadata, underline, ...props }) => {
12
+ export const Link = withRef(({ appearance, color, style, className, children, onClick, metadata, underline = true, ...props }) => {
13
13
  const citric = useCitricController();
14
14
  const linkProps = {
15
15
  component: 'link',
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AA2BlE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa,EAAE,EAAE;IACnI,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAA;IACpC,MAAM,SAAS,GAAG;QAChB,SAAS,EAAE,MAAM;QACjB,KAAK,EAAE,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC;QACtF,SAAS,EAAE,mBAAmB,CAAC,SAAS,EAAE,UAAU,CAAC;QACrD,OAAO,EAAE,CAAC,CAAsC,EAAE,EAAE;YAClD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAA;YACZ,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,IAAI,KAAK,CAAC,CAAA;QAC7C,CAAC;QACD,GAAG,KAAK;KACA,CAAA;IACV,OAAO,MAAM,EAA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AG,KAAK;KACA,CAAA;IACV,OAAO,MAAM,EAAE,UAAU;QACvB,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAC,KAAC,eAAe,IAAC,GAAG,EAAC,GAAG,KAAK,SAAS,YAAG,QAAQ,GAAmB,CAAA;AAC1E,CAAC,CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/citric-react",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "author": "StackSpot",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -35,19 +35,21 @@ export type LinkProps = React.JSX.IntrinsicElements['a'] & BaseLinkProps
35
35
  * Whenever a link is clicked, the function `onClickLink` of the nearest CitricController is called with the event and the value of the
36
36
  * prop `metadata`.
37
37
  */
38
- export const Link = withRef(({ appearance, color, style, className, children, onClick, metadata, underline, ...props }: LinkProps) => {
39
- const citric = useCitricController()
40
- const linkProps = {
41
- component: 'link',
42
- style: applyColor({ ...style, textDecoration: underline ? undefined : 'none' }, color),
43
- className: applyTextAppearance(className, appearance),
44
- onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {
45
- onClick?.(e)
46
- citric?.onClickLink?.(e, metadata ?? false)
47
- },
48
- ...props,
49
- } as const
50
- return citric?.renderLink
51
- ? citric.renderLink(asCitricProps({ ...linkProps, children }))
52
- : <CitricComponent tag="a" {...linkProps}>{children}</CitricComponent>
53
- })
38
+ export const Link = withRef(
39
+ ({ appearance, color, style, className, children, onClick, metadata, underline = true, ...props }: LinkProps) => {
40
+ const citric = useCitricController()
41
+ const linkProps = {
42
+ component: 'link',
43
+ style: applyColor({ ...style, textDecoration: underline ? undefined : 'none' }, color),
44
+ className: applyTextAppearance(className, appearance),
45
+ onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {
46
+ onClick?.(e)
47
+ citric?.onClickLink?.(e, metadata ?? false)
48
+ },
49
+ ...props,
50
+ } as const
51
+ return citric?.renderLink
52
+ ? citric.renderLink(asCitricProps({ ...linkProps, children }))
53
+ : <CitricComponent tag="a" {...linkProps}>{children}</CitricComponent>
54
+ },
55
+ )