@govtechsg/sgds-web-component 0.0.10 → 0.0.11

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 (251) hide show
  1. package/package.json +7 -64
  2. package/.github/workflows/publish-latest.yml +0 -22
  3. package/.github/workflows/publish-pr.yml +0 -28
  4. package/.husky/commit-msg +0 -4
  5. package/.husky/prepare-commit-msg +0 -8
  6. package/.storybook/main.js +0 -16
  7. package/.storybook/preview-head.html +0 -11
  8. package/.storybook/preview.js +0 -9
  9. package/.vscode/settings.json +0 -7
  10. package/CONTRIBUTING.md +0 -56
  11. package/LICENSE +0 -20
  12. package/amplify.yml +0 -22
  13. package/commitlint.config.js +0 -1
  14. package/coverage/lcov-report/base.css +0 -224
  15. package/coverage/lcov-report/block-navigation.js +0 -87
  16. package/coverage/lcov-report/button-element.scss.html +0 -112
  17. package/coverage/lcov-report/button-element.ts.html +0 -145
  18. package/coverage/lcov-report/favicon.png +0 -0
  19. package/coverage/lcov-report/index.html +0 -116
  20. package/coverage/lcov-report/prettify.css +0 -1
  21. package/coverage/lcov-report/prettify.js +0 -2
  22. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  23. package/coverage/lcov-report/sorter.js +0 -196
  24. package/coverage/lcov.info +0 -32
  25. package/index.html +0 -430
  26. package/mocks/dropdown.d.ts +0 -4
  27. package/mocks/dropdown.ts +0 -27
  28. package/mocks/link.d.ts +0 -3
  29. package/mocks/link.ts +0 -6
  30. package/rollup.config.js +0 -73
  31. package/rollup.test.config.js +0 -42
  32. package/scripts/buildUtils.js +0 -30
  33. package/scripts/frankBuild.js +0 -49
  34. package/src/Button/index.ts +0 -1
  35. package/src/Button/sgds-button.scss +0 -28
  36. package/src/Button/sgds-button.ts +0 -153
  37. package/src/Card/index.ts +0 -1
  38. package/src/Card/sgds-action-card.scss +0 -27
  39. package/src/Card/sgds-action-card.ts +0 -115
  40. package/src/Checkbox/index.ts +0 -1
  41. package/src/Checkbox/sgds-checkbox.scss +0 -4
  42. package/src/Checkbox/sgds-checkbox.ts +0 -149
  43. package/src/Dropdown/index.ts +0 -3
  44. package/src/Dropdown/sgds-dropdown-item.ts +0 -39
  45. package/src/Dropdown/sgds-dropdown.scss +0 -5
  46. package/src/Dropdown/sgds-dropdown.ts +0 -54
  47. package/src/Footer/index.ts +0 -3
  48. package/src/Footer/sgds-footer.scss +0 -5
  49. package/src/Footer/sgds-footer.ts +0 -121
  50. package/src/Input/index.ts +0 -1
  51. package/src/Input/sgds-input.scss +0 -20
  52. package/src/Input/sgds-input.ts +0 -178
  53. package/src/Mainnav/index.ts +0 -4
  54. package/src/Mainnav/sgds-mainnav-dropdown.scss +0 -13
  55. package/src/Mainnav/sgds-mainnav-dropdown.ts +0 -45
  56. package/src/Mainnav/sgds-mainnav-item.scss +0 -24
  57. package/src/Mainnav/sgds-mainnav-item.ts +0 -8
  58. package/src/Mainnav/sgds-mainnav.scss +0 -39
  59. package/src/Mainnav/sgds-mainnav.ts +0 -183
  60. package/src/Masthead/index.ts +0 -1
  61. package/src/Masthead/sgds-masthead.scss +0 -217
  62. package/src/Masthead/sgds-masthead.ts +0 -189
  63. package/src/Modal/index.ts +0 -1
  64. package/src/Modal/sgds-modal.scss +0 -128
  65. package/src/Modal/sgds-modal.ts +0 -309
  66. package/src/QuantityToggle/index.ts +0 -1
  67. package/src/QuantityToggle/sgds-quantitytoggle.scss +0 -10
  68. package/src/QuantityToggle/sgds-quantitytoggle.ts +0 -130
  69. package/src/Radio/index.ts +0 -2
  70. package/src/Radio/sgds-radio.scss +0 -5
  71. package/src/Radio/sgds-radio.ts +0 -120
  72. package/src/Radio/sgds-radiogroup.scss +0 -22
  73. package/src/Radio/sgds-radiogroup.ts +0 -221
  74. package/src/Sidenav/index.ts +0 -4
  75. package/src/Sidenav/sgds-sidenav-item.scss +0 -73
  76. package/src/Sidenav/sgds-sidenav-item.ts +0 -145
  77. package/src/Sidenav/sgds-sidenav-link.scss +0 -25
  78. package/src/Sidenav/sgds-sidenav-link.ts +0 -8
  79. package/src/Sidenav/sgds-sidenav.scss +0 -6
  80. package/src/Sidenav/sgds-sidenav.ts +0 -33
  81. package/src/Tab/index.ts +0 -3
  82. package/src/Tab/sgds-tab.scss +0 -84
  83. package/src/Tab/sgds-tab.ts +0 -87
  84. package/src/Tab/sgds-tabgroup.scss +0 -198
  85. package/src/Tab/sgds-tabgroup.ts +0 -295
  86. package/src/Tab/sgds-tabpanel.scss +0 -12
  87. package/src/Tab/sgds-tabpanel.ts +0 -55
  88. package/src/Textarea/index.ts +0 -1
  89. package/src/Textarea/sgds-textarea.scss +0 -23
  90. package/src/Textarea/sgds-textarea.ts +0 -201
  91. package/src/index.ts +0 -16
  92. package/src/utils/animate.ts +0 -69
  93. package/src/utils/animation-registry.ts +0 -71
  94. package/src/utils/base.scss +0 -14
  95. package/src/utils/breakpoints.ts +0 -5
  96. package/src/utils/card-element.ts +0 -42
  97. package/src/utils/components.style.scss +0 -531
  98. package/src/utils/defaultvalue.ts +0 -51
  99. package/src/utils/dropdown-element.ts +0 -244
  100. package/src/utils/event.ts +0 -13
  101. package/src/utils/form.ts +0 -183
  102. package/src/utils/generateId.ts +0 -4
  103. package/src/utils/link-element.ts +0 -34
  104. package/src/utils/mergeDeep.ts +0 -22
  105. package/src/utils/modal.ts +0 -64
  106. package/src/utils/object.ts +0 -2
  107. package/src/utils/offset.ts +0 -6
  108. package/src/utils/scroll.ts +0 -57
  109. package/src/utils/sgds-element.ts +0 -18
  110. package/src/utils/slot.ts +0 -102
  111. package/src/utils/tabbable.ts +0 -81
  112. package/src/utils/watch.ts +0 -62
  113. package/stories/ActionCard.stories.mdx +0 -199
  114. package/stories/Button.stories.mdx +0 -194
  115. package/stories/Checkbox.stories.mdx +0 -196
  116. package/stories/Dropdown.stories.mdx +0 -152
  117. package/stories/Footer.stories.mdx +0 -261
  118. package/stories/Input.stories.mdx +0 -236
  119. package/stories/MainNav.stories.mdx +0 -169
  120. package/stories/Masthead.stories.mdx +0 -112
  121. package/stories/Modal.stories.mdx +0 -103
  122. package/stories/QuantityToggle.stories.mdx +0 -97
  123. package/stories/Radio.stories.mdx +0 -262
  124. package/stories/Sample.stories.js +0 -29
  125. package/stories/Sample.stories.mdx +0 -33
  126. package/stories/SideNav.stories.mdx +0 -245
  127. package/stories/common.js +0 -185
  128. package/stories/textarea.stories.mdx +0 -253
  129. package/test/button.element.test.ts +0 -185
  130. package/test/checkbox.test.ts +0 -240
  131. package/test/dropdown.test.ts +0 -637
  132. package/test/footer.test.ts +0 -181
  133. package/test/generateId.test.ts +0 -18
  134. package/test/input.element.test.ts +0 -316
  135. package/test/link-element.test.ts +0 -38
  136. package/test/mainnav.test.ts +0 -313
  137. package/test/masthead.test.ts +0 -116
  138. package/test/modal.test.ts +0 -149
  139. package/test/quantitytoggle.test.ts +0 -76
  140. package/test/radio.test.ts +0 -310
  141. package/test/selectable-card.test.ts +0 -159
  142. package/test/sidenav.test.ts +0 -390
  143. package/test/tab.test.ts +0 -76
  144. package/test/textarea.test.ts +0 -126
  145. package/tsconfig.json +0 -26
  146. package/tsconfig.test.json +0 -24
  147. package/typings/scss.d.ts +0 -5
  148. package/web-dev-server.config.mjs +0 -7
  149. package/web-test-runner.config.mjs +0 -47
  150. /package/{lib/Button → Button}/index.d.ts +0 -0
  151. /package/{lib/Button → Button}/index.js +0 -0
  152. /package/{lib/Button → Button}/index.js.map +0 -0
  153. /package/{lib/Button → Button}/package.json +0 -0
  154. /package/{lib/Button → Button}/sgds-button.d.ts +0 -0
  155. /package/{lib/Card → Card}/index.d.ts +0 -0
  156. /package/{lib/Card → Card}/index.js +0 -0
  157. /package/{lib/Card → Card}/index.js.map +0 -0
  158. /package/{lib/Card → Card}/package.json +0 -0
  159. /package/{lib/Card → Card}/sgds-action-card.d.ts +0 -0
  160. /package/{lib/Checkbox → Checkbox}/index.d.ts +0 -0
  161. /package/{lib/Checkbox → Checkbox}/index.js +0 -0
  162. /package/{lib/Checkbox → Checkbox}/index.js.map +0 -0
  163. /package/{lib/Checkbox → Checkbox}/package.json +0 -0
  164. /package/{lib/Checkbox → Checkbox}/sgds-checkbox.d.ts +0 -0
  165. /package/{lib/Dropdown → Dropdown}/index.d.ts +0 -0
  166. /package/{lib/Dropdown → Dropdown}/index.js +0 -0
  167. /package/{lib/Dropdown → Dropdown}/index.js.map +0 -0
  168. /package/{lib/Dropdown → Dropdown}/package.json +0 -0
  169. /package/{lib/Dropdown → Dropdown}/sgds-dropdown-item.d.ts +0 -0
  170. /package/{lib/Dropdown → Dropdown}/sgds-dropdown.d.ts +0 -0
  171. /package/{lib/Footer → Footer}/index.d.ts +0 -0
  172. /package/{lib/Footer → Footer}/index.js +0 -0
  173. /package/{lib/Footer → Footer}/index.js.map +0 -0
  174. /package/{lib/Footer → Footer}/package.json +0 -0
  175. /package/{lib/Footer → Footer}/sgds-footer.d.ts +0 -0
  176. /package/{lib/Input → Input}/index.d.ts +0 -0
  177. /package/{lib/Input → Input}/index.js +0 -0
  178. /package/{lib/Input → Input}/index.js.map +0 -0
  179. /package/{lib/Input → Input}/package.json +0 -0
  180. /package/{lib/Input → Input}/sgds-input.d.ts +0 -0
  181. /package/{lib/Mainnav → Mainnav}/index.d.ts +0 -0
  182. /package/{lib/Mainnav → Mainnav}/index.js +0 -0
  183. /package/{lib/Mainnav → Mainnav}/index.js.map +0 -0
  184. /package/{lib/Mainnav → Mainnav}/package.json +0 -0
  185. /package/{lib/Mainnav → Mainnav}/sgds-mainnav-dropdown.d.ts +0 -0
  186. /package/{lib/Mainnav → Mainnav}/sgds-mainnav-item.d.ts +0 -0
  187. /package/{lib/Mainnav → Mainnav}/sgds-mainnav.d.ts +0 -0
  188. /package/{lib/Masthead → Masthead}/index.d.ts +0 -0
  189. /package/{lib/Masthead → Masthead}/index.js +0 -0
  190. /package/{lib/Masthead → Masthead}/index.js.map +0 -0
  191. /package/{lib/Masthead → Masthead}/package.json +0 -0
  192. /package/{lib/Masthead → Masthead}/sgds-masthead.d.ts +0 -0
  193. /package/{lib/Modal → Modal}/index.d.ts +0 -0
  194. /package/{lib/Modal → Modal}/index.js +0 -0
  195. /package/{lib/Modal → Modal}/index.js.map +0 -0
  196. /package/{lib/Modal → Modal}/package.json +0 -0
  197. /package/{lib/Modal → Modal}/sgds-modal.d.ts +0 -0
  198. /package/{lib/QuantityToggle → QuantityToggle}/index.d.ts +0 -0
  199. /package/{lib/QuantityToggle → QuantityToggle}/index.js +0 -0
  200. /package/{lib/QuantityToggle → QuantityToggle}/index.js.map +0 -0
  201. /package/{lib/QuantityToggle → QuantityToggle}/package.json +0 -0
  202. /package/{lib/QuantityToggle → QuantityToggle}/sgds-quantitytoggle.d.ts +0 -0
  203. /package/{lib/Radio → Radio}/index.d.ts +0 -0
  204. /package/{lib/Radio → Radio}/index.js +0 -0
  205. /package/{lib/Radio → Radio}/index.js.map +0 -0
  206. /package/{lib/Radio → Radio}/package.json +0 -0
  207. /package/{lib/Radio → Radio}/sgds-radio.d.ts +0 -0
  208. /package/{lib/Radio → Radio}/sgds-radiogroup.d.ts +0 -0
  209. /package/{lib/Sidenav → Sidenav}/index.d.ts +0 -0
  210. /package/{lib/Sidenav → Sidenav}/index.js +0 -0
  211. /package/{lib/Sidenav → Sidenav}/index.js.map +0 -0
  212. /package/{lib/Sidenav → Sidenav}/package.json +0 -0
  213. /package/{lib/Sidenav → Sidenav}/sgds-sidenav-item.d.ts +0 -0
  214. /package/{lib/Sidenav → Sidenav}/sgds-sidenav-link.d.ts +0 -0
  215. /package/{lib/Sidenav → Sidenav}/sgds-sidenav.d.ts +0 -0
  216. /package/{lib/Tab → Tab}/index.d.ts +0 -0
  217. /package/{lib/Tab → Tab}/index.js +0 -0
  218. /package/{lib/Tab → Tab}/index.js.map +0 -0
  219. /package/{lib/Tab → Tab}/package.json +0 -0
  220. /package/{lib/Tab → Tab}/sgds-tab.d.ts +0 -0
  221. /package/{lib/Tab → Tab}/sgds-tabgroup.d.ts +0 -0
  222. /package/{lib/Tab → Tab}/sgds-tabpanel.d.ts +0 -0
  223. /package/{lib/Textarea → Textarea}/index.d.ts +0 -0
  224. /package/{lib/Textarea → Textarea}/index.js +0 -0
  225. /package/{lib/Textarea → Textarea}/index.js.map +0 -0
  226. /package/{lib/Textarea → Textarea}/package.json +0 -0
  227. /package/{lib/Textarea → Textarea}/sgds-textarea.d.ts +0 -0
  228. /package/{lib/index.d.ts → index.d.ts} +0 -0
  229. /package/{lib/index.js → index.js} +0 -0
  230. /package/{lib/index.js.map → index.js.map} +0 -0
  231. /package/{lib/umd → umd}/index.js +0 -0
  232. /package/{lib/umd → umd}/index.js.map +0 -0
  233. /package/{lib/utils → utils}/animate.d.ts +0 -0
  234. /package/{lib/utils → utils}/animation-registry.d.ts +0 -0
  235. /package/{lib/utils → utils}/breakpoints.d.ts +0 -0
  236. /package/{lib/utils → utils}/card-element.d.ts +0 -0
  237. /package/{lib/utils → utils}/defaultvalue.d.ts +0 -0
  238. /package/{lib/utils → utils}/dropdown-element.d.ts +0 -0
  239. /package/{lib/utils → utils}/event.d.ts +0 -0
  240. /package/{lib/utils → utils}/form.d.ts +0 -0
  241. /package/{lib/utils → utils}/generateId.d.ts +0 -0
  242. /package/{lib/utils → utils}/link-element.d.ts +0 -0
  243. /package/{lib/utils → utils}/mergeDeep.d.ts +0 -0
  244. /package/{lib/utils → utils}/modal.d.ts +0 -0
  245. /package/{lib/utils → utils}/object.d.ts +0 -0
  246. /package/{lib/utils → utils}/offset.d.ts +0 -0
  247. /package/{lib/utils → utils}/scroll.d.ts +0 -0
  248. /package/{lib/utils → utils}/sgds-element.d.ts +0 -0
  249. /package/{lib/utils → utils}/slot.d.ts +0 -0
  250. /package/{lib/utils → utils}/tabbable.d.ts +0 -0
  251. /package/{lib/utils → utils}/watch.d.ts +0 -0
package/package.json CHANGED
@@ -1,22 +1,10 @@
1
1
  {
2
2
  "name": "@govtechsg/sgds-web-component",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
- "main": "lib/umd/index.js",
6
- "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
8
- "scripts": {
9
- "build": "rm -rf lib && rollup --config rollup.config.js",
10
- "post:build": "node ./scripts/frankBuild.js",
11
- "build:lib": "npm run build && npm run post:build",
12
- "build:watch": "npm run build -- --watch",
13
- "dev": "npm run build:watch & npm run serve",
14
- "serve": "wds --watch --open",
15
- "test": "rm -rf test-outdir && rollup --config rollup.test.config.js && web-test-runner",
16
- "storybook": "npm run build && start-storybook -p 6006",
17
- "build-storybook": "rm -rf lib && npm run build && build-storybook",
18
- "prepare": "husky install"
19
- },
5
+ "main": "./umd/index.js",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
20
8
  "author": "",
21
9
  "license": "MIT",
22
10
  "dependencies": {
@@ -24,55 +12,10 @@
24
12
  "bootstrap": "^5.1.3",
25
13
  "lit": "^2.3.1"
26
14
  },
27
- "devDependencies": {
28
- "@babel/core": "^7.18.13",
29
- "@commitlint/cli": "^17.1.2",
30
- "@commitlint/config-conventional": "^17.1.0",
31
- "@esm-bundle/chai": "^4.3.4-fix.0",
32
- "@open-wc/storybook": "^0.2.8",
33
- "@open-wc/testing": "^3.0.0-next.5",
34
- "@playwright/test": "^1.27.0",
35
- "@rollup/plugin-node-resolve": "^11.2.1",
36
- "@rollup/plugin-replace": "^5.0.0",
37
- "@shoelace-style/shoelace": "^2.0.0-beta.83",
38
- "@storybook/addon-actions": "^6.5.16",
39
- "@storybook/addon-docs": "^6.5.16",
40
- "@storybook/addon-essentials": "^6.5.16",
41
- "@storybook/addon-controls": "^6.5.16",
42
- "@storybook/addon-links": "^6.5.16",
43
- "@storybook/builder-webpack5": "^6.5.16",
44
- "@storybook/manager-webpack5": "^6.5.16",
45
- "@storybook/preset-scss": "^1.0.3",
46
- "@storybook/web-components": "^6.5.16",
47
- "@types/bootstrap": "^5.2.4",
48
- "@web/dev-server": "^0.1.17",
49
- "@web/dev-server-esbuild": "^0.3.2",
50
- "@web/dev-server-rollup": "^0.3.19",
51
- "@web/dev-server-storybook": "^0.5.4",
52
- "@web/test-runner": "^0.14.0",
53
- "@web/test-runner-commands": "^0.6.5",
54
- "@web/test-runner-playwright": "^0.8.10",
55
- "autoprefixer": "^10.4.8",
56
- "babel-loader": "^8.2.5",
57
- "cz-conventional-changelog": "^3.3.0",
58
- "esbuild-sass-plugin": "^2.3.2",
59
- "husky": "^8.0.0",
60
- "postcss": "^8.2.13",
61
- "rollup": "^2.46.0",
62
- "rollup-plugin-generate-package-json": "^3.2.0",
63
- "rollup-plugin-postcss": "^4.0.0",
64
- "rollup-plugin-postcss-lit": "^1.0.1",
65
- "rollup-plugin-typescript2": "^0.33.0",
66
- "sass": "^1.54.4",
67
- "sass-loader": "^13.0.2",
68
- "sinon": "^14.0.0",
69
- "storybook-addon-web-components-knobs": "^0.3.20",
70
- "tslib": "^2.4.0",
71
- "typescript": "^4.2.4"
72
- },
73
15
  "config": {
74
16
  "commitizen": {
75
17
  "path": "./node_modules/cz-conventional-changelog"
76
18
  }
77
- }
78
- }
19
+ },
20
+ "private": false
21
+ }
@@ -1,22 +0,0 @@
1
- name: Publish Latest
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v[0-9]+.[0-9]+.[0-9]+'
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: actions/setup-node@v1
14
- with:
15
- node-version: 14
16
- registry-url: 'https://registry.npmjs.org'
17
- - run: npm ci
18
- - run: npm run test
19
- - run: npm run build:lib
20
- - run: npm publish --tag latest ./lib --access public
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,28 +0,0 @@
1
- name: Publish Pre-releases
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
7
- - 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
8
-
9
- jobs:
10
- publish:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/checkout@v2
14
- - name: Set Tag env
15
- run: echo "NPM_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
16
- - uses: actions/setup-node@v1
17
- with:
18
- node-version: 14
19
- registry-url: 'https://registry.npmjs.org'
20
- - run: npm ci
21
- - run: npm run test
22
- - run: npm run build:lib
23
- - run: npm publish --tag alpha ./lib
24
- if: contains(env.NPM_TAG, 'alpha')
25
- - run: npm publish --tag beta ./lib
26
- if: contains(env.NPM_TAG, 'beta')
27
- env:
28
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npx --no -- commitlint --edit
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- if [ -z "${2-}" ]; then
5
- # By default git hooks are not interactive. exec < /dev/tty allows a users terminal to interact with commitizen.
6
- exec < /dev/tty && npx cz --hook || true
7
- fi
8
-
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- "stories": [
3
- "../stories/**/*.stories.mdx",
4
- // "../stories/**/*.stories.@(js|jsx|ts|tsx)"
5
- ],
6
- "addons": [
7
- "@storybook/addon-links",
8
- "@storybook/addon-essentials",
9
- '@storybook/preset-scss',
10
- '@storybook/addon-controls'
11
- ],
12
- "framework": "@storybook/web-components",
13
- "core": {
14
- "builder": "@storybook/builder-webpack5"
15
- },
16
- }
@@ -1,11 +0,0 @@
1
- <link href='https://designsystem.gov.sg/css/sgds.css' rel='stylesheet' type='text/css' />
2
- <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css" rel='stylesheet'
3
- type='text/css' />
4
- <script type="module"
5
- src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.0.0-beta.83/dist/shoelace.js"></script>
6
- <script
7
- type="module"
8
- id="dev-console-gateway"
9
- src="https://assets.developer.tech.gov.sg/bundled-scripts/dev-console-gateway.bundle.js"
10
- ></script>
11
- <script src="../lib/index.js"></script>
@@ -1,9 +0,0 @@
1
- export const parameters = {
2
- actions: { argTypesRegex: "^on[A-Z].*" },
3
- controls: {
4
- matchers: {
5
- color: /(background|color)$/i,
6
- date: /Date$/,
7
- },
8
- },
9
- }
@@ -1,7 +0,0 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.background": "#203220",
4
- "titleBar.activeBackground": "#2C452D",
5
- "titleBar.activeForeground": "#FAFCFA"
6
- }
7
- }
package/CONTRIBUTING.md DELETED
@@ -1,56 +0,0 @@
1
- # Contributing Guide
2
- [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
3
-
4
- Thank you so much for contributing to @govtechsg/sgds-web-component. Please read this guideline before starting your development works.
5
-
6
- ## Development
7
-
8
- This project uses Lit 2.0 + SASS + TS and bundled with rollup
9
-
10
- ### Folder Structure
11
-
12
- Build new components in src folder. Create folder name according to the component you are building.
13
- SCSS files specific to the component should be stored here. Create an entry point (index.ts) file per folder to export the components/classes and its types/interface
14
-
15
- Place common/reusable functions and global stylings in utils folder
16
-
17
- ### Filename
18
- Custom elements must be in kebab case. Prefix the files with *-element.ts
19
-
20
- ## Testing
21
-
22
- Unit test is written in typescript, compiled to javascript by rollup, dumped into test-outdir. The resulting test-outdir/**.test.js files are run by web-test-runner. Configuration wise, rollup has plugins to convert sass files to css, but web-test-runner does not have great support for sass files atm. Hence, this approach was taken. See configurations in rollup.test.config.js and web-test-runner.config.mjs.
23
-
24
- All test needs to pass in order for aws amplify deployment build to pass
25
-
26
- ### Run single test file
27
-
28
- To run single test file, run the output javascript test file instead of the typescript file
29
- ```npm run test test-outdir/button-element.test.js```
30
-
31
- ## Storybook
32
-
33
- Write documentation in storybook in MDX format. Include API argstable, import instructions, at least a basic example and custom css properties table (if present)
34
-
35
- ## Publishing (for admin only)
36
- Library publication is performed in workflow by github actions. When ready for publishing, perform the following steps
37
-
38
- ##### Bump version
39
- 1) run ```npm version <major|minor|path> ```
40
- or for alpha releases
41
- ``` npm version <version-name> ```
42
- **version number should observe SEMVER
43
- **this step will auto-generate a git tag on your local
44
- 2) ```git push ``` the changes
45
-
46
- ##### Generate Changelog
47
- 3) run ```cz changelog``` to update CHANGELOG.md file (ensure that you have set up [cz-cli](https://github.com/commitizen/cz-cli) globally)
48
- **`cz changelog` updates based on your local git tags
49
- 4) Push the changes
50
-
51
- ##### Push git tag
52
- 4) run `git tag` to check the newly generated git tag on local
53
- 5) ```npm push origin <newly-created-tag> ```
54
- ** this triggers gh action workflow to publish the library to npm
55
- ##### Create a release
56
- 6) Manually create a release on github
package/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2021 Elliott Marquez and others
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/amplify.yml DELETED
@@ -1,22 +0,0 @@
1
- version: 1
2
- frontend:
3
- phases:
4
- preBuild:
5
- commands:
6
- - rm -rf node_modules && npm ci
7
- build:
8
- commands:
9
- - npm run test && npm run build-storybook
10
- artifacts:
11
- baseDirectory: /storybook-static
12
- files:
13
- - '**/*'
14
- # test:
15
- # phases:
16
- # test:
17
- # commands:
18
- # - npm run test
19
- # artifacts:
20
- # baseDirectory: coverage
21
- # configFilePath: '**/coverage-final.json'
22
- # files: '**/*'
@@ -1 +0,0 @@
1
- module.exports = {extends: ['@commitlint/config-conventional']}
@@ -1,224 +0,0 @@
1
- body, html {
2
- margin:0; padding: 0;
3
- height: 100%;
4
- }
5
- body {
6
- font-family: Helvetica Neue, Helvetica, Arial;
7
- font-size: 14px;
8
- color:#333;
9
- }
10
- .small { font-size: 12px; }
11
- *, *:after, *:before {
12
- -webkit-box-sizing:border-box;
13
- -moz-box-sizing:border-box;
14
- box-sizing:border-box;
15
- }
16
- h1 { font-size: 20px; margin: 0;}
17
- h2 { font-size: 14px; }
18
- pre {
19
- font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20
- margin: 0;
21
- padding: 0;
22
- -moz-tab-size: 2;
23
- -o-tab-size: 2;
24
- tab-size: 2;
25
- }
26
- a { color:#0074D9; text-decoration:none; }
27
- a:hover { text-decoration:underline; }
28
- .strong { font-weight: bold; }
29
- .space-top1 { padding: 10px 0 0 0; }
30
- .pad2y { padding: 20px 0; }
31
- .pad1y { padding: 10px 0; }
32
- .pad2x { padding: 0 20px; }
33
- .pad2 { padding: 20px; }
34
- .pad1 { padding: 10px; }
35
- .space-left2 { padding-left:55px; }
36
- .space-right2 { padding-right:20px; }
37
- .center { text-align:center; }
38
- .clearfix { display:block; }
39
- .clearfix:after {
40
- content:'';
41
- display:block;
42
- height:0;
43
- clear:both;
44
- visibility:hidden;
45
- }
46
- .fl { float: left; }
47
- @media only screen and (max-width:640px) {
48
- .col3 { width:100%; max-width:100%; }
49
- .hide-mobile { display:none!important; }
50
- }
51
-
52
- .quiet {
53
- color: #7f7f7f;
54
- color: rgba(0,0,0,0.5);
55
- }
56
- .quiet a { opacity: 0.7; }
57
-
58
- .fraction {
59
- font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60
- font-size: 10px;
61
- color: #555;
62
- background: #E8E8E8;
63
- padding: 4px 5px;
64
- border-radius: 3px;
65
- vertical-align: middle;
66
- }
67
-
68
- div.path a:link, div.path a:visited { color: #333; }
69
- table.coverage {
70
- border-collapse: collapse;
71
- margin: 10px 0 0 0;
72
- padding: 0;
73
- }
74
-
75
- table.coverage td {
76
- margin: 0;
77
- padding: 0;
78
- vertical-align: top;
79
- }
80
- table.coverage td.line-count {
81
- text-align: right;
82
- padding: 0 5px 0 20px;
83
- }
84
- table.coverage td.line-coverage {
85
- text-align: right;
86
- padding-right: 10px;
87
- min-width:20px;
88
- }
89
-
90
- table.coverage td span.cline-any {
91
- display: inline-block;
92
- padding: 0 5px;
93
- width: 100%;
94
- }
95
- .missing-if-branch {
96
- display: inline-block;
97
- margin-right: 5px;
98
- border-radius: 3px;
99
- position: relative;
100
- padding: 0 4px;
101
- background: #333;
102
- color: yellow;
103
- }
104
-
105
- .skip-if-branch {
106
- display: none;
107
- margin-right: 10px;
108
- position: relative;
109
- padding: 0 4px;
110
- background: #ccc;
111
- color: white;
112
- }
113
- .missing-if-branch .typ, .skip-if-branch .typ {
114
- color: inherit !important;
115
- }
116
- .coverage-summary {
117
- border-collapse: collapse;
118
- width: 100%;
119
- }
120
- .coverage-summary tr { border-bottom: 1px solid #bbb; }
121
- .keyline-all { border: 1px solid #ddd; }
122
- .coverage-summary td, .coverage-summary th { padding: 10px; }
123
- .coverage-summary tbody { border: 1px solid #bbb; }
124
- .coverage-summary td { border-right: 1px solid #bbb; }
125
- .coverage-summary td:last-child { border-right: none; }
126
- .coverage-summary th {
127
- text-align: left;
128
- font-weight: normal;
129
- white-space: nowrap;
130
- }
131
- .coverage-summary th.file { border-right: none !important; }
132
- .coverage-summary th.pct { }
133
- .coverage-summary th.pic,
134
- .coverage-summary th.abs,
135
- .coverage-summary td.pct,
136
- .coverage-summary td.abs { text-align: right; }
137
- .coverage-summary td.file { white-space: nowrap; }
138
- .coverage-summary td.pic { min-width: 120px !important; }
139
- .coverage-summary tfoot td { }
140
-
141
- .coverage-summary .sorter {
142
- height: 10px;
143
- width: 7px;
144
- display: inline-block;
145
- margin-left: 0.5em;
146
- background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147
- }
148
- .coverage-summary .sorted .sorter {
149
- background-position: 0 -20px;
150
- }
151
- .coverage-summary .sorted-desc .sorter {
152
- background-position: 0 -10px;
153
- }
154
- .status-line { height: 10px; }
155
- /* yellow */
156
- .cbranch-no { background: yellow !important; color: #111; }
157
- /* dark red */
158
- .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
159
- .low .chart { border:1px solid #C21F39 }
160
- .highlighted,
161
- .highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
162
- background: #C21F39 !important;
163
- }
164
- /* medium red */
165
- .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
166
- /* light red */
167
- .low, .cline-no { background:#FCE1E5 }
168
- /* light green */
169
- .high, .cline-yes { background:rgb(230,245,208) }
170
- /* medium green */
171
- .cstat-yes { background:rgb(161,215,106) }
172
- /* dark green */
173
- .status-line.high, .high .cover-fill { background:rgb(77,146,33) }
174
- .high .chart { border:1px solid rgb(77,146,33) }
175
- /* dark yellow (gold) */
176
- .status-line.medium, .medium .cover-fill { background: #f9cd0b; }
177
- .medium .chart { border:1px solid #f9cd0b; }
178
- /* light yellow */
179
- .medium { background: #fff4c2; }
180
-
181
- .cstat-skip { background: #ddd; color: #111; }
182
- .fstat-skip { background: #ddd; color: #111 !important; }
183
- .cbranch-skip { background: #ddd !important; color: #111; }
184
-
185
- span.cline-neutral { background: #eaeaea; }
186
-
187
- .coverage-summary td.empty {
188
- opacity: .5;
189
- padding-top: 4px;
190
- padding-bottom: 4px;
191
- line-height: 1;
192
- color: #888;
193
- }
194
-
195
- .cover-fill, .cover-empty {
196
- display:inline-block;
197
- height: 12px;
198
- }
199
- .chart {
200
- line-height: 0;
201
- }
202
- .cover-empty {
203
- background: white;
204
- }
205
- .cover-full {
206
- border-right: none !important;
207
- }
208
- pre.prettyprint {
209
- border: none !important;
210
- padding: 0 !important;
211
- margin: 0 !important;
212
- }
213
- .com { color: #999 !important; }
214
- .ignore-none { color: #999; font-weight: normal; }
215
-
216
- .wrapper {
217
- min-height: 100%;
218
- height: auto !important;
219
- height: 100%;
220
- margin: 0 auto -48px;
221
- }
222
- .footer, .push {
223
- height: 48px;
224
- }
@@ -1,87 +0,0 @@
1
- /* eslint-disable */
2
- var jumpToCode = (function init() {
3
- // Classes of code we would like to highlight in the file view
4
- var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
5
-
6
- // Elements to highlight in the file listing view
7
- var fileListingElements = ['td.pct.low'];
8
-
9
- // We don't want to select elements that are direct descendants of another match
10
- var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
11
-
12
- // Selecter that finds elements on the page to which we can jump
13
- var selector =
14
- fileListingElements.join(', ') +
15
- ', ' +
16
- notSelector +
17
- missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
18
-
19
- // The NodeList of matching elements
20
- var missingCoverageElements = document.querySelectorAll(selector);
21
-
22
- var currentIndex;
23
-
24
- function toggleClass(index) {
25
- missingCoverageElements
26
- .item(currentIndex)
27
- .classList.remove('highlighted');
28
- missingCoverageElements.item(index).classList.add('highlighted');
29
- }
30
-
31
- function makeCurrent(index) {
32
- toggleClass(index);
33
- currentIndex = index;
34
- missingCoverageElements.item(index).scrollIntoView({
35
- behavior: 'smooth',
36
- block: 'center',
37
- inline: 'center'
38
- });
39
- }
40
-
41
- function goToPrevious() {
42
- var nextIndex = 0;
43
- if (typeof currentIndex !== 'number' || currentIndex === 0) {
44
- nextIndex = missingCoverageElements.length - 1;
45
- } else if (missingCoverageElements.length > 1) {
46
- nextIndex = currentIndex - 1;
47
- }
48
-
49
- makeCurrent(nextIndex);
50
- }
51
-
52
- function goToNext() {
53
- var nextIndex = 0;
54
-
55
- if (
56
- typeof currentIndex === 'number' &&
57
- currentIndex < missingCoverageElements.length - 1
58
- ) {
59
- nextIndex = currentIndex + 1;
60
- }
61
-
62
- makeCurrent(nextIndex);
63
- }
64
-
65
- return function jump(event) {
66
- if (
67
- document.getElementById('fileSearch') === document.activeElement &&
68
- document.activeElement != null
69
- ) {
70
- // if we're currently focused on the search input, we don't want to navigate
71
- return;
72
- }
73
-
74
- switch (event.which) {
75
- case 78: // n
76
- case 74: // j
77
- goToNext();
78
- break;
79
- case 66: // b
80
- case 75: // k
81
- case 80: // p
82
- goToPrevious();
83
- break;
84
- }
85
- };
86
- })();
87
- window.addEventListener('keydown', jumpToCode);