@neo4j-ndl/react 4.11.7 → 4.12.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.
Files changed (105) hide show
  1. package/lib/cjs/avatar/Avatar.js +2 -2
  2. package/lib/cjs/avatar/Avatar.js.map +1 -1
  3. package/lib/cjs/avatar/stories/avatar-custom-icon.story.js +31 -0
  4. package/lib/cjs/avatar/stories/avatar-custom-icon.story.js.map +1 -0
  5. package/lib/cjs/avatar/stories/index.js +5 -1
  6. package/lib/cjs/avatar/stories/index.js.map +1 -1
  7. package/lib/cjs/dismissible-tag/stories/dismissible-tag-sizes.story.js +1 -1
  8. package/lib/cjs/dismissible-tag/stories/dismissible-tag-sizes.story.js.map +1 -1
  9. package/lib/cjs/index.js +3 -1
  10. package/lib/cjs/index.js.map +1 -1
  11. package/lib/cjs/read-only-tag/stories/read-only-tag-sizes.story.js +1 -1
  12. package/lib/cjs/read-only-tag/stories/read-only-tag-sizes.story.js.map +1 -1
  13. package/lib/cjs/selectable-tag/SelectableTag.js +53 -0
  14. package/lib/cjs/selectable-tag/SelectableTag.js.map +1 -0
  15. package/lib/cjs/selectable-tag/index.js +26 -0
  16. package/lib/cjs/selectable-tag/index.js.map +1 -0
  17. package/lib/cjs/selectable-tag/stories/index.js +52 -0
  18. package/lib/cjs/selectable-tag/stories/index.js.map +1 -0
  19. package/lib/cjs/selectable-tag/stories/selectable-tag-default.story.js +32 -0
  20. package/lib/cjs/selectable-tag/stories/selectable-tag-default.story.js.map +1 -0
  21. package/lib/cjs/selectable-tag/stories/selectable-tag-disabled.story.js +30 -0
  22. package/lib/cjs/selectable-tag/stories/selectable-tag-disabled.story.js.map +1 -0
  23. package/lib/cjs/selectable-tag/stories/selectable-tag-sizes.story.js +33 -0
  24. package/lib/cjs/selectable-tag/stories/selectable-tag-sizes.story.js.map +1 -0
  25. package/lib/cjs/selectable-tag/stories/selectable-tag-truncation.story.js +33 -0
  26. package/lib/cjs/selectable-tag/stories/selectable-tag-truncation.story.js.map +1 -0
  27. package/lib/cjs/selectable-tag/stories/selectable-tag-with-badge.story.js +32 -0
  28. package/lib/cjs/selectable-tag/stories/selectable-tag-with-badge.story.js.map +1 -0
  29. package/lib/cjs/selectable-tag/stories/selectable-tag-with-leading-icon.story.js +33 -0
  30. package/lib/cjs/selectable-tag/stories/selectable-tag-with-leading-icon.story.js.map +1 -0
  31. package/lib/cjs/tag/Tag.js +2 -0
  32. package/lib/cjs/tag/Tag.js.map +1 -1
  33. package/lib/cjs/tag-base/stories/index.js +32 -0
  34. package/lib/cjs/tag-base/stories/index.js.map +1 -0
  35. package/lib/cjs/tag-base/stories/tag-variants.story.js +32 -0
  36. package/lib/cjs/tag-base/stories/tag-variants.story.js.map +1 -0
  37. package/lib/esm/avatar/Avatar.js +2 -2
  38. package/lib/esm/avatar/Avatar.js.map +1 -1
  39. package/lib/esm/avatar/stories/avatar-custom-icon.story.js +29 -0
  40. package/lib/esm/avatar/stories/avatar-custom-icon.story.js.map +1 -0
  41. package/lib/esm/avatar/stories/index.js +3 -0
  42. package/lib/esm/avatar/stories/index.js.map +1 -1
  43. package/lib/esm/dismissible-tag/stories/dismissible-tag-sizes.story.js +1 -1
  44. package/lib/esm/dismissible-tag/stories/dismissible-tag-sizes.story.js.map +1 -1
  45. package/lib/esm/index.js +1 -0
  46. package/lib/esm/index.js.map +1 -1
  47. package/lib/esm/read-only-tag/stories/read-only-tag-sizes.story.js +1 -1
  48. package/lib/esm/read-only-tag/stories/read-only-tag-sizes.story.js.map +1 -1
  49. package/lib/esm/selectable-tag/SelectableTag.js +46 -0
  50. package/lib/esm/selectable-tag/SelectableTag.js.map +1 -0
  51. package/lib/esm/selectable-tag/index.js +22 -0
  52. package/lib/esm/selectable-tag/index.js.map +1 -0
  53. package/lib/esm/selectable-tag/stories/index.js +40 -0
  54. package/lib/esm/selectable-tag/stories/index.js.map +1 -0
  55. package/lib/esm/selectable-tag/stories/selectable-tag-default.story.js +30 -0
  56. package/lib/esm/selectable-tag/stories/selectable-tag-default.story.js.map +1 -0
  57. package/lib/esm/selectable-tag/stories/selectable-tag-disabled.story.js +28 -0
  58. package/lib/esm/selectable-tag/stories/selectable-tag-disabled.story.js.map +1 -0
  59. package/lib/esm/selectable-tag/stories/selectable-tag-sizes.story.js +31 -0
  60. package/lib/esm/selectable-tag/stories/selectable-tag-sizes.story.js.map +1 -0
  61. package/lib/esm/selectable-tag/stories/selectable-tag-truncation.story.js +31 -0
  62. package/lib/esm/selectable-tag/stories/selectable-tag-truncation.story.js.map +1 -0
  63. package/lib/esm/selectable-tag/stories/selectable-tag-with-badge.story.js +30 -0
  64. package/lib/esm/selectable-tag/stories/selectable-tag-with-badge.story.js.map +1 -0
  65. package/lib/esm/selectable-tag/stories/selectable-tag-with-leading-icon.story.js +31 -0
  66. package/lib/esm/selectable-tag/stories/selectable-tag-with-leading-icon.story.js.map +1 -0
  67. package/lib/esm/tag/Tag.js +2 -0
  68. package/lib/esm/tag/Tag.js.map +1 -1
  69. package/lib/esm/tag-base/stories/index.js +25 -0
  70. package/lib/esm/tag-base/stories/index.js.map +1 -0
  71. package/lib/esm/tag-base/stories/tag-variants.story.js +30 -0
  72. package/lib/esm/tag-base/stories/tag-variants.story.js.map +1 -0
  73. package/lib/types/avatar/Avatar.d.ts +3 -1
  74. package/lib/types/avatar/Avatar.d.ts.map +1 -1
  75. package/lib/types/avatar/stories/avatar-custom-icon.story.d.ts +24 -0
  76. package/lib/types/avatar/stories/avatar-custom-icon.story.d.ts.map +1 -0
  77. package/lib/types/avatar/stories/index.d.ts +2 -0
  78. package/lib/types/avatar/stories/index.d.ts.map +1 -1
  79. package/lib/types/index.d.ts +1 -0
  80. package/lib/types/index.d.ts.map +1 -1
  81. package/lib/types/selectable-tag/SelectableTag.d.ts +42 -0
  82. package/lib/types/selectable-tag/SelectableTag.d.ts.map +1 -0
  83. package/lib/types/selectable-tag/index.d.ts +22 -0
  84. package/lib/types/selectable-tag/index.d.ts.map +1 -0
  85. package/lib/types/selectable-tag/stories/index.d.ts +33 -0
  86. package/lib/types/selectable-tag/stories/index.d.ts.map +1 -0
  87. package/lib/types/selectable-tag/stories/selectable-tag-default.story.d.ts +24 -0
  88. package/lib/types/selectable-tag/stories/selectable-tag-default.story.d.ts.map +1 -0
  89. package/lib/types/selectable-tag/stories/selectable-tag-disabled.story.d.ts +24 -0
  90. package/lib/types/selectable-tag/stories/selectable-tag-disabled.story.d.ts.map +1 -0
  91. package/lib/types/selectable-tag/stories/selectable-tag-sizes.story.d.ts +24 -0
  92. package/lib/types/selectable-tag/stories/selectable-tag-sizes.story.d.ts.map +1 -0
  93. package/lib/types/selectable-tag/stories/selectable-tag-truncation.story.d.ts +24 -0
  94. package/lib/types/selectable-tag/stories/selectable-tag-truncation.story.d.ts.map +1 -0
  95. package/lib/types/selectable-tag/stories/selectable-tag-with-badge.story.d.ts +24 -0
  96. package/lib/types/selectable-tag/stories/selectable-tag-with-badge.story.d.ts.map +1 -0
  97. package/lib/types/selectable-tag/stories/selectable-tag-with-leading-icon.story.d.ts +24 -0
  98. package/lib/types/selectable-tag/stories/selectable-tag-with-leading-icon.story.d.ts.map +1 -0
  99. package/lib/types/tag/Tag.d.ts +2 -0
  100. package/lib/types/tag/Tag.d.ts.map +1 -1
  101. package/lib/types/tag-base/stories/index.d.ts +23 -0
  102. package/lib/types/tag-base/stories/index.d.ts.map +1 -0
  103. package/lib/types/tag-base/stories/tag-variants.story.d.ts +24 -0
  104. package/lib/types/tag-base/stories/tag-variants.story.d.ts.map +1 -0
  105. package/package.json +2 -2
@@ -77,7 +77,7 @@ const getLettersDisplay = (displayName) => {
77
77
  .toUpperCase();
78
78
  };
79
79
  const Avatar = (_a) => {
80
- var { as, hasStatus = false, isDisabled = false, name, shape = 'circle', size = 'medium', source, status, type: initialType = 'image', className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["as", "hasStatus", "isDisabled", "name", "shape", "size", "source", "status", "type", "className", "style", "htmlAttributes", "ref"]);
80
+ var { as, hasStatus = false, icon, isDisabled = false, name, shape = 'circle', size = 'medium', source, status, type: initialType = 'image', className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["as", "hasStatus", "icon", "isDisabled", "name", "shape", "size", "source", "status", "type", "className", "style", "htmlAttributes", "ref"]);
81
81
  // If source is not provided, fallback to icon
82
82
  const type = initialType === 'image' && (source === undefined || source === '')
83
83
  ? 'icon'
@@ -90,7 +90,7 @@ const Avatar = (_a) => {
90
90
  });
91
91
  const typeClass = `ndl-avatar-${type}`;
92
92
  const renderImageType = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { "data-testid": "ndl-avatar-image", src: source, alt: name }), (0, jsx_runtime_1.jsx)("div", { "data-testid": "ndl-avatar-image-overlay", className: `${shapeClasses} ndl-avatar-image-overlay` })] }));
93
- const renderIconType = () => (0, jsx_runtime_1.jsx)(icons_1.UserIconOutline, {});
93
+ const renderIconType = () => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: icon !== null && icon !== void 0 ? icon : (0, jsx_runtime_1.jsx)(icons_1.UserIconOutline, {}) });
94
94
  const renderLettersType = () => {
95
95
  return ((0, jsx_runtime_1.jsx)(typography_1.Typography, { variant: "subheading-small", className: "ndl-avatar-typography", children: getLettersDisplay(name !== null && name !== void 0 ? name : '') }));
96
96
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAIpC,oCAA2C;AAC3C,8CAA2C;AAgB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,CAA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AAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AAxFW,QAAA,MAAM,UAwFjB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { UserIconOutline } from '../icons';\nimport { Typography } from '../typography';\n\ntype SizeType = AvatarProps['size'];\ntype StatusType = NonNullable<AvatarProps['status']>;\n\ninterface CircleProperties {\n /** Center coordinates of the circles */\n cxAndCy: number;\n /** Diameter of the circles */\n diameter: number;\n /** Radius of the inner circle */\n rInner: number;\n /** Radius of the outer circle */\n rOuter: number;\n}\n\nfunction circleSizeFactory(size: SizeType): CircleProperties {\n switch (size) {\n case 'x-small':\n case 'small':\n case 'medium':\n return {\n cxAndCy: 4.5,\n diameter: 9,\n rInner: 3,\n rOuter: 4.5,\n };\n case 'large':\n case 'x-large':\n default:\n return {\n cxAndCy: 6,\n diameter: 12,\n rInner: 4,\n rOuter: 6,\n };\n }\n}\n\nfunction StatusIndicator({\n size,\n status,\n}: {\n size: SizeType;\n status: StatusType;\n}) {\n const { cxAndCy, diameter, rInner, rOuter } = circleSizeFactory(size);\n const statusClasses = `ndl-avatar-status ndl-avatar-status-${status}`;\n\n return (\n <div\n className={statusClasses}\n title={status.charAt(0).toUpperCase() + status.slice(1)}\n role=\"presentation\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height={diameter}\n width={diameter}\n viewBox={`0 0 ${diameter} ${diameter}`}\n fill=\"none\"\n >\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={rOuter}\n className=\"ndl-avatar-status-circle-outer\"\n />\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={status === 'unknown' ? rInner - 1 : rInner}\n className=\"ndl-avatar-status-circle-inner\"\n />\n </svg>\n </div>\n );\n}\n\ntype AvatarProps = {\n /** Whether to display a status indicator */\n hasStatus?: boolean;\n /** Whether the avatar is disabled. When disabled, status indicators are hidden and `onClick` handlers are disabled when cast as a button */\n isDisabled?: boolean;\n /** The name associated with the avatar. Used for alt text and aria-label. For letters type, this text is displayed */\n name?: string;\n /** The shape of the avatar */\n shape?: 'circle' | 'square';\n /** The size of the avatar */\n size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';\n /** Source URI for the image. When provided with `type=\"image`\", displays the image */\n source?: string;\n /** The status to display. Only shown when `hasStatus` is `true` and component is not disabled */\n status?: 'offline' | 'online' | 'unknown';\n /** The type of avatar content. If `type=\"image\"` and no source is provided, automatically falls back to `icon` */\n type?: 'icon' | 'image' | 'letters';\n} & (\n | {\n as: 'button';\n onClick: () => void;\n }\n | {\n as?: React.ElementType;\n }\n);\n\nconst getLettersDisplay = (displayName: string) => {\n const words = displayName.trim().split(/\\s+/).filter(Boolean);\n if (words.length <= 1) {\n return displayName.trim();\n }\n return words\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n};\n\nexport const Avatar = <T extends React.ElementType = 'div'>({\n as,\n hasStatus = false,\n isDisabled = false,\n name,\n shape = 'circle',\n size = 'medium',\n source,\n status,\n type: initialType = 'image',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, AvatarProps>) => {\n // If source is not provided, fallback to icon\n const type =\n initialType === 'image' && (source === undefined || source === '')\n ? 'icon'\n : initialType;\n\n const Component: React.ElementType = as ?? 'div';\n const isButton = Component === 'button';\n const classes = classNames(\n `ndl-avatar ndl-avatar-${shape} ndl-avatar-${size}`,\n className,\n );\n const shapeClasses = classNames(\n `ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`,\n {\n 'ndl-avatar-disabled': isDisabled,\n },\n );\n\n const typeClass = `ndl-avatar-${type}`;\n\n const renderImageType = () => (\n <>\n <img data-testid=\"ndl-avatar-image\" src={source} alt={name} />\n <div\n data-testid=\"ndl-avatar-image-overlay\"\n className={`${shapeClasses} ndl-avatar-image-overlay`}\n />\n </>\n );\n\n const renderIconType = () => <UserIconOutline />;\n\n const renderLettersType = () => {\n return (\n <Typography variant=\"subheading-small\" className=\"ndl-avatar-typography\">\n {getLettersDisplay(name ?? '')}\n </Typography>\n );\n };\n\n const TypeComponent =\n type === 'image'\n ? renderImageType()\n : type === 'icon'\n ? renderIconType()\n : type === 'letters' && Boolean(name)\n ? renderLettersType()\n : null;\n\n const isStatusIndicatorVisible =\n hasStatus && !isDisabled && status !== undefined;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n aria-hidden={!isButton}\n {...(isButton && {\n disabled: isDisabled,\n })}\n aria-label={`Avatar ${name}`}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={classNames(shapeClasses, typeClass)}>{TypeComponent}</div>\n {isStatusIndicatorVisible && (\n <StatusIndicator size={size} status={status} />\n )}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAIpC,oCAA2C;AAC3C,8CAA2C;AAgB3C,SAAS,iBAAiB,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO;gBACL,OAAO,EAAE,GAAG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AU,EAAC,YAAY,EAAE,SAAS,CAAC,YAAG,aAAa,GAAO,EACzE,wBAAwB,IAAI,CAC3B,uBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,CAChD,KACS,CACb,CAAC;AACJ,CAAC,CAAC;AAzFW,QAAA,MAAM,UAyFjB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { UserIconOutline } from '../icons';\nimport { Typography } from '../typography';\n\ntype SizeType = AvatarProps['size'];\ntype StatusType = NonNullable<AvatarProps['status']>;\n\ninterface CircleProperties {\n /** Center coordinates of the circles */\n cxAndCy: number;\n /** Diameter of the circles */\n diameter: number;\n /** Radius of the inner circle */\n rInner: number;\n /** Radius of the outer circle */\n rOuter: number;\n}\n\nfunction circleSizeFactory(size: SizeType): CircleProperties {\n switch (size) {\n case 'x-small':\n case 'small':\n case 'medium':\n return {\n cxAndCy: 4.5,\n diameter: 9,\n rInner: 3,\n rOuter: 4.5,\n };\n case 'large':\n case 'x-large':\n default:\n return {\n cxAndCy: 6,\n diameter: 12,\n rInner: 4,\n rOuter: 6,\n };\n }\n}\n\nfunction StatusIndicator({\n size,\n status,\n}: {\n size: SizeType;\n status: StatusType;\n}) {\n const { cxAndCy, diameter, rInner, rOuter } = circleSizeFactory(size);\n const statusClasses = `ndl-avatar-status ndl-avatar-status-${status}`;\n\n return (\n <div\n className={statusClasses}\n title={status.charAt(0).toUpperCase() + status.slice(1)}\n role=\"presentation\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height={diameter}\n width={diameter}\n viewBox={`0 0 ${diameter} ${diameter}`}\n fill=\"none\"\n >\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={rOuter}\n className=\"ndl-avatar-status-circle-outer\"\n />\n <circle\n cx={cxAndCy}\n cy={cxAndCy}\n r={status === 'unknown' ? rInner - 1 : rInner}\n className=\"ndl-avatar-status-circle-inner\"\n />\n </svg>\n </div>\n );\n}\n\ntype AvatarProps = {\n /** Whether to display a status indicator */\n hasStatus?: boolean;\n /** Whether the avatar is disabled. When disabled, status indicators are hidden and `onClick` handlers are disabled when cast as a button */\n isDisabled?: boolean;\n /** The name associated with the avatar. Used for alt text and aria-label. For letters type, this text is displayed */\n name?: string;\n /** The shape of the avatar */\n shape?: 'circle' | 'square';\n /** The size of the avatar */\n size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large';\n /** Source URI for the image. When provided with `type=\"image`\", displays the image */\n source?: string;\n /** The status to display. Only shown when `hasStatus` is `true` and component is not disabled */\n status?: 'offline' | 'online' | 'unknown';\n /** The type of avatar content. If `type=\"image\"` and no source is provided, automatically falls back to `icon` */\n type?: 'icon' | 'image' | 'letters';\n /** Custom icon to display when `type` is `\"icon\"`. Defaults to `UserIconOutline` */\n icon?: React.ReactNode;\n} & (\n | {\n as: 'button';\n onClick: () => void;\n }\n | {\n as?: React.ElementType;\n }\n);\n\nconst getLettersDisplay = (displayName: string) => {\n const words = displayName.trim().split(/\\s+/).filter(Boolean);\n if (words.length <= 1) {\n return displayName.trim();\n }\n return words\n .map((word) => word.charAt(0))\n .join('')\n .toUpperCase();\n};\n\nexport const Avatar = <T extends React.ElementType = 'div'>({\n as,\n hasStatus = false,\n icon,\n isDisabled = false,\n name,\n shape = 'circle',\n size = 'medium',\n source,\n status,\n type: initialType = 'image',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, AvatarProps>) => {\n // If source is not provided, fallback to icon\n const type =\n initialType === 'image' && (source === undefined || source === '')\n ? 'icon'\n : initialType;\n\n const Component: React.ElementType = as ?? 'div';\n const isButton = Component === 'button';\n const classes = classNames(\n `ndl-avatar ndl-avatar-${shape} ndl-avatar-${size}`,\n className,\n );\n const shapeClasses = classNames(\n `ndl-avatar-shape ndl-avatar-${shape} ndl-avatar-${shape}-${size}`,\n {\n 'ndl-avatar-disabled': isDisabled,\n },\n );\n\n const typeClass = `ndl-avatar-${type}`;\n\n const renderImageType = () => (\n <>\n <img data-testid=\"ndl-avatar-image\" src={source} alt={name} />\n <div\n data-testid=\"ndl-avatar-image-overlay\"\n className={`${shapeClasses} ndl-avatar-image-overlay`}\n />\n </>\n );\n\n const renderIconType = () => <>{icon ?? <UserIconOutline />}</>;\n\n const renderLettersType = () => {\n return (\n <Typography variant=\"subheading-small\" className=\"ndl-avatar-typography\">\n {getLettersDisplay(name ?? '')}\n </Typography>\n );\n };\n\n const TypeComponent =\n type === 'image'\n ? renderImageType()\n : type === 'icon'\n ? renderIconType()\n : type === 'letters' && Boolean(name)\n ? renderLettersType()\n : null;\n\n const isStatusIndicatorVisible =\n hasStatus && !isDisabled && status !== undefined;\n\n return (\n <Component\n ref={ref}\n className={classes}\n style={style}\n aria-hidden={!isButton}\n {...(isButton && {\n disabled: isDisabled,\n })}\n aria-label={`Avatar ${name}`}\n {...restProps}\n {...htmlAttributes}\n >\n <div className={classNames(shapeClasses, typeClass)}>{TypeComponent}</div>\n {isStatusIndicatorVisible && (\n <StatusIndicator size={size} status={status} />\n )}\n </Component>\n );\n};\n"]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const icons_1 = require("@neo4j-ndl/react/icons");
27
+ const Component = () => {
28
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.Avatar, { type: "icon", name: "Favorites", icon: (0, jsx_runtime_1.jsx)(icons_1.StarIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Avatar, { type: "icon", name: "Notifications", icon: (0, jsx_runtime_1.jsx)(icons_1.BellIconOutline, {}) }), (0, jsx_runtime_1.jsx)(react_1.Avatar, { type: "icon", name: "Likes", icon: (0, jsx_runtime_1.jsx)(icons_1.HeartIconOutline, {}) })] }));
29
+ };
30
+ exports.default = Component;
31
+ //# sourceMappingURL=avatar-custom-icon.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar-custom-icon.story.js","sourceRoot":"","sources":["../../../../src/avatar/stories/avatar-custom-icon.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA0C;AAC1C,kDAIgC;AAEhC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,uBAAuB,aACpC,uBAAC,cAAM,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAE,uBAAC,uBAAe,KAAG,GAAI,EAClE,uBAAC,cAAM,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,eAAe,EAAC,IAAI,EAAE,uBAAC,uBAAe,KAAG,GAAI,EACtE,uBAAC,cAAM,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,uBAAC,wBAAgB,KAAG,GAAI,IAC3D,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Avatar } from '@neo4j-ndl/react';\nimport {\n BellIconOutline,\n HeartIconOutline,\n StarIconOutline,\n} from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-gap-token-16\">\n <Avatar type=\"icon\" name=\"Favorites\" icon={<StarIconOutline />} />\n <Avatar type=\"icon\" name=\"Notifications\" icon={<BellIconOutline />} />\n <Avatar type=\"icon\" name=\"Likes\" icon={<HeartIconOutline />} />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -23,7 +23,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.AvatarStatusesSource = exports.AvatarTypesSource = exports.AvatarShapesSource = exports.AvatarSizesSource = exports.AvatarDisabledSource = exports.AvatarDefaultSource = exports.AvatarStatuses = exports.AvatarTypes = exports.AvatarShapes = exports.AvatarSizes = exports.AvatarDisabled = exports.AvatarDefault = void 0;
26
+ exports.AvatarStatusesSource = exports.AvatarTypesSource = exports.AvatarShapesSource = exports.AvatarSizesSource = exports.AvatarDisabledSource = exports.AvatarDefaultSource = exports.AvatarCustomIconSource = exports.AvatarStatuses = exports.AvatarTypes = exports.AvatarShapes = exports.AvatarSizes = exports.AvatarDisabled = exports.AvatarDefault = exports.AvatarCustomIcon = void 0;
27
+ var avatar_custom_icon_story_1 = require("./avatar-custom-icon.story");
28
+ Object.defineProperty(exports, "AvatarCustomIcon", { enumerable: true, get: function () { return __importDefault(avatar_custom_icon_story_1).default; } });
27
29
  var avatar_default_story_1 = require("./avatar-default.story");
28
30
  Object.defineProperty(exports, "AvatarDefault", { enumerable: true, get: function () { return __importDefault(avatar_default_story_1).default; } });
29
31
  var avatar_disabled_story_1 = require("./avatar-disabled.story");
@@ -37,12 +39,14 @@ Object.defineProperty(exports, "AvatarTypes", { enumerable: true, get: function
37
39
  var avatar_statuses_story_1 = require("./avatar-statuses.story");
38
40
  Object.defineProperty(exports, "AvatarStatuses", { enumerable: true, get: function () { return __importDefault(avatar_statuses_story_1).default; } });
39
41
  const export_stories_utils_1 = require("../../_common/export-stories-utils");
42
+ const avatar_custom_icon_story_raw_1 = __importDefault(require("./avatar-custom-icon.story?raw"));
40
43
  const avatar_default_story_raw_1 = __importDefault(require("./avatar-default.story?raw"));
41
44
  const avatar_disabled_story_raw_1 = __importDefault(require("./avatar-disabled.story?raw"));
42
45
  const avatar_shapes_story_raw_1 = __importDefault(require("./avatar-shapes.story?raw"));
43
46
  const avatar_sizes_story_raw_1 = __importDefault(require("./avatar-sizes.story?raw"));
44
47
  const avatar_statuses_story_raw_1 = __importDefault(require("./avatar-statuses.story?raw"));
45
48
  const avatar_types_story_raw_1 = __importDefault(require("./avatar-types.story?raw"));
49
+ exports.AvatarCustomIconSource = (0, export_stories_utils_1.removeLicenseHeader)(avatar_custom_icon_story_raw_1.default);
46
50
  exports.AvatarDefaultSource = (0, export_stories_utils_1.removeLicenseHeader)(avatar_default_story_raw_1.default);
47
51
  exports.AvatarDisabledSource = (0, export_stories_utils_1.removeLicenseHeader)(avatar_disabled_story_raw_1.default);
48
52
  exports.AvatarSizesSource = (0, export_stories_utils_1.removeLicenseHeader)(avatar_sizes_story_raw_1.default);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/avatar/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,+DAAkE;AAAzD,sIAAA,OAAO,OAAiB;AACjC,iEAAoE;AAA3D,wIAAA,OAAO,OAAkB;AAClC,2DAA8D;AAArD,kIAAA,OAAO,OAAe;AAC/B,6DAAgE;AAAvD,oIAAA,OAAO,OAAgB;AAChC,2DAA8D;AAArD,kIAAA,OAAO,OAAe;AAC/B,iEAAoE;AAA3D,wIAAA,OAAO,OAAkB;AAElC,6EAAyE;AACzE,0FAAgE;AAChE,4FAAkE;AAClE,wFAA8D;AAC9D,sFAA4D;AAC5D,4FAAkE;AAClE,sFAA4D;AAE/C,QAAA,mBAAmB,GAAG,IAAA,0CAAmB,EAAC,kCAAsB,CAAC,CAAC;AAClE,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,mCAAuB,CACxB,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAA,0CAAmB,EAAC,gCAAoB,CAAC,CAAC;AAC9D,QAAA,kBAAkB,GAAG,IAAA,0CAAmB,EAAC,iCAAqB,CAAC,CAAC;AAChE,QAAA,iBAAiB,GAAG,IAAA,0CAAmB,EAAC,gCAAoB,CAAC,CAAC;AAC9D,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,mCAAuB,CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as AvatarDefault } from './avatar-default.story';\nexport { default as AvatarDisabled } from './avatar-disabled.story';\nexport { default as AvatarSizes } from './avatar-sizes.story';\nexport { default as AvatarShapes } from './avatar-shapes.story';\nexport { default as AvatarTypes } from './avatar-types.story';\nexport { default as AvatarStatuses } from './avatar-statuses.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport AvatarDefaultSourceRaw from './avatar-default.story?raw';\nimport AvatarDisabledSourceRaw from './avatar-disabled.story?raw';\nimport AvatarShapesSourceRaw from './avatar-shapes.story?raw';\nimport AvatarSizesSourceRaw from './avatar-sizes.story?raw';\nimport AvatarStatusesSourceRaw from './avatar-statuses.story?raw';\nimport AvatarTypesSourceRaw from './avatar-types.story?raw';\n\nexport const AvatarDefaultSource = removeLicenseHeader(AvatarDefaultSourceRaw);\nexport const AvatarDisabledSource = removeLicenseHeader(\n AvatarDisabledSourceRaw,\n);\nexport const AvatarSizesSource = removeLicenseHeader(AvatarSizesSourceRaw);\nexport const AvatarShapesSource = removeLicenseHeader(AvatarShapesSourceRaw);\nexport const AvatarTypesSource = removeLicenseHeader(AvatarTypesSourceRaw);\nexport const AvatarStatusesSource = removeLicenseHeader(\n AvatarStatusesSourceRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/avatar/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,uEAAyE;AAAhE,6IAAA,OAAO,OAAoB;AACpC,+DAAkE;AAAzD,sIAAA,OAAO,OAAiB;AACjC,iEAAoE;AAA3D,wIAAA,OAAO,OAAkB;AAClC,2DAA8D;AAArD,kIAAA,OAAO,OAAe;AAC/B,6DAAgE;AAAvD,oIAAA,OAAO,OAAgB;AAChC,2DAA8D;AAArD,kIAAA,OAAO,OAAe;AAC/B,iEAAoE;AAA3D,wIAAA,OAAO,OAAkB;AAElC,6EAAyE;AACzE,kGAAuE;AACvE,0FAAgE;AAChE,4FAAkE;AAClE,wFAA8D;AAC9D,sFAA4D;AAC5D,4FAAkE;AAClE,sFAA4D;AAE/C,QAAA,sBAAsB,GAAG,IAAA,0CAAmB,EACvD,sCAAyB,CAC1B,CAAC;AACW,QAAA,mBAAmB,GAAG,IAAA,0CAAmB,EAAC,kCAAsB,CAAC,CAAC;AAClE,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,mCAAuB,CACxB,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAA,0CAAmB,EAAC,gCAAoB,CAAC,CAAC;AAC9D,QAAA,kBAAkB,GAAG,IAAA,0CAAmB,EAAC,iCAAqB,CAAC,CAAC;AAChE,QAAA,iBAAiB,GAAG,IAAA,0CAAmB,EAAC,gCAAoB,CAAC,CAAC;AAC9D,QAAA,oBAAoB,GAAG,IAAA,0CAAmB,EACrD,mCAAuB,CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as AvatarCustomIcon } from './avatar-custom-icon.story';\nexport { default as AvatarDefault } from './avatar-default.story';\nexport { default as AvatarDisabled } from './avatar-disabled.story';\nexport { default as AvatarSizes } from './avatar-sizes.story';\nexport { default as AvatarShapes } from './avatar-shapes.story';\nexport { default as AvatarTypes } from './avatar-types.story';\nexport { default as AvatarStatuses } from './avatar-statuses.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport AvatarCustomIconSourceRaw from './avatar-custom-icon.story?raw';\nimport AvatarDefaultSourceRaw from './avatar-default.story?raw';\nimport AvatarDisabledSourceRaw from './avatar-disabled.story?raw';\nimport AvatarShapesSourceRaw from './avatar-shapes.story?raw';\nimport AvatarSizesSourceRaw from './avatar-sizes.story?raw';\nimport AvatarStatusesSourceRaw from './avatar-statuses.story?raw';\nimport AvatarTypesSourceRaw from './avatar-types.story?raw';\n\nexport const AvatarCustomIconSource = removeLicenseHeader(\n AvatarCustomIconSourceRaw,\n);\nexport const AvatarDefaultSource = removeLicenseHeader(AvatarDefaultSourceRaw);\nexport const AvatarDisabledSource = removeLicenseHeader(\n AvatarDisabledSourceRaw,\n);\nexport const AvatarSizesSource = removeLicenseHeader(AvatarSizesSourceRaw);\nexport const AvatarShapesSource = removeLicenseHeader(AvatarShapesSourceRaw);\nexport const AvatarTypesSource = removeLicenseHeader(AvatarTypesSourceRaw);\nexport const AvatarStatusesSource = removeLicenseHeader(\n AvatarStatusesSourceRaw,\n);\n"]}
@@ -27,7 +27,7 @@ const Component = () => {
27
27
  const handleRemove = () => {
28
28
  console.info('onRemove was called');
29
29
  };
30
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16", children: [(0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "x-small", onRemove: handleRemove, children: "X-Small" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "small", onRemove: handleRemove, children: "Small" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "medium", onRemove: handleRemove, children: "Medium" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "large", onRemove: handleRemove, children: "Large" })] }));
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "x-small", onRemove: handleRemove, children: "X-Small" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "small", onRemove: handleRemove, children: "Small" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "medium", onRemove: handleRemove, children: "Medium" }), (0, jsx_runtime_1.jsx)(react_1.DismissibleTag, { size: "large", onRemove: handleRemove, children: "Large" })] }));
31
31
  };
32
32
  exports.default = Component;
33
33
  //# sourceMappingURL=dismissible-tag-sizes.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dismissible-tag-sizes.story.js","sourceRoot":"","sources":["../../../../src/dismissible-tag/stories/dismissible-tag-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAkD;AAElD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,kCAAkC,aAC/C,uBAAC,sBAAc,IAAC,IAAI,EAAC,SAAS,EAAC,QAAQ,EAAE,YAAY,wBAEpC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,YAAY,sBAElC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,YAAY,uBAEnC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,YAAY,sBAElC,IACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DismissibleTag } from '@neo4j-ndl/react';\n\nconst Component = () => {\n const handleRemove = () => {\n console.info('onRemove was called');\n };\n\n return (\n <div className=\"n-flex n-flex-col n-gap-token-16\">\n <DismissibleTag size=\"x-small\" onRemove={handleRemove}>\n X-Small\n </DismissibleTag>\n <DismissibleTag size=\"small\" onRemove={handleRemove}>\n Small\n </DismissibleTag>\n <DismissibleTag size=\"medium\" onRemove={handleRemove}>\n Medium\n </DismissibleTag>\n <DismissibleTag size=\"large\" onRemove={handleRemove}>\n Large\n </DismissibleTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"dismissible-tag-sizes.story.js","sourceRoot":"","sources":["../../../../src/dismissible-tag/stories/dismissible-tag-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAkD;AAElD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,CACL,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,uBAAC,sBAAc,IAAC,IAAI,EAAC,SAAS,EAAC,QAAQ,EAAE,YAAY,wBAEpC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,YAAY,sBAElC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,YAAY,uBAEnC,EACjB,uBAAC,sBAAc,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,YAAY,sBAElC,IACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DismissibleTag } from '@neo4j-ndl/react';\n\nconst Component = () => {\n const handleRemove = () => {\n console.info('onRemove was called');\n };\n\n return (\n <div className=\"n-flex n-flex-row n-gap-token-8\">\n <DismissibleTag size=\"x-small\" onRemove={handleRemove}>\n X-Small\n </DismissibleTag>\n <DismissibleTag size=\"small\" onRemove={handleRemove}>\n Small\n </DismissibleTag>\n <DismissibleTag size=\"medium\" onRemove={handleRemove}>\n Medium\n </DismissibleTag>\n <DismissibleTag size=\"large\" onRemove={handleRemove}>\n Large\n </DismissibleTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
package/lib/cjs/index.js CHANGED
@@ -35,7 +35,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.TimeZonePicker = exports.NeedleTime = exports.TimePicker = exports.Skeleton = exports.Tooltip = exports.toast = exports.Toaster = exports.ToasterControlled = exports.Divider = exports.DropdownButton = exports.InlineEdit = exports.Slider = exports.ClipboardButton = exports.Logo = exports.Avatar = exports.Flex = exports.Box = exports.Breadcrumbs = exports.Drawer = exports.Typography = exports.SideNavigation = exports.StatusIndicator = exports.CodeBlock = exports.GraphLabel = exports.Wizard = exports.Tag = exports.Select = exports.TextLink = exports.TextArea = exports.TextInput = exports.DataGridNav = exports.dataGridUtils = exports.useTableNav = exports.useDataGridContext = exports.DataGrid = exports.Dropzone = exports.ProgressBar = exports.Popover = exports.SegmentedControl = exports.Tabs = exports.LoadingSpinner = exports.Dialog = exports.DatePicker = exports.Menu = exports.Radio = exports.Switch = exports.Checkbox = exports.Banner = exports.StatusLabel = exports.Accordion = void 0;
38
- exports.DismissibleTag = exports.ReadOnlyTag = exports.SelectIconButton = exports.Kbd = exports.Code = exports.TextButton = exports.FilledButton = exports.OutlinedButton = exports.ColorPicker = exports.ConditionalWrap = exports.IconButtonArray = exports.CleanIconButton = exports.IconButton = exports.LoadingBar = exports.useSpotlightContext = exports.SpotlightTour = exports.SpotlightTarget = exports.SpotlightProvider = exports.Spotlight = void 0;
38
+ exports.SelectableTag = exports.DismissibleTag = exports.ReadOnlyTag = exports.SelectIconButton = exports.Kbd = exports.Code = exports.TextButton = exports.FilledButton = exports.OutlinedButton = exports.ColorPicker = exports.ConditionalWrap = exports.IconButtonArray = exports.CleanIconButton = exports.IconButton = exports.LoadingBar = exports.useSpotlightContext = exports.SpotlightTour = exports.SpotlightTarget = exports.SpotlightProvider = exports.Spotlight = void 0;
39
39
  var accordion_1 = require("./accordion");
40
40
  Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return accordion_1.Accordion; } });
41
41
  var status_label_1 = require("./status-label");
@@ -166,4 +166,6 @@ var read_only_tag_1 = require("./read-only-tag");
166
166
  Object.defineProperty(exports, "ReadOnlyTag", { enumerable: true, get: function () { return read_only_tag_1.ReadOnlyTag; } });
167
167
  var dismissible_tag_1 = require("./dismissible-tag");
168
168
  Object.defineProperty(exports, "DismissibleTag", { enumerable: true, get: function () { return dismissible_tag_1.DismissibleTag; } });
169
+ var selectable_tag_1 = require("./selectable-tag");
170
+ Object.defineProperty(exports, "SelectableTag", { enumerable: true, get: function () { return selectable_tag_1.SelectableTag; } });
169
171
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;AAEH,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yCAMqB;AALnB,qGAAA,QAAQ,OAAA;AACR,+GAAA,kBAAkB,OAAA;AAClB,wGAAA,WAAW,OAAA;AACX,0GAAA,aAAa,OAAA;AACb,wGAAA,WAAW,OAAA;AAEb,2CAAyC;AAAhC,uG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OAAA;AACT,8GAAA,iBAAiB,OAAA;AACjB,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AACb,gHAAA,mBAAmB,OAAA;AAErB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { Checkbox } from './checkbox';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport { Popover } from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport {\n DataGrid,\n useDataGridContext,\n useTableNav,\n dataGridUtils,\n DataGridNav,\n} from './data-grid';\nexport { TextInput } from './text-input';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './d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AAApC,2GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { Accordion } from './accordion';\nexport { StatusLabel } from './status-label';\nexport { Banner } from './banner';\nexport { Checkbox } from './checkbox';\nexport { Switch } from './switch';\nexport { Radio } from './radio';\nexport { Menu } from './menu';\nexport { DatePicker } from './date-picker';\nexport { Dialog } from './dialog';\nexport { LoadingSpinner } from './loading-spinner';\nexport { Tabs } from './tabs';\nexport { SegmentedControl } from './segmented-control';\nexport { Popover } from './popover';\nexport { ProgressBar } from './progress-bar';\nexport { Dropzone } from './dropzone';\nexport {\n DataGrid,\n useDataGridContext,\n useTableNav,\n dataGridUtils,\n DataGridNav,\n} from './data-grid';\nexport { TextInput } from './text-input';\nexport { TextArea } from './text-area';\nexport { TextLink } from './text-link';\nexport { Select } from './select';\nexport { Tag } from './tag';\nexport * from './theme';\nexport { Wizard } from './wizard';\nexport { GraphLabel } from './graph-label';\nexport { CodeBlock } from './code-block';\nexport { StatusIndicator } from './status-indicator';\nexport { SideNavigation } from './side-navigation';\nexport { Typography } from './typography';\nexport { Drawer } from './drawer';\nexport { Breadcrumbs } from './breadcrumbs';\nexport * from './hooks';\nexport { Box } from './box';\nexport { Flex } from './flex';\nexport { Avatar } from './avatar';\nexport { Logo } from './logo';\nexport { ClipboardButton } from './clipboard-button';\nexport { Slider } from './slider';\nexport { InlineEdit } from './inline-edit';\nexport { DropdownButton } from './dropdown-button';\nexport { Divider } from './divider';\nexport * from './tree-view';\nexport { ToasterControlled, Toaster, toast, type ToastId } from './toast';\nexport { Tooltip } from './tooltip';\nexport { Skeleton } from './skeleton';\nexport { TimePicker, NeedleTime } from './time-picker';\nexport { TimeZonePicker } from './timezone-picker';\nexport {\n Spotlight,\n SpotlightProvider,\n SpotlightTarget,\n SpotlightTour,\n useSpotlightContext,\n} from './spotlight';\nexport { LoadingBar } from './loading-bar';\nexport { IconButton } from './icon-button';\nexport { CleanIconButton } from './clean-icon-button';\nexport { IconButtonArray } from './icon-button-array';\nexport { ConditionalWrap } from './conditional-wrap';\nexport { ColorPicker } from './color-picker';\nexport { OutlinedButton } from './outlined-button';\nexport { FilledButton } from './filled-button';\nexport { TextButton } from './text-button';\nexport { Code } from './code';\nexport { Kbd } from './kbd';\nexport { SelectIconButton } from './select-icon-button';\nexport { ReadOnlyTag } from './read-only-tag';\nexport { DismissibleTag } from './dismissible-tag';\nexport { SelectableTag } from './selectable-tag';\n"]}
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
24
24
  require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
25
  const react_1 = require("@neo4j-ndl/react");
26
26
  const Component = () => {
27
- return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-16 n-items-start", children: [(0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "x-small", children: "X-Small" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "small", children: "Small" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "medium", children: "Medium" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "large", children: "Large" })] }));
27
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "x-small", children: "X-Small" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "small", children: "Small" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "medium", children: "Medium" }), (0, jsx_runtime_1.jsx)(react_1.ReadOnlyTag, { size: "large", children: "Large" })] }));
28
28
  };
29
29
  exports.default = Component;
30
30
  //# sourceMappingURL=read-only-tag-sizes.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-only-tag-sizes.story.js","sourceRoot":"","sources":["../../../../src/read-only-tag/stories/read-only-tag-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+C;AAE/C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,qCAAqC,aAClD,uBAAC,mBAAW,IAAC,IAAI,EAAC,SAAS,wBAAsB,EACjD,uBAAC,mBAAW,IAAC,IAAI,EAAC,OAAO,sBAAoB,EAC7C,uBAAC,mBAAW,IAAC,IAAI,EAAC,QAAQ,uBAAqB,EAC/C,uBAAC,mBAAW,IAAC,IAAI,EAAC,OAAO,sBAAoB,IACzC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { ReadOnlyTag } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-gap-token-16 n-items-start\">\n <ReadOnlyTag size=\"x-small\">X-Small</ReadOnlyTag>\n <ReadOnlyTag size=\"small\">Small</ReadOnlyTag>\n <ReadOnlyTag size=\"medium\">Medium</ReadOnlyTag>\n <ReadOnlyTag size=\"large\">Large</ReadOnlyTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"read-only-tag-sizes.story.js","sourceRoot":"","sources":["../../../../src/read-only-tag/stories/read-only-tag-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA+C;AAE/C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,uBAAC,mBAAW,IAAC,IAAI,EAAC,SAAS,wBAAsB,EACjD,uBAAC,mBAAW,IAAC,IAAI,EAAC,OAAO,sBAAoB,EAC7C,uBAAC,mBAAW,IAAC,IAAI,EAAC,QAAQ,uBAAqB,EAC/C,uBAAC,mBAAW,IAAC,IAAI,EAAC,OAAO,sBAAoB,IACzC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { ReadOnlyTag } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-row n-gap-token-8\">\n <ReadOnlyTag size=\"x-small\">X-Small</ReadOnlyTag>\n <ReadOnlyTag size=\"small\">Small</ReadOnlyTag>\n <ReadOnlyTag size=\"medium\">Medium</ReadOnlyTag>\n <ReadOnlyTag size=\"large\">Large</ReadOnlyTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SelectableTag = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ /**
20
+ *
21
+ * Copyright (c) "Neo4j"
22
+ * Neo4j Sweden AB [http://neo4j.com]
23
+ *
24
+ * This file is part of Neo4j.
25
+ *
26
+ * Neo4j is free software: you can redistribute it and/or modify
27
+ * it under the terms of the GNU General Public License as published by
28
+ * the Free Software Foundation, either version 3 of the License, or
29
+ * (at your option) any later version.
30
+ *
31
+ * This program is distributed in the hope that it will be useful,
32
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+ * GNU General Public License for more details.
35
+ *
36
+ * You should have received a copy of the GNU General Public License
37
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
38
+ */
39
+ const classnames_1 = __importDefault(require("classnames"));
40
+ const SelectableTag = (_a) => {
41
+ var { children, className, htmlAttributes, isSelected, badgeCount, leadingVisual, onClick, ref, isDisabled = false, size = 'medium', style } = _a, restProps = __rest(_a, ["children", "className", "htmlAttributes", "isSelected", "badgeCount", "leadingVisual", "onClick", "ref", "isDisabled", "size", "style"]);
42
+ const classes = (0, classnames_1.default)('ndl-tag-selectable', className, {
43
+ 'ndl-disabled': isDisabled,
44
+ 'ndl-large': size === 'large',
45
+ 'ndl-medium': size === 'medium',
46
+ 'ndl-small': size === 'small',
47
+ 'ndl-tag-selected': isSelected,
48
+ 'ndl-x-small': size === 'x-small',
49
+ });
50
+ return ((0, jsx_runtime_1.jsxs)("button", Object.assign({ type: "button", "aria-pressed": isSelected, className: classes, disabled: isDisabled, onClick: onClick, ref: ref, style: style }, htmlAttributes, restProps, { children: [Boolean(leadingVisual) && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-selectable-tag-leading-visual", children: leadingVisual })), (0, jsx_runtime_1.jsx)("span", { className: "ndl-selectable-tag-content", children: children }), badgeCount !== undefined && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-selectable-tag-badge", children: badgeCount }))] })));
51
+ };
52
+ exports.SelectableTag = SelectableTag;
53
+ //# sourceMappingURL=SelectableTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectableTag.js","sourceRoot":"","sources":["../../../src/selectable-tag/SelectableTag.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4DAAoC;AAuB7B,MAAM,aAAa,GAAG,CAAC,EAac,EAAE,EAAE;QAblB,EAC5B,QAAQ,EACR,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,GAAG,EACH,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,QAAQ,EACf,KAAK,OAEqC,EADvC,SAAS,cAZgB,yIAa7B,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,oBAAoB,EAAE,SAAS,EAAE;QAC1D,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,YAAY,EAAE,IAAI,KAAK,QAAQ;QAC/B,WAAW,EAAE,IAAI,KAAK,OAAO;QAC7B,kBAAkB,EAAE,UAAU;QAC9B,aAAa,EAAE,IAAI,KAAK,SAAS;KAClC,CAAC,CAAC;IAEH,OAAO,CACL,kDACE,IAAI,EAAC,QAAQ,kBACC,UAAU,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,IACR,cAAc,EACd,SAAS,eAEZ,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,iCAAM,SAAS,EAAC,mCAAmC,YAChD,aAAa,GACT,CACR,EACD,iCAAM,SAAS,EAAC,4BAA4B,YAAE,QAAQ,GAAQ,EAC7D,UAAU,KAAK,SAAS,IAAI,CAC3B,iCAAM,SAAS,EAAC,0BAA0B,YAAE,UAAU,GAAQ,CAC/D,KACM,CACV,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,aAAa,iBA8CxB","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport type { TagSize } from '../tag-base';\n\nexport interface SelectableTagProps {\n /** The content of the tag */\n children?: React.ReactNode;\n /** Whether the tag is disabled */\n isDisabled?: boolean;\n /** Whether the tag is selected */\n isSelected: boolean;\n /** Number displayed in a badge after the content */\n badgeCount?: number;\n /** Icon to display before the content */\n leadingVisual?: React.ReactNode;\n /** Size of the tag */\n size?: TagSize;\n /** Callback fired when the tag is clicked */\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport const SelectableTag = ({\n children,\n className,\n htmlAttributes,\n isSelected,\n badgeCount,\n leadingVisual,\n onClick,\n ref,\n isDisabled = false,\n size = 'medium',\n style,\n ...restProps\n}: CommonProps<'button', SelectableTagProps>) => {\n const classes = classNames('ndl-tag-selectable', className, {\n 'ndl-disabled': isDisabled,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n 'ndl-tag-selected': isSelected,\n 'ndl-x-small': size === 'x-small',\n });\n\n return (\n <button\n type=\"button\"\n aria-pressed={isSelected}\n className={classes}\n disabled={isDisabled}\n onClick={onClick}\n ref={ref}\n style={style}\n {...htmlAttributes}\n {...restProps}\n >\n {Boolean(leadingVisual) && (\n <span className=\"ndl-selectable-tag-leading-visual\">\n {leadingVisual}\n </span>\n )}\n <span className=\"ndl-selectable-tag-content\">{children}</span>\n {badgeCount !== undefined && (\n <span className=\"ndl-selectable-tag-badge\">{badgeCount}</span>\n )}\n </button>\n );\n};\n"]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.SelectableTag = void 0;
24
+ var SelectableTag_1 = require("./SelectableTag");
25
+ Object.defineProperty(exports, "SelectableTag", { enumerable: true, get: function () { return SelectableTag_1.SelectableTag; } });
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/selectable-tag/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,iDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { SelectableTag } from './SelectableTag';\n"]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SelectableTagWithBadgeSrc = exports.SelectableTagWithLeadingIconSrc = exports.SelectableTagTruncationSrc = exports.SelectableTagSizesSrc = exports.SelectableTagDisabledSrc = exports.SelectableTagDefaultSrc = exports.SelectableTagWithBadge = exports.SelectableTagWithLeadingIcon = exports.SelectableTagTruncation = exports.SelectableTagSizes = exports.SelectableTagDisabled = exports.SelectableTagDefault = void 0;
27
+ var selectable_tag_default_story_1 = require("./selectable-tag-default.story");
28
+ Object.defineProperty(exports, "SelectableTagDefault", { enumerable: true, get: function () { return __importDefault(selectable_tag_default_story_1).default; } });
29
+ var selectable_tag_disabled_story_1 = require("./selectable-tag-disabled.story");
30
+ Object.defineProperty(exports, "SelectableTagDisabled", { enumerable: true, get: function () { return __importDefault(selectable_tag_disabled_story_1).default; } });
31
+ var selectable_tag_sizes_story_1 = require("./selectable-tag-sizes.story");
32
+ Object.defineProperty(exports, "SelectableTagSizes", { enumerable: true, get: function () { return __importDefault(selectable_tag_sizes_story_1).default; } });
33
+ var selectable_tag_truncation_story_1 = require("./selectable-tag-truncation.story");
34
+ Object.defineProperty(exports, "SelectableTagTruncation", { enumerable: true, get: function () { return __importDefault(selectable_tag_truncation_story_1).default; } });
35
+ var selectable_tag_with_leading_icon_story_1 = require("./selectable-tag-with-leading-icon.story");
36
+ Object.defineProperty(exports, "SelectableTagWithLeadingIcon", { enumerable: true, get: function () { return __importDefault(selectable_tag_with_leading_icon_story_1).default; } });
37
+ var selectable_tag_with_badge_story_1 = require("./selectable-tag-with-badge.story");
38
+ Object.defineProperty(exports, "SelectableTagWithBadge", { enumerable: true, get: function () { return __importDefault(selectable_tag_with_badge_story_1).default; } });
39
+ const export_stories_utils_1 = require("../../_common/export-stories-utils");
40
+ const selectable_tag_default_story_raw_1 = __importDefault(require("./selectable-tag-default.story?raw"));
41
+ const selectable_tag_disabled_story_raw_1 = __importDefault(require("./selectable-tag-disabled.story?raw"));
42
+ const selectable_tag_sizes_story_raw_1 = __importDefault(require("./selectable-tag-sizes.story?raw"));
43
+ const selectable_tag_truncation_story_raw_1 = __importDefault(require("./selectable-tag-truncation.story?raw"));
44
+ const selectable_tag_with_badge_story_raw_1 = __importDefault(require("./selectable-tag-with-badge.story?raw"));
45
+ const selectable_tag_with_leading_icon_story_raw_1 = __importDefault(require("./selectable-tag-with-leading-icon.story?raw"));
46
+ exports.SelectableTagDefaultSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_default_story_raw_1.default);
47
+ exports.SelectableTagDisabledSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_disabled_story_raw_1.default);
48
+ exports.SelectableTagSizesSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_sizes_story_raw_1.default);
49
+ exports.SelectableTagTruncationSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_truncation_story_raw_1.default);
50
+ exports.SelectableTagWithLeadingIconSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_with_leading_icon_story_raw_1.default);
51
+ exports.SelectableTagWithBadgeSrc = (0, export_stories_utils_1.removeLicenseHeader)(selectable_tag_with_badge_story_raw_1.default);
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/selectable-tag/stories/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,+EAAiF;AAAxE,qJAAA,OAAO,OAAwB;AACxC,iFAAmF;AAA1E,uJAAA,OAAO,OAAyB;AACzC,2EAA6E;AAApE,iJAAA,OAAO,OAAsB;AACtC,qFAAuF;AAA9E,2JAAA,OAAO,OAA2B;AAC3C,mGAAmG;AAA1F,uKAAA,OAAO,OAAgC;AAChD,qFAAsF;AAA7E,0JAAA,OAAO,OAA0B;AAE1C,6EAAyE;AACzE,0GAA4E;AAC5E,4GAA8E;AAC9E,sGAAwE;AACxE,gHAAkF;AAClF,gHAAiF;AACjF,8HAA8F;AAEjF,QAAA,uBAAuB,GAAG,IAAA,0CAAmB,EACxD,0CAA0B,CAC3B,CAAC;AACW,QAAA,wBAAwB,GAAG,IAAA,0CAAmB,EACzD,2CAA2B,CAC5B,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAA,0CAAmB,EACtD,wCAAwB,CACzB,CAAC;AACW,QAAA,0BAA0B,GAAG,IAAA,0CAAmB,EAC3D,6CAA6B,CAC9B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,oDAAkC,CACnC,CAAC;AACW,QAAA,yBAAyB,GAAG,IAAA,0CAAmB,EAC1D,6CAA4B,CAC7B,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as SelectableTagDefault } from './selectable-tag-default.story';\nexport { default as SelectableTagDisabled } from './selectable-tag-disabled.story';\nexport { default as SelectableTagSizes } from './selectable-tag-sizes.story';\nexport { default as SelectableTagTruncation } from './selectable-tag-truncation.story';\nexport { default as SelectableTagWithLeadingIcon } from './selectable-tag-with-leading-icon.story';\nexport { default as SelectableTagWithBadge } from './selectable-tag-with-badge.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport SelectableTagDefaultSrcRaw from './selectable-tag-default.story?raw';\nimport SelectableTagDisabledSrcRaw from './selectable-tag-disabled.story?raw';\nimport SelectableTagSizesSrcRaw from './selectable-tag-sizes.story?raw';\nimport SelectableTagTruncationSrcRaw from './selectable-tag-truncation.story?raw';\nimport SelectableTagWithBadgeSrcRaw from './selectable-tag-with-badge.story?raw';\nimport SelectableTagWithLeadingIconSrcRaw from './selectable-tag-with-leading-icon.story?raw';\n\nexport const SelectableTagDefaultSrc = removeLicenseHeader(\n SelectableTagDefaultSrcRaw,\n);\nexport const SelectableTagDisabledSrc = removeLicenseHeader(\n SelectableTagDisabledSrcRaw,\n);\nexport const SelectableTagSizesSrc = removeLicenseHeader(\n SelectableTagSizesSrcRaw,\n);\nexport const SelectableTagTruncationSrc = removeLicenseHeader(\n SelectableTagTruncationSrcRaw,\n);\nexport const SelectableTagWithLeadingIconSrc = removeLicenseHeader(\n SelectableTagWithLeadingIconSrcRaw,\n);\nexport const SelectableTagWithBadgeSrc = removeLicenseHeader(\n SelectableTagWithBadgeSrcRaw,\n);\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const react_2 = require("react");
27
+ const Component = () => {
28
+ const [isSelected, setIsSelected] = (0, react_2.useState)(false);
29
+ return ((0, jsx_runtime_1.jsx)(react_1.SelectableTag, { isSelected: isSelected, onClick: () => setIsSelected(!isSelected), children: "Selectable Tag" }));
30
+ };
31
+ exports.default = Component;
32
+ //# sourceMappingURL=selectable-tag-default.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectable-tag-default.story.js","sourceRoot":"","sources":["../../../../src/selectable-tag/stories/selectable-tag-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiD;AACjD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,OAAO,CACL,uBAAC,qBAAa,IACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,+BAG3B,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { SelectableTag } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isSelected, setIsSelected] = useState(false);\n\n return (\n <SelectableTag\n isSelected={isSelected}\n onClick={() => setIsSelected(!isSelected)}\n >\n Selectable Tag\n </SelectableTag>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const Component = () => {
27
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-gap-token-8 n-items-center", children: [(0, jsx_runtime_1.jsx)(react_1.SelectableTag, { isSelected: false, isDisabled: true, onClick: () => null, children: "Disabled unselected tag" }), (0, jsx_runtime_1.jsx)(react_1.SelectableTag, { isSelected: true, isDisabled: true, onClick: () => null, children: "Disabled selected tag" })] }));
28
+ };
29
+ exports.default = Component;
30
+ //# sourceMappingURL=selectable-tag-disabled.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectable-tag-disabled.story.js","sourceRoot":"","sources":["../../../../src/selectable-tag/stories/selectable-tag-disabled.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiD;AAEjD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,qCAAqC,aAClD,uBAAC,qBAAa,IAAC,UAAU,EAAE,KAAK,EAAE,UAAU,QAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,wCAEhD,EAChB,uBAAC,qBAAa,IAAC,UAAU,EAAE,IAAI,EAAE,UAAU,QAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,sCAE/C,IACZ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { SelectableTag } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-gap-token-8 n-items-center\">\n <SelectableTag isSelected={false} isDisabled onClick={() => null}>\n Disabled unselected tag\n </SelectableTag>\n <SelectableTag isSelected={true} isDisabled onClick={() => null}>\n Disabled selected tag\n </SelectableTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const react_2 = require("react");
27
+ const Component = () => {
28
+ var _a, _b, _c, _d;
29
+ const [selected, setSelected] = (0, react_2.useState)({});
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-gap-token-8", children: [(0, jsx_runtime_1.jsx)(react_1.SelectableTag, { size: "x-small", isSelected: (_a = selected['x-small']) !== null && _a !== void 0 ? _a : false, onClick: () => setSelected((s) => (Object.assign(Object.assign({}, s), { ['x-small']: !s['x-small'] }))), children: "X-Small" }), (0, jsx_runtime_1.jsx)(react_1.SelectableTag, { size: "small", isSelected: (_b = selected['small']) !== null && _b !== void 0 ? _b : false, onClick: () => setSelected((s) => (Object.assign(Object.assign({}, s), { ['small']: !s['small'] }))), children: "Small" }), (0, jsx_runtime_1.jsx)(react_1.SelectableTag, { size: "medium", isSelected: (_c = selected['medium']) !== null && _c !== void 0 ? _c : false, onClick: () => setSelected((s) => (Object.assign(Object.assign({}, s), { ['medium']: !s['medium'] }))), children: "Medium" }), (0, jsx_runtime_1.jsx)(react_1.SelectableTag, { size: "large", isSelected: (_d = selected['large']) !== null && _d !== void 0 ? _d : false, onClick: () => setSelected((s) => (Object.assign(Object.assign({}, s), { ['large']: !s['large'] }))), children: "Large" })] }));
31
+ };
32
+ exports.default = Component;
33
+ //# sourceMappingURL=selectable-tag-sizes.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectable-tag-sizes.story.js","sourceRoot":"","sources":["../../../../src/selectable-tag/stories/selectable-tag-sizes.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAiD;AACjD,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;;IACrB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAA0B,EAAE,CAAC,CAAC;IAEtE,OAAO,CACL,iCAAK,SAAS,EAAC,iCAAiC,aAC9C,uBAAC,qBAAa,IACZ,IAAI,EAAC,SAAS,EACd,UAAU,EAAE,MAAA,QAAQ,CAAC,SAAS,CAAC,mCAAI,KAAK,EACxC,OAAO,EAAE,GAAG,EAAE,CACZ,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAG,CAAC,wBAI9C,EAChB,uBAAC,qBAAa,IACZ,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,MAAA,QAAQ,CAAC,OAAO,CAAC,mCAAI,KAAK,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAG,CAAC,sBAGvD,EAChB,uBAAC,qBAAa,IACZ,IAAI,EAAC,QAAQ,EACb,UAAU,EAAE,MAAA,QAAQ,CAAC,QAAQ,CAAC,mCAAI,KAAK,EACvC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAG,CAAC,uBAGzD,EAChB,uBAAC,qBAAa,IACZ,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,MAAA,QAAQ,CAAC,OAAO,CAAC,mCAAI,KAAK,EACtC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAG,CAAC,sBAGvD,IACZ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { SelectableTag } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selected, setSelected] = useState<Record<string, boolean>>({});\n\n return (\n <div className=\"n-flex n-flex-row n-gap-token-8\">\n <SelectableTag\n size=\"x-small\"\n isSelected={selected['x-small'] ?? false}\n onClick={() =>\n setSelected((s) => ({ ...s, ['x-small']: !s['x-small'] }))\n }\n >\n X-Small\n </SelectableTag>\n <SelectableTag\n size=\"small\"\n isSelected={selected['small'] ?? false}\n onClick={() => setSelected((s) => ({ ...s, ['small']: !s['small'] }))}\n >\n Small\n </SelectableTag>\n <SelectableTag\n size=\"medium\"\n isSelected={selected['medium'] ?? false}\n onClick={() => setSelected((s) => ({ ...s, ['medium']: !s['medium'] }))}\n >\n Medium\n </SelectableTag>\n <SelectableTag\n size=\"large\"\n isSelected={selected['large'] ?? false}\n onClick={() => setSelected((s) => ({ ...s, ['large']: !s['large'] }))}\n >\n Large\n </SelectableTag>\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const react_2 = require("react");
27
+ const label = 'This is a very very very long tag label that should be truncated';
28
+ const Component = () => {
29
+ const [isSelected, setIsSelected] = (0, react_2.useState)(false);
30
+ return ((0, jsx_runtime_1.jsx)("div", { style: { maxWidth: 200 }, children: (0, jsx_runtime_1.jsxs)(react_1.Tooltip, { type: "simple", children: [(0, jsx_runtime_1.jsx)(react_1.Tooltip.Trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(react_1.SelectableTag, { isSelected: isSelected, onClick: () => setIsSelected(!isSelected), badgeCount: 8, children: label }) }), (0, jsx_runtime_1.jsx)(react_1.Tooltip.Content, { children: label })] }) }));
31
+ };
32
+ exports.default = Component;
33
+ //# sourceMappingURL=selectable-tag-truncation.story.js.map