@kaizen/components 1.72.0 → 1.73.0

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.
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var tslib = require('tslib');
4
+ var React = require('react');
5
+ var reactAriaComponents = require('react-aria-components');
6
+ var mergeClassNames = require('../utils/mergeClassNames.cjs');
7
+ var LinkContent = require('./subcomponents/LinkContent.cjs');
8
+ var Link_module = require('./Link.module.css.cjs');
9
+ function _interopDefault(e) {
10
+ return e && e.__esModule ? e : {
11
+ default: e
12
+ };
13
+ }
14
+ var React__default = /*#__PURE__*/_interopDefault(React);
15
+ var Link = React.forwardRef(function (_a, ref) {
16
+ var children = _a.children,
17
+ _b = _a.variant,
18
+ variant = _b === undefined ? 'primary' : _b,
19
+ _c = _a.size,
20
+ size = _c === undefined ? 'body' : _c,
21
+ icon = _a.icon,
22
+ _d = _a.iconPosition,
23
+ iconPosition = _d === undefined ? 'end' : _d,
24
+ _e = _a.isInline,
25
+ isInline = _e === undefined ? false : _e,
26
+ isDisabled = _a.isDisabled,
27
+ className = _a.className,
28
+ _f = _a.isUnderlined,
29
+ isUnderlined = _f === undefined ? true : _f,
30
+ otherProps = tslib.__rest(_a, ["children", "variant", "size", "icon", "iconPosition", "isInline", "isDisabled", "className", "isUnderlined"]);
31
+ var childIsFunction = typeof children === 'function';
32
+ return React__default.default.createElement(reactAriaComponents.Link, tslib.__assign({
33
+ ref: ref,
34
+ className: mergeClassNames.mergeClassNames(Link_module.link, isDisabled && Link_module.isDisabled, isInline ? Link_module.isInline : Link_module[size], Link_module[variant], className),
35
+ isDisabled: isDisabled
36
+ }, otherProps), function (racStateProps) {
37
+ return React__default.default.createElement(LinkContent.LinkContent, {
38
+ icon: icon,
39
+ iconPosition: iconPosition,
40
+ isUnderlined: isUnderlined
41
+ }, childIsFunction ? children(racStateProps) : children);
42
+ });
43
+ });
44
+ Link.displayName = 'Link';
45
+ exports.Link = Link;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var styles = {
4
+ "link": "Link-module_link__8oxip",
5
+ "isUnderlined": "Link-module_isUnderlined__qvbtS",
6
+ "icon": "Link-module_icon__CXh2J",
7
+ "iconStart": "Link-module_iconStart__ZysGR",
8
+ "iconEnd": "Link-module_iconEnd__-DTiD",
9
+ "primary": "Link-module_primary__bmhX0",
10
+ "secondary": "Link-module_secondary__pyYIV",
11
+ "isInline": "Link-module_isInline__sznAm",
12
+ "extra-small": "Link-module_extra-small__nScM0",
13
+ "body": "Link-module_body__H4Jgj",
14
+ "intro-lede": "Link-module_intro-lede__38Y6J",
15
+ "small": "Link-module_small__4kJcR",
16
+ "white": "Link-module_white__qQr6q",
17
+ "isDisabled": "Link-module_isDisabled__gvLNv",
18
+ "reversed": "Link-module_reversed__IqX8B"
19
+ };
20
+ module.exports = styles;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var mergeClassNames = require('../../utils/mergeClassNames.cjs');
5
+ var Link_module = require('../Link.module.css.cjs');
6
+ function _interopDefault(e) {
7
+ return e && e.__esModule ? e : {
8
+ default: e
9
+ };
10
+ }
11
+ var React__default = /*#__PURE__*/_interopDefault(React);
12
+ var LinkIcon = function (_a) {
13
+ var icon = _a.icon;
14
+ return React__default.default.createElement("span", {
15
+ className: Link_module.icon
16
+ }, icon);
17
+ };
18
+ var LinkContent = function (_a) {
19
+ var children = _a.children,
20
+ icon = _a.icon,
21
+ iconPosition = _a.iconPosition,
22
+ isUnderlined = _a.isUnderlined;
23
+ var iconPositionStyling = iconPosition === 'start' ? Link_module.iconStart : Link_module.iconEnd;
24
+ return React__default.default.createElement("span", {
25
+ className: mergeClassNames.mergeClassNames(Link_module.linkContent, isUnderlined && Link_module.isUnderlined)
26
+ }, icon && iconPosition === 'start' && React__default.default.createElement(LinkIcon, {
27
+ icon: icon
28
+ }), React__default.default.createElement("span", {
29
+ className: mergeClassNames.mergeClassNames(icon && iconPositionStyling)
30
+ }, children), icon && iconPosition === 'end' && React__default.default.createElement(LinkIcon, {
31
+ icon: icon
32
+ }));
33
+ };
34
+ exports.LinkContent = LinkContent;
@@ -318,6 +318,7 @@ var InputSearch = require('./Input/InputSearch/InputSearch.cjs');
318
318
  var KaizenProvider = require('./KaizenProvider/KaizenProvider.cjs');
319
319
  var Label = require('./Label/Label.cjs');
320
320
  var LabelledMessage = require('./LabelledMessage/LabelledMessage.cjs');
321
+ var Link = require('./Link/Link.cjs');
321
322
  var LikertScaleLegacy = require('./LikertScaleLegacy/LikertScaleLegacy.cjs');
322
323
  var LinkButton = require('./LinkButton/LinkButton.cjs');
323
324
  var LoadingGraphic = require('./Loading/LoadingGraphic/LoadingGraphic.cjs');
@@ -941,6 +942,7 @@ exports.InputSearch = InputSearch.InputSearch;
941
942
  exports.KaizenProvider = KaizenProvider.KaizenProvider;
942
943
  exports.Label = Label.Label;
943
944
  exports.LabelledMessage = LabelledMessage.LabelledMessage;
945
+ exports.Link = Link.Link;
944
946
  exports.LikertScaleLegacy = LikertScaleLegacy.LikertScaleLegacy;
945
947
  exports.LinkButton = LinkButton.LinkButton;
946
948
  exports.LoadingGraphic = LoadingGraphic.LoadingGraphic;
@@ -318,6 +318,7 @@ var InputSearch = require('./Input/InputSearch/InputSearch.cjs');
318
318
  var KaizenProvider = require('./KaizenProvider/KaizenProvider.cjs');
319
319
  var Label = require('./Label/Label.cjs');
320
320
  var LabelledMessage = require('./LabelledMessage/LabelledMessage.cjs');
321
+ var Link = require('./Link/Link.cjs');
321
322
  var LikertScaleLegacy = require('./LikertScaleLegacy/LikertScaleLegacy.cjs');
322
323
  var LinkButton = require('./LinkButton/LinkButton.cjs');
323
324
  var LoadingGraphic = require('./Loading/LoadingGraphic/LoadingGraphic.cjs');
@@ -941,6 +942,7 @@ exports.InputSearch = InputSearch.InputSearch;
941
942
  exports.KaizenProvider = KaizenProvider.KaizenProvider;
942
943
  exports.Label = Label.Label;
943
944
  exports.LabelledMessage = LabelledMessage.LabelledMessage;
945
+ exports.Link = Link.Link;
944
946
  exports.LikertScaleLegacy = LikertScaleLegacy.LikertScaleLegacy;
945
947
  exports.LinkButton = LinkButton.LinkButton;
946
948
  exports.LoadingGraphic = LoadingGraphic.LoadingGraphic;
@@ -0,0 +1,40 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React, { forwardRef } from 'react';
3
+ import { Link as Link$1 } from 'react-aria-components';
4
+ import { mergeClassNames } from '../utils/mergeClassNames.mjs';
5
+ import { LinkContent } from './subcomponents/LinkContent.mjs';
6
+ import styles from './Link.module.css.mjs';
7
+ const Link = /*#__PURE__*/function () {
8
+ const Link = /*#__PURE__*/forwardRef(function (_a, ref) {
9
+ var children = _a.children,
10
+ _b = _a.variant,
11
+ variant = _b === undefined ? 'primary' : _b,
12
+ _c = _a.size,
13
+ size = _c === undefined ? 'body' : _c,
14
+ icon = _a.icon,
15
+ _d = _a.iconPosition,
16
+ iconPosition = _d === undefined ? 'end' : _d,
17
+ _e = _a.isInline,
18
+ isInline = _e === undefined ? false : _e,
19
+ isDisabled = _a.isDisabled,
20
+ className = _a.className,
21
+ _f = _a.isUnderlined,
22
+ isUnderlined = _f === undefined ? true : _f,
23
+ otherProps = __rest(_a, ["children", "variant", "size", "icon", "iconPosition", "isInline", "isDisabled", "className", "isUnderlined"]);
24
+ var childIsFunction = typeof children === 'function';
25
+ return /*#__PURE__*/React.createElement(Link$1, __assign({
26
+ ref: ref,
27
+ className: mergeClassNames(styles.link, isDisabled && styles.isDisabled, isInline ? styles.isInline : styles[size], styles[variant], className),
28
+ isDisabled: isDisabled
29
+ }, otherProps), function (racStateProps) {
30
+ return /*#__PURE__*/React.createElement(LinkContent, {
31
+ icon: icon,
32
+ iconPosition: iconPosition,
33
+ isUnderlined: isUnderlined
34
+ }, childIsFunction ? children(racStateProps) : children);
35
+ });
36
+ });
37
+ Link.displayName = 'Link';
38
+ return Link;
39
+ }();
40
+ export { Link };
@@ -0,0 +1,18 @@
1
+ var styles = {
2
+ "link": "Link-module_link__8oxip",
3
+ "isUnderlined": "Link-module_isUnderlined__qvbtS",
4
+ "icon": "Link-module_icon__CXh2J",
5
+ "iconStart": "Link-module_iconStart__ZysGR",
6
+ "iconEnd": "Link-module_iconEnd__-DTiD",
7
+ "primary": "Link-module_primary__bmhX0",
8
+ "secondary": "Link-module_secondary__pyYIV",
9
+ "isInline": "Link-module_isInline__sznAm",
10
+ "extra-small": "Link-module_extra-small__nScM0",
11
+ "body": "Link-module_body__H4Jgj",
12
+ "intro-lede": "Link-module_intro-lede__38Y6J",
13
+ "small": "Link-module_small__4kJcR",
14
+ "white": "Link-module_white__qQr6q",
15
+ "isDisabled": "Link-module_isDisabled__gvLNv",
16
+ "reversed": "Link-module_reversed__IqX8B"
17
+ };
18
+ export { styles as default };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { mergeClassNames } from '../../utils/mergeClassNames.mjs';
3
+ import styles from '../Link.module.css.mjs';
4
+ var LinkIcon = function (_a) {
5
+ var icon = _a.icon;
6
+ return /*#__PURE__*/React.createElement("span", {
7
+ className: styles.icon
8
+ }, icon);
9
+ };
10
+ var LinkContent = function (_a) {
11
+ var children = _a.children,
12
+ icon = _a.icon,
13
+ iconPosition = _a.iconPosition,
14
+ isUnderlined = _a.isUnderlined;
15
+ var iconPositionStyling = iconPosition === 'start' ? styles.iconStart : styles.iconEnd;
16
+ return /*#__PURE__*/React.createElement("span", {
17
+ className: mergeClassNames(styles.linkContent, isUnderlined && styles.isUnderlined)
18
+ }, icon && iconPosition === 'start' && /*#__PURE__*/React.createElement(LinkIcon, {
19
+ icon: icon
20
+ }), /*#__PURE__*/React.createElement("span", {
21
+ className: mergeClassNames(icon && iconPositionStyling)
22
+ }, children), icon && iconPosition === 'end' && /*#__PURE__*/React.createElement(LinkIcon, {
23
+ icon: icon
24
+ }));
25
+ };
26
+ export { LinkContent };
@@ -316,6 +316,7 @@ export { InputSearch } from './Input/InputSearch/InputSearch.mjs';
316
316
  export { KaizenProvider } from './KaizenProvider/KaizenProvider.mjs';
317
317
  export { Label } from './Label/Label.mjs';
318
318
  export { LabelledMessage } from './LabelledMessage/LabelledMessage.mjs';
319
+ export { Link } from './Link/Link.mjs';
319
320
  export { LikertScaleLegacy } from './LikertScaleLegacy/LikertScaleLegacy.mjs';
320
321
  export { LinkButton } from './LinkButton/LinkButton.mjs';
321
322
  export { LoadingGraphic } from './Loading/LoadingGraphic/LoadingGraphic.mjs';
@@ -316,6 +316,7 @@ export { InputSearch } from './Input/InputSearch/InputSearch.mjs';
316
316
  export { KaizenProvider } from './KaizenProvider/KaizenProvider.mjs';
317
317
  export { Label } from './Label/Label.mjs';
318
318
  export { LabelledMessage } from './LabelledMessage/LabelledMessage.mjs';
319
+ export { Link } from './Link/Link.mjs';
319
320
  export { LikertScaleLegacy } from './LikertScaleLegacy/LikertScaleLegacy.mjs';
320
321
  export { LinkButton } from './LinkButton/LinkButton.mjs';
321
322
  export { LoadingGraphic } from './Loading/LoadingGraphic/LoadingGraphic.mjs';