@nice-digital/nds-button 4.0.4 → 4.0.6

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 (2) hide show
  1. package/package.json +4 -3
  2. package/es/Button.js.map +0 -1
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@nice-digital/nds-button",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "Button component for the NICE Design System",
5
5
  "author": "Ian Routledge <ian.routledge@nice.org.uk>",
6
6
  "homepage": "https://design-system.nice.org.uk/",
7
7
  "license": "MIT",
8
8
  "main": "es/Button.js",
9
+ "types": "es/Button.d.ts",
9
10
  "style": "scss/button.scss",
10
11
  "files": [
11
12
  "es",
@@ -27,7 +28,7 @@
27
28
  "url": "https://github.com/nice-digital/nice-design-system/issues"
28
29
  },
29
30
  "dependencies": {
30
- "@nice-digital/nds-core": "^4.0.2",
31
+ "@nice-digital/nds-core": "^4.0.4",
31
32
  "classnames": "^2.2.6"
32
33
  },
33
34
  "peerDependencies": {
@@ -42,5 +43,5 @@
42
43
  "@types/node": "^18.11.9",
43
44
  "typescript": "^4.8.4"
44
45
  },
45
- "gitHead": "d8feb7beba5fffa49da42d6a550cb8f67a50727d"
46
+ "gitHead": "c8db07e6492c3b18564bd4f46c2ab098f185109a"
46
47
  }
package/es/Button.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","names":["React","PropTypes","classnames","Button","props","variant","to","elementType","children","buttonType","className","method","attributes","possibleVariants","Object","keys","variants","some","m","Error","join","ButtonTagType","buttonProps","type","types","button","btn","primary","submit","reset","cta","secondary","inverse","propTypes","string","oneOf","oneOfType","arrayOf","node","isRequired"],"sources":["../src/Button.js"],"sourcesContent":["import * as React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classnames from \"classnames\";\n\nimport \"../scss/button.scss\";\n\nexport const Button = (props) => {\n\tconst {\n\t\tvariant = \"primary\",\n\t\tto,\n\t\telementType,\n\t\tchildren,\n\t\tbuttonType,\n\t\tclassName,\n\t\tmethod,\n\t\t...attributes\n\t} = props;\n\n\tconst possibleVariants = Object.keys(Button.variants);\n\tif (variant && !possibleVariants.some((m) => m === variant)) {\n\t\tthrow new Error(\n\t\t\t`Expected variant to be one of '${possibleVariants.join(\n\t\t\t\t\"', '\"\n\t\t\t)}' but found '${variant}'`\n\t\t);\n\t}\n\n\tconst ButtonTagType = elementType || (to ? \"a\" : \"button\");\n\tconst buttonProps = {};\n\n\tif (to) {\n\t\tbuttonProps[method || (ButtonTagType === \"a\" && \"href\") || \"to\"] = to;\n\t} else if (ButtonTagType === \"button\") {\n\t\tbuttonProps.type = buttonType || Button.types.button;\n\t}\n\n\tbuttonProps.className = classnames({\n\t\tbtn: true,\n\t\t[`btn--${variant}`]: variant !== Button.variants.primary,\n\t\t[className]: !!className\n\t});\n\n\treturn (\n\t\t<ButtonTagType {...buttonProps} {...attributes}>\n\t\t\t{children}\n\t\t</ButtonTagType>\n\t);\n};\n\nButton.types = {\n\tbutton: \"button\",\n\tsubmit: \"submit\",\n\treset: \"reset\"\n};\n\nButton.variants = {\n\tcta: \"cta\",\n\tprimary: \"primary\",\n\tsecondary: \"secondary\",\n\tinverse: \"inverse\"\n};\n\nButton.propTypes = {\n\tto: PropTypes.string,\n\tvariant: PropTypes.oneOf([\n\t\tButton.variants.primary,\n\t\tButton.variants.cta,\n\t\tButton.variants.secondary,\n\t\tButton.variants.inverse\n\t]),\n\tbuttonType: PropTypes.oneOf([\n\t\tButton.types.button,\n\t\tButton.types.submit,\n\t\tButton.types.reset\n\t]),\n\telementType: PropTypes.elementType,\n\tclassName: PropTypes.string,\n\tchildren: PropTypes.oneOfType([\n\t\tPropTypes.arrayOf(PropTypes.node),\n\t\tPropTypes.node\n\t]).isRequired,\n\tmethod: PropTypes.string\n};\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;A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