@activecollab/components 2.0.300 → 2.0.301
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.
- package/dist/cjs/components/Input/InputAdornment.js +1 -1
- package/dist/cjs/components/Input/InputAdornment.js.map +1 -1
- package/dist/cjs/components/Links/Link.js +12 -4
- package/dist/cjs/components/Links/Link.js.map +1 -1
- package/dist/esm/components/Input/InputAdornment.js +1 -1
- package/dist/esm/components/Input/InputAdornment.js.map +1 -1
- package/dist/esm/components/Links/Link.d.ts +2 -0
- package/dist/esm/components/Links/Link.d.ts.map +1 -1
- package/dist/esm/components/Links/Link.js +12 -5
- package/dist/esm/components/Links/Link.js.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ var InputAdornmentBase = _styledComponents.default.div.withConfig({
|
|
|
20
20
|
"marginRight": "0.25rem",
|
|
21
21
|
"display": "flex",
|
|
22
22
|
"alignItems": "center",
|
|
23
|
-
"gap": "0.
|
|
23
|
+
"gap": "0.25rem"
|
|
24
24
|
}, function (props) {
|
|
25
25
|
return props.$disablePointerEvents && (0, _styledComponents.css)(["", ""], {
|
|
26
26
|
"pointerEvents": "none"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputAdornment.js","names":["_react","_interopRequireDefault","require","_styledComponents","_interopRequireWildcard","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","InputAdornmentBase","styled","div","withConfig","displayName","componentId","props","$disablePointerEvents","css","InputAdornment","exports","React","forwardRef","_ref","ref","children","as","disablePointerEvents","rest","Component","createElement"],"sources":["../../../../src/components/Input/InputAdornment.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\ninterface BaseInputAdornmentProps {\n disablePointerEvents?: boolean;\n}\n\nconst InputAdornmentBase = styled.div<{ $disablePointerEvents?: boolean }>`\n ${tw`tw-flex tw-items-center tw-mx-1 tw-gap-
|
|
1
|
+
{"version":3,"file":"InputAdornment.js","names":["_react","_interopRequireDefault","require","_styledComponents","_interopRequireWildcard","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","InputAdornmentBase","styled","div","withConfig","displayName","componentId","props","$disablePointerEvents","css","InputAdornment","exports","React","forwardRef","_ref","ref","children","as","disablePointerEvents","rest","Component","createElement"],"sources":["../../../../src/components/Input/InputAdornment.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\ninterface BaseInputAdornmentProps {\n disablePointerEvents?: boolean;\n}\n\nconst InputAdornmentBase = styled.div<{ $disablePointerEvents?: boolean }>`\n ${tw`tw-flex tw-items-center tw-mx-1 tw-gap-1`}\n\n ${(props) =>\n props.$disablePointerEvents &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n`;\n\nexport type InputAdornmentProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, BaseInputAdornmentProps>;\n\nexport type InputAdornmentComponent = <C extends React.ElementType = \"div\">(\n props: InputAdornmentProps<C>\n) => React.ReactElement | ReactNode | null;\n\nexport const InputAdornment: InputAdornmentComponent & {\n displayName?: string;\n} = React.forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"div\">(\n { children, as, disablePointerEvents, ...rest }: InputAdornmentProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const Component = as || \"div\";\n return (\n <InputAdornmentBase\n {...rest}\n as={Component}\n $disablePointerEvents={disablePointerEvents}\n ref={ref}\n >\n {children}\n </InputAdornmentBase>\n );\n }\n);\n\nInputAdornment.displayName = \"InputAdornment\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,IAAAG,SAAA;AAAA,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAA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AAH,CAAA,gBAAAG,CAAA,iBAAAF,CAAA,gBAAAG,CAAA,IAAAD,CAAA,SAAAY,cAAA,CAAAC,IAAA,CAAAb,CAAA,EAAAC,CAAA,gBAAAJ,CAAA,CAAA6B,OAAA,CAAAzB,CAAA,aAAAH,CAAA,CAAAG,CAAA,IAAAD,CAAA,CAAAC,CAAA,YAAAH,CAAA;AAYhD,IAAM8B,kBAAkB,GAAGC,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kBAC/B;EAAA;EAAA;EAAA;EAAA;EAAA;AAAyC,CAAC,EAE5C,UAACC,KAAK;EAAA,OACNA,KAAK,CAACC,qBAAqB,QAC3BC,qBAAG,YACG;IAAA;EAAuB,CAAC,CAC7B;AAAA,EACJ;AASM,IAAMC,cAEZ,GAAAC,OAAA,CAAAD,cAAA,gBAAGE,cAAK,CAACC,UAAU,CAGlB,UAAAC,IAAA,EAEEC,GAAsB,EACnB;EAAA,IAFDC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IAAEC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IAAKC,IAAI,GAAAvB,wBAAA,CAAAkB,IAAA,EAAA7C,SAAA;EAG7C,IAAMmD,SAAS,GAAGH,EAAE,IAAI,KAAK;EAC7B,oBACErD,MAAA,CAAAgB,OAAA,CAAAyC,aAAA,CAACpB,kBAAkB,EAAAX,QAAA,KACb6B,IAAI;IACRF,EAAE,EAAEG,SAAU;IACdZ,qBAAqB,EAAEU,oBAAqB;IAC5CH,GAAG,EAAEA;EAAI,IAERC,QACiB,CAAC;AAEzB,CACF,CAAC;AAEDN,cAAc,CAACL,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -7,7 +7,8 @@ exports.Link = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _Styles = require("./Styles");
|
|
10
|
-
var
|
|
10
|
+
var _OpenExpanded = _interopRequireDefault(require("../Icons/collection/OpenExpanded"));
|
|
11
|
+
var _excluded = ["as", "children", "variant", "size", "disabled", "className", "isExternal"];
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
14
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
@@ -25,6 +26,8 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
25
26
|
_ref$disabled = _ref.disabled,
|
|
26
27
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
27
28
|
className = _ref.className,
|
|
29
|
+
_ref$isExternal = _ref.isExternal,
|
|
30
|
+
isExternal = _ref$isExternal === void 0 ? false : _ref$isExternal,
|
|
28
31
|
args = _objectWithoutProperties(_ref, _excluded);
|
|
29
32
|
var Component = as || "a";
|
|
30
33
|
return /*#__PURE__*/_react.default.createElement(_Styles.StyledLink, _extends({
|
|
@@ -46,14 +49,19 @@ var Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
46
49
|
variant: variant,
|
|
47
50
|
size: size,
|
|
48
51
|
$iconOnly: children instanceof Object && !(children instanceof Array)
|
|
49
|
-
}, args), children instanceof Array ? /*#__PURE__*/_react.default.createElement(_Styles.StyledLinkElements, {
|
|
52
|
+
}, args), children instanceof Array || isExternal ? /*#__PURE__*/_react.default.createElement(_Styles.StyledLinkElements, {
|
|
50
53
|
className: "c-link__elements"
|
|
51
|
-
}, children.map(function (value, index) {
|
|
54
|
+
}, (children instanceof Array ? children : [children]).map(function (value, index) {
|
|
52
55
|
return value ? /*#__PURE__*/_react.default.createElement(_Styles.StyledLinkElement, {
|
|
53
56
|
className: "c-link__elements__element",
|
|
54
57
|
key: index
|
|
55
58
|
}, value) : null;
|
|
56
|
-
})
|
|
59
|
+
}), isExternal && /*#__PURE__*/_react.default.createElement(_Styles.StyledLinkElement, {
|
|
60
|
+
className: "c-link__elements__element"
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_OpenExpanded.default, {
|
|
62
|
+
width: 16,
|
|
63
|
+
height: 16
|
|
64
|
+
}))) : children);
|
|
57
65
|
});
|
|
58
66
|
Link.displayName = "Link";
|
|
59
67
|
//# sourceMappingURL=Link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Styles","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Link","exports","forwardRef","_ref","ref","as","children","_ref$variant","variant","size","_ref$disabled","disabled","className","args","Component","createElement","StyledLink","classNames","Array","$iconOnly","StyledLinkElements","map","value","index","StyledLinkElement","key","displayName"],"sources":["../../../../src/components/Links/Link.tsx"],"sourcesContent":["import React, { BaseHTMLAttributes, ReactNode, forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledLink, StyledLinkElement, StyledLinkElements } from \"./Styles\";\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\nexport interface ILinkProps extends BaseHTMLAttributes<HTMLElement> {\n /** Children type of node or string */\n children: ReactNode | string;\n /** Variant Buttons */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\"\n | \"text link-primary\"\n | \"text link-gray\";\n /** Button size can be big, medium or small */\n size?: \"big\" | \"small\";\n /** Disabled prop */\n disabled?: boolean;\n /** CSS classes */\n className?: string;\n}\n\nexport type LinkProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, ILinkProps>;\n\nexport type LinkComponent = <C extends React.ElementType = \"a\">(\n props: LinkProps<C>\n) => React.ReactElement | ReactNode | null;\n\n/**\n * Link component\n */\nexport const Link: LinkComponent & { displayName?: string } = forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"a\">(\n {\n as,\n children,\n variant = \"contained\",\n size,\n disabled = false,\n className,\n ...args\n }: LinkProps<C>,\n ref?: PolymorphicRef<C>\n ) => {\n const Component = as || \"a\";\n\n return (\n <StyledLink\n ref={ref}\n as={Component}\n disabled={disabled}\n className={classNames(\"c-link\", className, {\n \"c-link--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-link--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-link--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-link--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-link--dark_transparent\": variant === \"dark transparent\",\n \"c-link--circle_raised\": variant === \"circle raised\",\n \"c-link--big\": size === \"big\",\n \"c-link--small\": size === \"small\",\n \"c-link--icon-only\":\n children instanceof Object && !(children instanceof Array),\n \"c-link--disabled\": disabled,\n })}\n variant={variant}\n size={size}\n $iconOnly={children instanceof Object && !(children instanceof Array)}\n {...args}\n >\n {children instanceof Array ? (\n <StyledLinkElements className=\"c-link__elements\">\n {children.map((value, index) =>\n
|
|
1
|
+
{"version":3,"file":"Link.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Styles","_OpenExpanded","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Link","exports","forwardRef","_ref","ref","as","children","_ref$variant","variant","size","_ref$disabled","disabled","className","_ref$isExternal","isExternal","args","Component","createElement","StyledLink","classNames","Array","$iconOnly","StyledLinkElements","map","value","index","StyledLinkElement","key","width","height","displayName"],"sources":["../../../../src/components/Links/Link.tsx"],"sourcesContent":["import React, { BaseHTMLAttributes, ReactNode, forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledLink, StyledLinkElement, StyledLinkElements } from \"./Styles\";\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\nimport OpenExpandedIcon from \"../Icons/collection/OpenExpanded\";\n\nexport interface ILinkProps extends BaseHTMLAttributes<HTMLElement> {\n /** Children type of node or string */\n children: ReactNode | string;\n /** Variant Buttons */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\"\n | \"text link-primary\"\n | \"text link-gray\";\n /** Button size can be big, medium or small */\n size?: \"big\" | \"small\";\n /** Disabled prop */\n disabled?: boolean;\n /** CSS classes */\n className?: string;\n /** Renders an OpenExpanded icon to the right of children */\n isExternal?: boolean;\n}\n\nexport type LinkProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, ILinkProps>;\n\nexport type LinkComponent = <C extends React.ElementType = \"a\">(\n props: LinkProps<C>\n) => React.ReactElement | ReactNode | null;\n\n/**\n * Link component\n */\nexport const Link: LinkComponent & { displayName?: string } = forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"a\">(\n {\n as,\n children,\n variant = \"contained\",\n size,\n disabled = false,\n className,\n isExternal = false,\n ...args\n }: LinkProps<C>,\n ref?: PolymorphicRef<C>\n ) => {\n const Component = as || \"a\";\n\n return (\n <StyledLink\n ref={ref}\n as={Component}\n disabled={disabled}\n className={classNames(\"c-link\", className, {\n \"c-link--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-link--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-link--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-link--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-link--dark_transparent\": variant === \"dark transparent\",\n \"c-link--circle_raised\": variant === \"circle raised\",\n \"c-link--big\": size === \"big\",\n \"c-link--small\": size === \"small\",\n \"c-link--icon-only\":\n children instanceof Object && !(children instanceof Array),\n \"c-link--disabled\": disabled,\n })}\n variant={variant}\n size={size}\n $iconOnly={children instanceof Object && !(children instanceof Array)}\n {...args}\n >\n {children instanceof Array || isExternal ? (\n <StyledLinkElements className=\"c-link__elements\">\n {(children instanceof Array ? children : [children]).map(\n (value, index) =>\n value ? (\n <StyledLinkElement\n className=\"c-link__elements__element\"\n key={index}\n >\n {value}\n </StyledLinkElement>\n ) : null\n )}\n {isExternal && (\n <StyledLinkElement className=\"c-link__elements__element\">\n <OpenExpandedIcon width={16} height={16} />\n </StyledLinkElement>\n )}\n </StyledLinkElements>\n ) : (\n children\n )}\n </StyledLink>\n );\n }\n);\n\nLink.displayName = \"Link\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAA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AAYpB,MAAM,IAAI,EAAEoB,QAAQ,YAAYc,KAAK,CAAC;MAC5D,kBAAkB,EAAET;IACtB,CAAC,CAAE;IACHH,OAAO,EAAEA,OAAQ;IACjBC,IAAI,EAAEA,IAAK;IACXY,SAAS,EAAEf,QAAQ,YAAYpB,MAAM,IAAI,EAAEoB,QAAQ,YAAYc,KAAK;EAAE,GAClEL,IAAI,GAEPT,QAAQ,YAAYc,KAAK,IAAIN,UAAU,gBACtCrD,MAAA,CAAAU,OAAA,CAAA8C,aAAA,CAACnD,OAAA,CAAAwD,kBAAkB;IAACV,SAAS,EAAC;EAAkB,GAC7C,CAACN,QAAQ,YAAYc,KAAK,GAAGd,QAAQ,GAAG,CAACA,QAAQ,CAAC,EAAEiB,GAAG,CACtD,UAACC,KAAK,EAAEC,KAAK;IAAA,OACXD,KAAK,gBACH/D,MAAA,CAAAU,OAAA,CAAA8C,aAAA,CAACnD,OAAA,CAAA4D,iBAAiB;MAChBd,SAAS,EAAC,2BAA2B;MACrCe,GAAG,EAAEF;IAAM,GAEVD,KACgB,CAAC,GAClB,IAAI;EAAA,CACZ,CAAC,EACAV,UAAU,iBACTrD,MAAA,CAAAU,OAAA,CAAA8C,aAAA,CAACnD,OAAA,CAAA4D,iBAAiB;IAACd,SAAS,EAAC;EAA2B,gBACtDnD,MAAA,CAAAU,OAAA,CAAA8C,aAAA,CAAClD,aAAA,CAAAI,OAAgB;IAACyD,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE;EAAG,CAAE,CACzB,CAEH,CAAC,GAErBvB,QAEQ,CAAC;AAEjB,CACF,CAAC;AAEDN,IAAI,CAAC8B,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ const InputAdornmentBase = styled.div.withConfig({
|
|
|
11
11
|
"marginRight": "0.25rem",
|
|
12
12
|
"display": "flex",
|
|
13
13
|
"alignItems": "center",
|
|
14
|
-
"gap": "0.
|
|
14
|
+
"gap": "0.25rem"
|
|
15
15
|
}, props => props.$disablePointerEvents && css(["", ""], {
|
|
16
16
|
"pointerEvents": "none"
|
|
17
17
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputAdornment.js","names":["React","styled","css","InputAdornmentBase","div","withConfig","displayName","componentId","props","$disablePointerEvents","InputAdornment","forwardRef","_ref","ref","children","as","disablePointerEvents","rest","_objectWithoutPropertiesLoose","_excluded","Component","createElement","_extends"],"sources":["../../../../src/components/Input/InputAdornment.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\ninterface BaseInputAdornmentProps {\n disablePointerEvents?: boolean;\n}\n\nconst InputAdornmentBase = styled.div<{ $disablePointerEvents?: boolean }>`\n ${tw`tw-flex tw-items-center tw-mx-1 tw-gap-
|
|
1
|
+
{"version":3,"file":"InputAdornment.js","names":["React","styled","css","InputAdornmentBase","div","withConfig","displayName","componentId","props","$disablePointerEvents","InputAdornment","forwardRef","_ref","ref","children","as","disablePointerEvents","rest","_objectWithoutPropertiesLoose","_excluded","Component","createElement","_extends"],"sources":["../../../../src/components/Input/InputAdornment.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\ninterface BaseInputAdornmentProps {\n disablePointerEvents?: boolean;\n}\n\nconst InputAdornmentBase = styled.div<{ $disablePointerEvents?: boolean }>`\n ${tw`tw-flex tw-items-center tw-mx-1 tw-gap-1`}\n\n ${(props) =>\n props.$disablePointerEvents &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n`;\n\nexport type InputAdornmentProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, BaseInputAdornmentProps>;\n\nexport type InputAdornmentComponent = <C extends React.ElementType = \"div\">(\n props: InputAdornmentProps<C>\n) => React.ReactElement | ReactNode | null;\n\nexport const InputAdornment: InputAdornmentComponent & {\n displayName?: string;\n} = React.forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"div\">(\n { children, as, disablePointerEvents, ...rest }: InputAdornmentProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const Component = as || \"div\";\n return (\n <InputAdornmentBase\n {...rest}\n as={Component}\n $disablePointerEvents={disablePointerEvents}\n ref={ref}\n >\n {children}\n </InputAdornmentBase>\n );\n }\n);\n\nInputAdornment.displayName = \"InputAdornment\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAqB,OAAO;AAExC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAY/C,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kBAC/B;EAAA;EAAA;EAAA;EAAA;EAAA;AAAyC,CAAC,EAE3CC,KAAK,IACNA,KAAK,CAACC,qBAAqB,IAC3BP,GAAG,WACG;EAAA;AAAuB,CAAC,CAC7B,CACJ;AASD,OAAO,MAAMQ,cAEZ,gBAAGV,KAAK,CAACW,UAAU,CAGlB,CAAAC,IAAA,EAEEC,GAAsB,KACnB;EAAA,IAFH;MAAEC,QAAQ;MAAEC,EAAE;MAAEC;IAAsD,CAAC,GAAAJ,IAAA;IAA9BK,IAAI,GAAAC,6BAAA,CAAAN,IAAA,EAAAO,SAAA;EAG7C,MAAMC,SAAS,GAAGL,EAAE,IAAI,KAAK;EAC7B,oBACEf,KAAA,CAAAqB,aAAA,CAAClB,kBAAkB,EAAAmB,QAAA,KACbL,IAAI;IACRF,EAAE,EAAEK,SAAU;IACdX,qBAAqB,EAAEO,oBAAqB;IAC5CH,GAAG,EAAEA;EAAI,IAERC,QACiB,CAAC;AAEzB,CACF,CAAC;AAEDJ,cAAc,CAACJ,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -11,6 +11,8 @@ export interface ILinkProps extends BaseHTMLAttributes<HTMLElement> {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
/** CSS classes */
|
|
13
13
|
className?: string;
|
|
14
|
+
/** Renders an OpenExpanded icon to the right of children */
|
|
15
|
+
isExternal?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export type LinkProps<C extends React.ElementType> = PolymorphicComponentPropsWithRef<C, ILinkProps>;
|
|
16
18
|
export type LinkComponent = <C extends React.ElementType = "a">(props: LinkProps<C>) => React.ReactElement | ReactNode | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/components/Links/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAKzE,OAAO,EACL,gCAAgC,EAEjC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/components/Links/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAKzE,OAAO,EACL,gCAAgC,EAEjC,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,UAAW,SAAQ,kBAAkB,CAAC,WAAW,CAAC;IACjE,sCAAsC;IACtC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,sBAAsB;IACtB,OAAO,CAAC,EACJ,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,WAAW,GACX,UAAU,GACV,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,mBAAmB,GACnB,gBAAgB,CAAC;IACrB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IACvB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAC/C,gCAAgC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,GAAG,EAC5D,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAChB,KAAK,CAAC,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAmExD,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["as", "children", "variant", "size", "disabled", "className"];
|
|
3
|
+
const _excluded = ["as", "children", "variant", "size", "disabled", "className", "isExternal"];
|
|
4
4
|
import React, { forwardRef } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { StyledLink, StyledLinkElement, StyledLinkElements } from "./Styles";
|
|
7
|
+
import OpenExpandedIcon from "../Icons/collection/OpenExpanded";
|
|
7
8
|
/**
|
|
8
9
|
* Link component
|
|
9
10
|
*/
|
|
@@ -14,7 +15,8 @@ export const Link = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14
15
|
variant = "contained",
|
|
15
16
|
size,
|
|
16
17
|
disabled = false,
|
|
17
|
-
className
|
|
18
|
+
className,
|
|
19
|
+
isExternal = false
|
|
18
20
|
} = _ref,
|
|
19
21
|
args = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
22
|
const Component = as || "a";
|
|
@@ -37,12 +39,17 @@ export const Link = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
37
39
|
variant: variant,
|
|
38
40
|
size: size,
|
|
39
41
|
$iconOnly: children instanceof Object && !(children instanceof Array)
|
|
40
|
-
}, args), children instanceof Array ? /*#__PURE__*/React.createElement(StyledLinkElements, {
|
|
42
|
+
}, args), children instanceof Array || isExternal ? /*#__PURE__*/React.createElement(StyledLinkElements, {
|
|
41
43
|
className: "c-link__elements"
|
|
42
|
-
}, children.map((value, index) => value ? /*#__PURE__*/React.createElement(StyledLinkElement, {
|
|
44
|
+
}, (children instanceof Array ? children : [children]).map((value, index) => value ? /*#__PURE__*/React.createElement(StyledLinkElement, {
|
|
43
45
|
className: "c-link__elements__element",
|
|
44
46
|
key: index
|
|
45
|
-
}, value) : null)
|
|
47
|
+
}, value) : null), isExternal && /*#__PURE__*/React.createElement(StyledLinkElement, {
|
|
48
|
+
className: "c-link__elements__element"
|
|
49
|
+
}, /*#__PURE__*/React.createElement(OpenExpandedIcon, {
|
|
50
|
+
width: 16,
|
|
51
|
+
height: 16
|
|
52
|
+
}))) : children);
|
|
46
53
|
});
|
|
47
54
|
Link.displayName = "Link";
|
|
48
55
|
//# sourceMappingURL=Link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["React","forwardRef","classNames","StyledLink","StyledLinkElement","StyledLinkElements","Link","_ref","ref","as","children","variant","size","disabled","className","args","_objectWithoutPropertiesLoose","_excluded","Component","createElement","_extends","Object","Array","$iconOnly","map","value","index","key","displayName"],"sources":["../../../../src/components/Links/Link.tsx"],"sourcesContent":["import React, { BaseHTMLAttributes, ReactNode, forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledLink, StyledLinkElement, StyledLinkElements } from \"./Styles\";\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\n\nexport interface ILinkProps extends BaseHTMLAttributes<HTMLElement> {\n /** Children type of node or string */\n children: ReactNode | string;\n /** Variant Buttons */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\"\n | \"text link-primary\"\n | \"text link-gray\";\n /** Button size can be big, medium or small */\n size?: \"big\" | \"small\";\n /** Disabled prop */\n disabled?: boolean;\n /** CSS classes */\n className?: string;\n}\n\nexport type LinkProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, ILinkProps>;\n\nexport type LinkComponent = <C extends React.ElementType = \"a\">(\n props: LinkProps<C>\n) => React.ReactElement | ReactNode | null;\n\n/**\n * Link component\n */\nexport const Link: LinkComponent & { displayName?: string } = forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"a\">(\n {\n as,\n children,\n variant = \"contained\",\n size,\n disabled = false,\n className,\n ...args\n }: LinkProps<C>,\n ref?: PolymorphicRef<C>\n ) => {\n const Component = as || \"a\";\n\n return (\n <StyledLink\n ref={ref}\n as={Component}\n disabled={disabled}\n className={classNames(\"c-link\", className, {\n \"c-link--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-link--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-link--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-link--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-link--dark_transparent\": variant === \"dark transparent\",\n \"c-link--circle_raised\": variant === \"circle raised\",\n \"c-link--big\": size === \"big\",\n \"c-link--small\": size === \"small\",\n \"c-link--icon-only\":\n children instanceof Object && !(children instanceof Array),\n \"c-link--disabled\": disabled,\n })}\n variant={variant}\n size={size}\n $iconOnly={children instanceof Object && !(children instanceof Array)}\n {...args}\n >\n {children instanceof Array ? (\n <StyledLinkElements className=\"c-link__elements\">\n {children.map((value, index) =>\n
|
|
1
|
+
{"version":3,"file":"Link.js","names":["React","forwardRef","classNames","StyledLink","StyledLinkElement","StyledLinkElements","OpenExpandedIcon","Link","_ref","ref","as","children","variant","size","disabled","className","isExternal","args","_objectWithoutPropertiesLoose","_excluded","Component","createElement","_extends","Object","Array","$iconOnly","map","value","index","key","width","height","displayName"],"sources":["../../../../src/components/Links/Link.tsx"],"sourcesContent":["import React, { BaseHTMLAttributes, ReactNode, forwardRef } from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledLink, StyledLinkElement, StyledLinkElements } from \"./Styles\";\nimport {\n PolymorphicComponentPropsWithRef,\n PolymorphicRef,\n} from \"../../utils/types\";\nimport OpenExpandedIcon from \"../Icons/collection/OpenExpanded\";\n\nexport interface ILinkProps extends BaseHTMLAttributes<HTMLElement> {\n /** Children type of node or string */\n children: ReactNode | string;\n /** Variant Buttons */\n variant?:\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"option\"\n | \"contained\"\n | \"outlined\"\n | \"text colored\"\n | \"text gray\"\n | \"dark transparent\"\n | \"circle raised\"\n | \"text link-primary\"\n | \"text link-gray\";\n /** Button size can be big, medium or small */\n size?: \"big\" | \"small\";\n /** Disabled prop */\n disabled?: boolean;\n /** CSS classes */\n className?: string;\n /** Renders an OpenExpanded icon to the right of children */\n isExternal?: boolean;\n}\n\nexport type LinkProps<C extends React.ElementType> =\n PolymorphicComponentPropsWithRef<C, ILinkProps>;\n\nexport type LinkComponent = <C extends React.ElementType = \"a\">(\n props: LinkProps<C>\n) => React.ReactElement | ReactNode | null;\n\n/**\n * Link component\n */\nexport const Link: LinkComponent & { displayName?: string } = forwardRef(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - due to @node/types making ts more strict\n <C extends React.ElementType = \"a\">(\n {\n as,\n children,\n variant = \"contained\",\n size,\n disabled = false,\n className,\n isExternal = false,\n ...args\n }: LinkProps<C>,\n ref?: PolymorphicRef<C>\n ) => {\n const Component = as || \"a\";\n\n return (\n <StyledLink\n ref={ref}\n as={Component}\n disabled={disabled}\n className={classNames(\"c-link\", className, {\n \"c-link--contained\": variant === \"primary\" || variant === \"contained\",\n \"c-link--outlined\": variant === \"secondary\" || variant === \"outlined\",\n \"c-link--text_colored\":\n variant === \"tertiary\" || variant === \"text colored\",\n \"c-link--text_gray\": variant === \"option\" || variant === \"text gray\",\n \"c-link--dark_transparent\": variant === \"dark transparent\",\n \"c-link--circle_raised\": variant === \"circle raised\",\n \"c-link--big\": size === \"big\",\n \"c-link--small\": size === \"small\",\n \"c-link--icon-only\":\n children instanceof Object && !(children instanceof Array),\n \"c-link--disabled\": disabled,\n })}\n variant={variant}\n size={size}\n $iconOnly={children instanceof Object && !(children instanceof Array)}\n {...args}\n >\n {children instanceof Array || isExternal ? (\n <StyledLinkElements className=\"c-link__elements\">\n {(children instanceof Array ? children : [children]).map(\n (value, index) =>\n value ? (\n <StyledLinkElement\n className=\"c-link__elements__element\"\n key={index}\n >\n {value}\n </StyledLinkElement>\n ) : null\n )}\n {isExternal && (\n <StyledLinkElement className=\"c-link__elements__element\">\n <OpenExpandedIcon width={16} height={16} />\n </StyledLinkElement>\n )}\n </StyledLinkElements>\n ) : (\n children\n )}\n </StyledLink>\n );\n }\n);\n\nLink.displayName = \"Link\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAmCC,UAAU,QAAQ,OAAO;AAExE,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,kBAAkB,QAAQ,UAAU;AAK5E,OAAOC,gBAAgB,MAAM,kCAAkC;AAoC/D;AACA;AACA;AACA,OAAO,MAAMC,IAA8C,gBAAGN,UAAU,CAGtE,CAAAO,IAAA,EAWEC,GAAuB,KACpB;EAAA,IAXH;MACEC,EAAE;MACFC,QAAQ;MACRC,OAAO,GAAG,WAAW;MACrBC,IAAI;MACJC,QAAQ,GAAG,KAAK;MAChBC,SAAS;MACTC,UAAU,GAAG;IAED,CAAC,GAAAR,IAAA;IADVS,IAAI,GAAAC,6BA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A,CAACjB,iBAAiB;IAChBW,SAAS,EAAC,2BAA2B;IACrCc,GAAG,EAAED;EAAM,GAEVD,KACgB,CAAC,GAClB,IACR,CAAC,EACAX,UAAU,iBACThB,KAAA,CAAAqB,aAAA,CAACjB,iBAAiB;IAACW,SAAS,EAAC;EAA2B,gBACtDf,KAAA,CAAAqB,aAAA,CAACf,gBAAgB;IAACwB,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE;EAAG,CAAE,CACzB,CAEH,CAAC,GAErBpB,QAEQ,CAAC;AAEjB,CACF,CAAC;AAEDJ,IAAI,CAACyB,WAAW,GAAG,MAAM","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -18664,7 +18664,7 @@
|
|
|
18664
18664
|
"marginRight": "0.25rem",
|
|
18665
18665
|
"display": "flex",
|
|
18666
18666
|
"alignItems": "center",
|
|
18667
|
-
"gap": "0.
|
|
18667
|
+
"gap": "0.25rem"
|
|
18668
18668
|
}, function (props) {
|
|
18669
18669
|
return props.$disablePointerEvents && styled.css(["", ""], {
|
|
18670
18670
|
"pointerEvents": "none"
|
|
@@ -21640,7 +21640,7 @@
|
|
|
21640
21640
|
};
|
|
21641
21641
|
BackLink.displayName = "BackLink";
|
|
21642
21642
|
|
|
21643
|
-
var _excluded$p = ["as", "children", "variant", "size", "disabled", "className"];
|
|
21643
|
+
var _excluded$p = ["as", "children", "variant", "size", "disabled", "className", "isExternal"];
|
|
21644
21644
|
/**
|
|
21645
21645
|
* Link component
|
|
21646
21646
|
*/
|
|
@@ -21653,6 +21653,8 @@
|
|
|
21653
21653
|
_ref$disabled = _ref.disabled,
|
|
21654
21654
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
21655
21655
|
className = _ref.className,
|
|
21656
|
+
_ref$isExternal = _ref.isExternal,
|
|
21657
|
+
isExternal = _ref$isExternal === void 0 ? false : _ref$isExternal,
|
|
21656
21658
|
args = _objectWithoutProperties(_ref, _excluded$p);
|
|
21657
21659
|
var Component = as || "a";
|
|
21658
21660
|
return /*#__PURE__*/React__default["default"].createElement(StyledLink, _extends({
|
|
@@ -21674,14 +21676,19 @@
|
|
|
21674
21676
|
variant: variant,
|
|
21675
21677
|
size: size,
|
|
21676
21678
|
$iconOnly: children instanceof Object && !(children instanceof Array)
|
|
21677
|
-
}, args), children instanceof Array ? /*#__PURE__*/React__default["default"].createElement(StyledLinkElements, {
|
|
21679
|
+
}, args), children instanceof Array || isExternal ? /*#__PURE__*/React__default["default"].createElement(StyledLinkElements, {
|
|
21678
21680
|
className: "c-link__elements"
|
|
21679
|
-
}, children.map(function (value, index) {
|
|
21681
|
+
}, (children instanceof Array ? children : [children]).map(function (value, index) {
|
|
21680
21682
|
return value ? /*#__PURE__*/React__default["default"].createElement(StyledLinkElement, {
|
|
21681
21683
|
className: "c-link__elements__element",
|
|
21682
21684
|
key: index
|
|
21683
21685
|
}, value) : null;
|
|
21684
|
-
})
|
|
21686
|
+
}), isExternal && /*#__PURE__*/React__default["default"].createElement(StyledLinkElement, {
|
|
21687
|
+
className: "c-link__elements__element"
|
|
21688
|
+
}, /*#__PURE__*/React__default["default"].createElement(OpenExpandedIcon$1, {
|
|
21689
|
+
width: 16,
|
|
21690
|
+
height: 16
|
|
21691
|
+
}))) : children);
|
|
21685
21692
|
});
|
|
21686
21693
|
Link.displayName = "Link";
|
|
21687
21694
|
|