@kcascend/liquid-ui 0.0.13 → 0.0.15

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.
@@ -18,6 +18,7 @@ export declare const icons: {
18
18
  error: import("react/jsx-runtime").JSX.Element;
19
19
  warning: import("react/jsx-runtime").JSX.Element;
20
20
  add: import("react/jsx-runtime").JSX.Element;
21
+ launch: import("react/jsx-runtime").JSX.Element;
21
22
  };
22
23
  export type IconKey = keyof typeof icons;
23
24
  //# sourceMappingURL=icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CA6PjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAgRjB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC"}
@@ -19,4 +19,5 @@ export const icons = {
19
19
  error: (_jsxs("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("circle", { cx: "8", cy: "8", r: "7", fill: "currentColor" }), _jsx("rect", { x: "7.25", y: "4", width: "1.5", height: "6", rx: "0.75", fill: "#ffffff" }), _jsx("circle", { cx: "8", cy: "12", r: "1", fill: "#ffffff" })] })),
20
20
  warning: (_jsxs("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M8 1.5L15 13.5H1L8 1.5Z", fill: "currentColor" }), _jsx("rect", { x: "7.25", y: "5", width: "1.5", height: "4.75", rx: "0.75", fill: "#ffffff" }), _jsx("circle", { cx: "8", cy: "11.5", r: "1", fill: "#ffffff" })] })),
21
21
  add: (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19", stroke: "currentColor", strokeWidth: "2" }), _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12", stroke: "currentColor", strokeWidth: "2" })] })),
22
+ launch: (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M10 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4", stroke: "currentColor", strokeWidth: "2", fill: "none" }), _jsx("path", { d: "M14 4h6v6", stroke: "currentColor", strokeWidth: "2", fill: "none" }), _jsx("line", { x1: "10", y1: "14", x2: "20", y2: "4", stroke: "currentColor", strokeWidth: "2" })] })),
22
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,SAAS,EACV,MAAM,aAAa,CAAC;AAMrB,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CA2EpC"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,SAAS,EACV,MAAM,aAAa,CAAC;AAMrB,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAgFpC"}
@@ -4,20 +4,23 @@ function getClassName(className) {
4
4
  return ['liquid-link', className].filter(Boolean).join(' ');
5
5
  }
6
6
  export function Link(props) {
7
- const appearance = props.appearance ?? 'standalone';
7
+ // Defaults to 'inline' (no icon) — 'standalone' (icon-eligible CTA) must be opted into explicitly.
8
+ const appearance = props.appearance ?? 'inline';
8
9
  const children = props.children;
9
10
  const className = props.className;
11
+ const external = props.external ?? false;
10
12
  const showTrailingIcon = props.showTrailingIcon ?? true;
11
13
  const size = props.size ?? 'md';
12
14
  const state = props.state;
13
15
  const style = props.style;
14
16
  const isStandalone = appearance === 'standalone';
15
17
  const showIcon = isStandalone && showTrailingIcon;
18
+ const iconName = external ? 'launch' : 'arrow_forward';
16
19
  const iconSize = size === 'lg' ? 20 : 16;
17
20
  if ('href' in props && props.href) {
18
- const { appearance: _appearance, children: _children, className: _className, href, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...anchorProps } = props;
19
- return (_jsxs("a", { ...anchorProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, href: href, style: style, children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "arrow_forward", size: iconSize }) })) : null] }));
21
+ const { appearance: _appearance, children: _children, className: _className, external: _external, href, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...anchorProps } = props;
22
+ return (_jsxs("a", { ...anchorProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, href: href, style: style, children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: iconName, size: iconSize }) })) : null] }));
20
23
  }
21
- const { appearance: _appearance, children: _children, className: _className, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...buttonProps } = props;
22
- return (_jsxs("button", { ...buttonProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, style: style, type: buttonProps.type ?? 'button', children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: "arrow_forward", size: iconSize }) })) : null] }));
24
+ const { appearance: _appearance, children: _children, className: _className, external: _external, showTrailingIcon: _showTrailingIcon, size: _size, state: _state, style: _style, ...buttonProps } = props;
25
+ return (_jsxs("button", { ...buttonProps, className: getClassName(className), "data-appearance": appearance, "data-size": size, "data-state": state, style: style, type: buttonProps.type ?? 'button', children: [_jsx("span", { className: "liquid-link__label", children: children }), showIcon ? (_jsx("span", { "aria-hidden": "true", className: "liquid-link__icon", children: _jsx(Icon, { name: iconName, size: iconSize }) })) : null] }));
23
26
  }