diff --git a/package-lock.json b/package-lock.json index b5851440..8cfdb0c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6006,9 +6006,71 @@ "size-limit": "7.0.8" } }, + "node_modules/@stencil/core": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.19.1.tgz", + "integrity": "sha512-fjSBctHrobeSL2+XcuX7GVk/eaUhZ/lvIu21RJmzHAPcNyueuSAEv7J/Isn4UlYNk70o+yOK72H0FTlNkUibvw==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=16.0.0", + "npm": ">=7.10.0" + } + }, + "node_modules/@stencil/postcss": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@stencil/postcss/-/postcss-2.1.0.tgz", + "integrity": "sha512-/e4TYEXErGaHxH0ocg620YqEMLuMLpK/Wg4MJsiJglrLZCZhU4XCX1N0SwxaIOUbEZ1Zh+AqQ++yMI92ilndEA==", + "deprecated": "@stencil/postcss has been deprecated. Please see the community-driven package, '@stencil-community/postcss'", + "dev": true, + "dependencies": { + "autoprefixer": "^10.3.6", + "postcss": "~8.3.8" + }, + "peerDependencies": { + "@stencil/core": ">=2.0.0" + } + }, + "node_modules/@stencil/postcss/node_modules/postcss": { + "version": "8.3.11", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.11.tgz", + "integrity": "sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA==", + "dev": true, + "dependencies": { + "nanoid": "^3.1.30", + "picocolors": "^1.0.0", + "source-map-js": "^0.6.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/@stencil/postcss/node_modules/source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@stencil/sass": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@stencil/sass/-/sass-2.0.4.tgz", + "integrity": "sha512-tq+ZgJ9ynmag+e21cYmA6+YYJxBJapxjf94eL+uysxY78dM1801ydAhnT+64S5UnX8Jh+22uAuTY2bEYDBPUww==", + "dev": true, + "peerDependencies": { + "@stencil/core": ">=2.0.0 || >=3.0.0-beta.0" + } + }, "node_modules/@swc/core": { "version": "1.3.70", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "engines": { @@ -6044,7 +6106,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -6206,7 +6267,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -6223,7 +6283,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -6240,7 +6299,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -6257,7 +6315,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -6274,7 +6331,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -6291,7 +6347,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -6308,7 +6363,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -6325,7 +6379,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -6342,7 +6395,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -6362,7 +6414,6 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.3.tgz", "integrity": "sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==", - "dev": true, "optional": true, "peer": true, "dependencies": { @@ -6377,12 +6428,37 @@ }, "node_modules/@tailwindcss/aspect-ratio": { "version": "0.4.2", - "dev": true, "license": "MIT", "peerDependencies": { "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" } }, + "node_modules/@tailwindcss/forms": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", + "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", + "dev": true, + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" + } + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.13.tgz", + "integrity": "sha512-ADGcJ8dX21dVVHIwTRgzrcunY6YY9uSlAHHGVKvkA+vLc5qLwEszvKts40lx7z0qc4clpjclwLeK5rVCV2P/uw==", + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -13394,6 +13470,14 @@ "loose-envify": "^1.0.0" } }, + "node_modules/ionicons": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-7.4.0.tgz", + "integrity": "sha512-ZK94MMqgzMCPPMhmk8Ouu6goyVHFIlw/ACP6oe3FrikcI0N7CX0xcwVaEbUc0G/v3W0shI93vo+9ve/KpvcNhQ==", + "dependencies": { + "@stencil/core": "^4.0.3" + } + }, "node_modules/is-alphabetical": { "version": "2.0.1", "dev": true, @@ -15697,7 +15781,6 @@ }, "node_modules/lodash.castarray": { "version": "4.4.0", - "dev": true, "license": "MIT" }, "node_modules/lodash.debounce": { @@ -15712,7 +15795,6 @@ }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "dev": true, "license": "MIT" }, "node_modules/lodash.memoize": { @@ -15722,7 +15804,6 @@ }, "node_modules/lodash.merge": { "version": "4.6.2", - "dev": true, "license": "MIT" }, "node_modules/lodash.uniq": { @@ -18438,6 +18519,21 @@ "postcss": "^8.2.15" } }, + "node_modules/postcss-combine-duplicated-selectors": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/postcss-combine-duplicated-selectors/-/postcss-combine-duplicated-selectors-10.0.3.tgz", + "integrity": "sha512-IP0BmwFloCskv7DV7xqvzDXqMHpwdczJa6ZvIW8abgHdcIHs9mCJX2ltFhu3EwA51ozp13DByng30+Ke+eIExA==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/postcss-convert-values": { "version": "5.1.3", "dev": true, @@ -18921,7 +19017,6 @@ }, "node_modules/postcss-selector-parser": { "version": "6.0.10", - "dev": true, "license": "MIT", "dependencies": { "cssesc": "^3.0.0", @@ -20819,6 +20914,156 @@ "node": ">= 0.6" } }, + "node_modules/stencil-tailwind-plugin": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/stencil-tailwind-plugin/-/stencil-tailwind-plugin-1.8.0.tgz", + "integrity": "sha512-39vFtvTy+Pi5leroD6pY9H1DMKKCpYDPInTSwKJrOkgfT0v9K+KWOG9NSuO4G0eJfF27R7G6NIjP3Bsi10iLsg==", + "dev": true, + "dependencies": { + "autoprefixer": "^10.4.7", + "chalk": "^4.1.2", + "cssnano": "^5.1.12", + "fs-extra": "^10.0.0", + "p-queue": "^6.6.2", + "postcss": "^8.4.14", + "postcss-combine-duplicated-selectors": "^10.0.3", + "postcss-discard-comments": "^5.1.2", + "postcss-load-config": "^4.0.1" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.7", + "typescript": ">=4.4.2" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/stencil-tailwind-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/lilconfig": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stencil-tailwind-plugin/node_modules/yaml": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "dev": true, @@ -21359,6 +21604,10 @@ "node": ">= 14" } }, + "node_modules/tc-web": { + "resolved": "packages/tc-web", + "link": true + }, "node_modules/term-size": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", @@ -25311,6 +25560,38 @@ }, "packages/tailwind-config-design-system": { "name": "@uzh-bf/tailwind-config-design-system" + }, + "packages/tc-web": { + "version": "0.0.6", + "dependencies": { + "@stencil/core": "^4.18.3", + "@tailwindcss/aspect-ratio": "^0.4.2", + "@tailwindcss/typography": "^0.5.12", + "ionicons": "^7.3.1" + }, + "devDependencies": { + "@stencil/postcss": "^2.1.0", + "@stencil/sass": "^2.0.0", + "@tailwindcss/forms": "^0.5.3", + "autoprefixer": "^10.4.13", + "cssnano": "^5.1.14", + "stencil-tailwind-plugin": "^1.8.0", + "tailwindcss": "^3.2.4", + "typescript": "^5.2.2" + } + }, + "packages/tc-web/node_modules/typescript": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } } } } diff --git a/packages/tc-web/.editorconfig b/packages/tc-web/.editorconfig new file mode 100644 index 00000000..f1cc3ad3 --- /dev/null +++ b/packages/tc-web/.editorconfig @@ -0,0 +1,15 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/packages/tc-web/README.md b/packages/tc-web/README.md new file mode 100644 index 00000000..99c58e37 --- /dev/null +++ b/packages/tc-web/README.md @@ -0,0 +1,134 @@ +# TC Webcomponent + +Latest version published "tc-web@0.0.6" + +This repo is for the web-components library for the TC. Technologies used are stencil-tailwind-plugin and StencilJS. + +## How to use the Components in Magnolia (or other CMS) + +Create a new Component in Magnolia. + +Adding a component in Magnolia + +Make sure you create it as a HTML component. + +Make sure to select a HTML Component + +A code field then appears. + +### Import library + +To use these webcomponents you must import the library. + +#### Import specific version (recommended) + +To get a **specific version of this libary** recommended and won't be affected by change in the code you can get by running: +Usually you want to get the most recent version published, but want to fix it to that version, since future versions may not suport the elements you are using. + +```html + +``` + +If for instance you want to get version 1.2.3: + +```html + +``` + +#### Always get latest version (not recommended) + +To get the latest version, **not recommend**. you can install it like this. + +```html + +``` + +### How to use a component + +Make sure that you have first imported the library. + +Example + +```html + +``` + +Decide which component you want. +To figure out **what parameters each component takes** and how this needs to be adressed in the html, go to the readme file of the component. +You can find it, as follows: + +``` +src/components/TheComponent/readme.md +``` + +If you click [here](src\components\tc-testimonial\readme.md) you will see the example, for tc-testimonial. + +## To make changes to the libary here is how you can get started + +Clone the repo, and install the dependencies: + +```shell +cd tc-web +npm install +``` + +Start the stencil dev server: + +```shell +npm start +``` + +If you would like to build the application: + +```shell +npm run build +``` + +## UZH Fonts & Colorpalette + +To make sure that the fonts and styling are aligned with the [UZH Theme](https://www.frontend.uzh.ch/style/current/) +and the [UZH Color Palette](https://www.cd.uzh.ch/de/elements.html#UZH-Farben), custom fonts and colors where added to the [tailwind configuration file](tailwind.config.js). + +### Custom colors (for development and parametrization purposes) + +uzhblue: "#0028A5" +uzhcyan: "#4AC9E3", +uzhapple: "#A4D233", +uzhgold: "#FFC845", +uzhorange: "FC4C02", +uzhberry: "#BF0D3E", +uzhlgrey2: "#EFEFEF", +uzhlgrey3: "#E7E7E7" + +### Adding colors yourself + +For specfic elements like the sections you can modify the color. +You can **input color as a hex string** like below (currently we are setting it to black) + +```html + + +``` + +Or like this in **rgb format** + +```html + + +``` + +### Fonts + +The UZH page uses "[Source Sans 3](https://fonts.google.com/specimen/Source+Sans+3)", previously known as "Source Sans Pro", as default font. +To use it, you can "font-sans". +Make sure to apply it to each component, to use it. diff --git a/packages/tc-web/ReadMeImages/Add_Component_Magnolia.png b/packages/tc-web/ReadMeImages/Add_Component_Magnolia.png new file mode 100644 index 00000000..0f02a213 Binary files /dev/null and b/packages/tc-web/ReadMeImages/Add_Component_Magnolia.png differ diff --git a/packages/tc-web/ReadMeImages/HTML_Select.png b/packages/tc-web/ReadMeImages/HTML_Select.png new file mode 100644 index 00000000..a02f290f Binary files /dev/null and b/packages/tc-web/ReadMeImages/HTML_Select.png differ diff --git a/packages/tc-web/TODO.md b/packages/tc-web/TODO.md new file mode 100644 index 00000000..3fedb879 --- /dev/null +++ b/packages/tc-web/TODO.md @@ -0,0 +1,45 @@ +# Tasks to be done + +## Move towards Generalistic approach + +Currently one can reproduce the current page, however it requires the user to be aware of the existing structure. +E.g. _"tc-advantage-column"_ only has meaning to a user if he _knows the structure of the page._ + +One goal is to be able to use web components flexible on several pages. +So one needs to **refactor.** +Find suitable names for the individual components. + +## (Maybe) Create individual packages for each component + +For a faster loading of web-components, break each component into its own library + +**Pro**: + +- faster loading time (how much though) +- when testing with Max last week it is pretty fast currently + +**Con**: + +- More organization required. +- You need one home repo linking to other repos +- If one updates 5 components I will need to publish each indivudally and then update for each one of them on Magnolia +- possible names for the libray could become a mess + +I think this is a "**Performance vs Code Quality**" question. +In my opinion I thik performance is ok, so one could stick with this solution. However I do so a situation where this project becomes massive and it then makes sense to break it down into smaller chunks. + +## Transfer Repo to DF & and NPM logedin with my private account + +- Currently I own the Github repo. +- The npm pckg **tc-web** is linked to my private account. + +## Apart from code general doc + +## Code + +- [ ] For components add documentation +- [ ] Generalize names +- [ ] Functions that are used in several components refactor to utilty func, so it is only used once +- [ ] see how available jobs acts when having no jobs available +- [ ] styling for project parts +- [ ] in general be aware end user can be a non-it proffesional diff --git a/packages/tc-web/docs/assets/clock-regular-brown.svg b/packages/tc-web/docs/assets/clock-regular-brown.svg new file mode 100644 index 00000000..f5b887eb --- /dev/null +++ b/packages/tc-web/docs/assets/clock-regular-brown.svg @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/packages/tc-web/docs/assets/code-branch-solid.svg b/packages/tc-web/docs/assets/code-branch-solid.svg new file mode 100644 index 00000000..e881d002 --- /dev/null +++ b/packages/tc-web/docs/assets/code-branch-solid.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/docs/assets/code-branch-solid_white.svg b/packages/tc-web/docs/assets/code-branch-solid_white.svg new file mode 100644 index 00000000..18c82425 --- /dev/null +++ b/packages/tc-web/docs/assets/code-branch-solid_white.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/docs/assets/dollar-sign-white.svg b/packages/tc-web/docs/assets/dollar-sign-white.svg new file mode 100644 index 00000000..d5f9127c --- /dev/null +++ b/packages/tc-web/docs/assets/dollar-sign-white.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/docs/assets/team-white.svg b/packages/tc-web/docs/assets/team-white.svg new file mode 100644 index 00000000..de870b61 --- /dev/null +++ b/packages/tc-web/docs/assets/team-white.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/packages/tc-web/docs/host.config.json b/packages/tc-web/docs/host.config.json new file mode 100644 index 00000000..f4314c75 --- /dev/null +++ b/packages/tc-web/docs/host.config.json @@ -0,0 +1,15 @@ +{ + "hosting": { + "headers": [ + { + "source": "/build/p-*", + "headers": [ + { + "key": "Cache-Control", + "value": "max-age=31556952, s-maxage=31556952, immutable" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/packages/tc-web/docs/index.html b/packages/tc-web/docs/index.html new file mode 100644 index 00000000..55a483e8 --- /dev/null +++ b/packages/tc-web/docs/index.html @@ -0,0 +1,26 @@ + TC WEB \ No newline at end of file diff --git a/packages/tc-web/loader/cdn.js b/packages/tc-web/loader/cdn.js new file mode 100644 index 00000000..45e7d5ab --- /dev/null +++ b/packages/tc-web/loader/cdn.js @@ -0,0 +1 @@ +module.exports = require('../dist/cjs/loader.cjs.js'); \ No newline at end of file diff --git a/packages/tc-web/loader/index.cjs.js b/packages/tc-web/loader/index.cjs.js new file mode 100644 index 00000000..45e7d5ab --- /dev/null +++ b/packages/tc-web/loader/index.cjs.js @@ -0,0 +1 @@ +module.exports = require('../dist/cjs/loader.cjs.js'); \ No newline at end of file diff --git a/packages/tc-web/loader/index.d.ts b/packages/tc-web/loader/index.d.ts new file mode 100644 index 00000000..eed17ccf --- /dev/null +++ b/packages/tc-web/loader/index.d.ts @@ -0,0 +1,21 @@ +export * from '../dist/types/components'; +export interface CustomElementsDefineOptions { + exclude?: string[]; + resourcesUrl?: string; + syncQueue?: boolean; + jmp?: (c: Function) => any; + raf?: (c: FrameRequestCallback) => number; + ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; + rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void; +} +export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void; +export declare function applyPolyfills(): Promise; + +/** + * Used to specify a nonce value that corresponds with an application's CSP. + * When set, the nonce will be added to all dynamically created script and style tags at runtime. + * Alternatively, the nonce value can be set on a meta tag in the DOM head + * () which + * will result in the same behavior. + */ +export declare function setNonce(nonce: string): void; diff --git a/packages/tc-web/loader/index.es2017.js b/packages/tc-web/loader/index.es2017.js new file mode 100644 index 00000000..15b1d13d --- /dev/null +++ b/packages/tc-web/loader/index.es2017.js @@ -0,0 +1 @@ +export * from '../dist/esm/loader.js'; \ No newline at end of file diff --git a/packages/tc-web/loader/index.js b/packages/tc-web/loader/index.js new file mode 100644 index 00000000..8e1a393b --- /dev/null +++ b/packages/tc-web/loader/index.js @@ -0,0 +1,2 @@ +(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})(); +export * from '../dist/esm/loader.js'; \ No newline at end of file diff --git a/packages/tc-web/loader/package.json b/packages/tc-web/loader/package.json new file mode 100644 index 00000000..7303cfeb --- /dev/null +++ b/packages/tc-web/loader/package.json @@ -0,0 +1,11 @@ +{ + "name": "stencil-component-example-loader", + "private": true, + "typings": "./index.d.ts", + "module": "./index.js", + "main": "./index.cjs.js", + "jsnext:main": "./index.es2017.js", + "es2015": "./index.es2017.js", + "es2017": "./index.es2017.js", + "unpkg": "./cdn.js" +} \ No newline at end of file diff --git a/packages/tc-web/package.json b/packages/tc-web/package.json new file mode 100644 index 00000000..5ae68360 --- /dev/null +++ b/packages/tc-web/package.json @@ -0,0 +1,40 @@ +{ + "name": "tc-web", + "version": "0.0.6", + "description": "Stencil components for TC website", + "main": "dist/index.cjs.js", + "module": "./dist/index.js", + "es2015": "dist/esm/index.mjs", + "es2017": "dist/esm/index.mjs", + "types": "dist/types/index.d.ts", + "collection": "dist/collection/collection-manifest.json", + "collection:main": "dist/collection/index.js", + "unpkg": "dist/stencil-component-example/stencil-component-example.esm.js", + "files": [ + "dist/", + "loader/" + ], + "scripts": { + "build": "stencil build --docs", + "start": "stencil build --dev --watch --serve", + "test": "stencil test --spec --e2e", + "test.watch": "stencil test --spec --e2e --watchAll", + "generate": "stencil generate" + }, + "dependencies": { + "@stencil/core": "^4.18.3", + "@tailwindcss/aspect-ratio": "^0.4.2", + "@tailwindcss/typography": "^0.5.12", + "ionicons": "^7.3.1" + }, + "devDependencies": { + "@stencil/postcss": "^2.1.0", + "@stencil/sass": "^2.0.0", + "@tailwindcss/forms": "^0.5.3", + "autoprefixer": "^10.4.13", + "cssnano": "^5.1.14", + "stencil-tailwind-plugin": "^1.8.0", + "tailwindcss": "^3.2.4", + "typescript": "^5.2.2" + } +} diff --git a/packages/tc-web/src/assets/clock-regular-brown.svg b/packages/tc-web/src/assets/clock-regular-brown.svg new file mode 100644 index 00000000..f5b887eb --- /dev/null +++ b/packages/tc-web/src/assets/clock-regular-brown.svg @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/packages/tc-web/src/assets/code-branch-solid.svg b/packages/tc-web/src/assets/code-branch-solid.svg new file mode 100644 index 00000000..e881d002 --- /dev/null +++ b/packages/tc-web/src/assets/code-branch-solid.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/src/assets/code-branch-solid_white.svg b/packages/tc-web/src/assets/code-branch-solid_white.svg new file mode 100644 index 00000000..18c82425 --- /dev/null +++ b/packages/tc-web/src/assets/code-branch-solid_white.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/src/assets/dollar-sign-white.svg b/packages/tc-web/src/assets/dollar-sign-white.svg new file mode 100644 index 00000000..d5f9127c --- /dev/null +++ b/packages/tc-web/src/assets/dollar-sign-white.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/tc-web/src/assets/team-white.svg b/packages/tc-web/src/assets/team-white.svg new file mode 100644 index 00000000..de870b61 --- /dev/null +++ b/packages/tc-web/src/assets/team-white.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/packages/tc-web/src/components.d.ts b/packages/tc-web/src/components.d.ts new file mode 100644 index 00000000..810e8ba8 --- /dev/null +++ b/packages/tc-web/src/components.d.ts @@ -0,0 +1,244 @@ +/* eslint-disable */ +/* tslint:disable */ +/** + * This is an autogenerated file created by the Stencil compiler. + * It contains typing information for all components that exist in this project. + */ +import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; +export namespace Components { + interface SegmentContainer { + "backgroundColor": string; + "segTitle": string; + } + interface TcBulletpointList { + "backgroundColor": string; + "bulletpoints": "[]"; + "header": string; + } + interface TcCollapsible { + "backgroundColor": string; + "colTitle": string; + "description": string; + "tags": string; + } + interface TcGridContainer { + "backgroundColor": string; + "columns": number; + "gap": string; + "lgColumns": number; + "mdColumns": number; + } + interface TcGridItem { + "giTitle": string; + "imageSrc": string; + "link": string; + "width": string; + } + interface TcImgQuoteCard { + "altText": string; + "backgroundColor": string; + "borderColor": string; + "imageOnLeft": boolean; + "imageSrc": string; + "pro": string; + "quote": string; + "quotee": string; + } + interface TcImgTextCard { + "borderColor": string; + "detailedDescription": string; + "imageOnLeft": boolean; + "imageSrc": string; + "shortDescription": string; + "tcImgTextCardTitle": string; + } + interface TcJobListing { + "description": string; + "imageSrc": string; + "jobTitle": string; + "tags": string; + } + interface TcOpenPositions { + "level": string; + } + interface TcSvgIconCard { + "advantageTitle": string; + "backgroundColor": string; + "iconBackground": string; + "iconColor": string; + "iconSvgPath": string; + "iconSvgViewBox": string; + "iconSvgXmlns": string; + "text": string; + } +} +declare global { + interface HTMLSegmentContainerElement extends Components.SegmentContainer, HTMLStencilElement { + } + var HTMLSegmentContainerElement: { + prototype: HTMLSegmentContainerElement; + new (): HTMLSegmentContainerElement; + }; + interface HTMLTcBulletpointListElement extends Components.TcBulletpointList, HTMLStencilElement { + } + var HTMLTcBulletpointListElement: { + prototype: HTMLTcBulletpointListElement; + new (): HTMLTcBulletpointListElement; + }; + interface HTMLTcCollapsibleElement extends Components.TcCollapsible, HTMLStencilElement { + } + var HTMLTcCollapsibleElement: { + prototype: HTMLTcCollapsibleElement; + new (): HTMLTcCollapsibleElement; + }; + interface HTMLTcGridContainerElement extends Components.TcGridContainer, HTMLStencilElement { + } + var HTMLTcGridContainerElement: { + prototype: HTMLTcGridContainerElement; + new (): HTMLTcGridContainerElement; + }; + interface HTMLTcGridItemElement extends Components.TcGridItem, HTMLStencilElement { + } + var HTMLTcGridItemElement: { + prototype: HTMLTcGridItemElement; + new (): HTMLTcGridItemElement; + }; + interface HTMLTcImgQuoteCardElement extends Components.TcImgQuoteCard, HTMLStencilElement { + } + var HTMLTcImgQuoteCardElement: { + prototype: HTMLTcImgQuoteCardElement; + new (): HTMLTcImgQuoteCardElement; + }; + interface HTMLTcImgTextCardElement extends Components.TcImgTextCard, HTMLStencilElement { + } + var HTMLTcImgTextCardElement: { + prototype: HTMLTcImgTextCardElement; + new (): HTMLTcImgTextCardElement; + }; + interface HTMLTcJobListingElement extends Components.TcJobListing, HTMLStencilElement { + } + var HTMLTcJobListingElement: { + prototype: HTMLTcJobListingElement; + new (): HTMLTcJobListingElement; + }; + interface HTMLTcOpenPositionsElement extends Components.TcOpenPositions, HTMLStencilElement { + } + var HTMLTcOpenPositionsElement: { + prototype: HTMLTcOpenPositionsElement; + new (): HTMLTcOpenPositionsElement; + }; + interface HTMLTcSvgIconCardElement extends Components.TcSvgIconCard, HTMLStencilElement { + } + var HTMLTcSvgIconCardElement: { + prototype: HTMLTcSvgIconCardElement; + new (): HTMLTcSvgIconCardElement; + }; + interface HTMLElementTagNameMap { + "segment-container": HTMLSegmentContainerElement; + "tc-bulletpoint-list": HTMLTcBulletpointListElement; + "tc-collapsible": HTMLTcCollapsibleElement; + "tc-grid-container": HTMLTcGridContainerElement; + "tc-grid-item": HTMLTcGridItemElement; + "tc-img-quote-card": HTMLTcImgQuoteCardElement; + "tc-img-text-card": HTMLTcImgTextCardElement; + "tc-job-listing": HTMLTcJobListingElement; + "tc-open-positions": HTMLTcOpenPositionsElement; + "tc-svg-icon-card": HTMLTcSvgIconCardElement; + } +} +declare namespace LocalJSX { + interface SegmentContainer { + "backgroundColor"?: string; + "segTitle"?: string; + } + interface TcBulletpointList { + "backgroundColor"?: string; + "bulletpoints"?: "[]"; + "header"?: string; + } + interface TcCollapsible { + "backgroundColor"?: string; + "colTitle"?: string; + "description"?: string; + "tags"?: string; + } + interface TcGridContainer { + "backgroundColor"?: string; + "columns"?: number; + "gap"?: string; + "lgColumns"?: number; + "mdColumns"?: number; + } + interface TcGridItem { + "giTitle"?: string; + "imageSrc"?: string; + "link"?: string; + "width"?: string; + } + interface TcImgQuoteCard { + "altText"?: string; + "backgroundColor"?: string; + "borderColor"?: string; + "imageOnLeft"?: boolean; + "imageSrc"?: string; + "pro"?: string; + "quote"?: string; + "quotee"?: string; + } + interface TcImgTextCard { + "borderColor"?: string; + "detailedDescription"?: string; + "imageOnLeft"?: boolean; + "imageSrc"?: string; + "shortDescription"?: string; + "tcImgTextCardTitle"?: string; + } + interface TcJobListing { + "description"?: string; + "imageSrc"?: string; + "jobTitle"?: string; + "tags"?: string; + } + interface TcOpenPositions { + "level"?: string; + } + interface TcSvgIconCard { + "advantageTitle"?: string; + "backgroundColor"?: string; + "iconBackground"?: string; + "iconColor"?: string; + "iconSvgPath"?: string; + "iconSvgViewBox"?: string; + "iconSvgXmlns"?: string; + "text"?: string; + } + interface IntrinsicElements { + "segment-container": SegmentContainer; + "tc-bulletpoint-list": TcBulletpointList; + "tc-collapsible": TcCollapsible; + "tc-grid-container": TcGridContainer; + "tc-grid-item": TcGridItem; + "tc-img-quote-card": TcImgQuoteCard; + "tc-img-text-card": TcImgTextCard; + "tc-job-listing": TcJobListing; + "tc-open-positions": TcOpenPositions; + "tc-svg-icon-card": TcSvgIconCard; + } +} +export { LocalJSX as JSX }; +declare module "@stencil/core" { + export namespace JSX { + interface IntrinsicElements { + "segment-container": LocalJSX.SegmentContainer & JSXBase.HTMLAttributes; + "tc-bulletpoint-list": LocalJSX.TcBulletpointList & JSXBase.HTMLAttributes; + "tc-collapsible": LocalJSX.TcCollapsible & JSXBase.HTMLAttributes; + "tc-grid-container": LocalJSX.TcGridContainer & JSXBase.HTMLAttributes; + "tc-grid-item": LocalJSX.TcGridItem & JSXBase.HTMLAttributes; + "tc-img-quote-card": LocalJSX.TcImgQuoteCard & JSXBase.HTMLAttributes; + "tc-img-text-card": LocalJSX.TcImgTextCard & JSXBase.HTMLAttributes; + "tc-job-listing": LocalJSX.TcJobListing & JSXBase.HTMLAttributes; + "tc-open-positions": LocalJSX.TcOpenPositions & JSXBase.HTMLAttributes; + "tc-svg-icon-card": LocalJSX.TcSvgIconCard & JSXBase.HTMLAttributes; + } + } +} diff --git a/packages/tc-web/src/components/positions/tc-job-listing/readme.md b/packages/tc-web/src/components/positions/tc-job-listing/readme.md new file mode 100644 index 00000000..2b20ec93 --- /dev/null +++ b/packages/tc-web/src/components/positions/tc-job-listing/readme.md @@ -0,0 +1,18 @@ +# tc-job-listing + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ------------- | ------------- | ----------- | -------- | ----------- | +| `description` | `description` | | `string` | `undefined` | +| `imageSrc` | `image-src` | | `string` | `undefined` | +| `jobTitle` | `job-title` | | `string` | `undefined` | +| `tags` | `tags` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.css b/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.tsx b/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.tsx new file mode 100644 index 00000000..1bea089e --- /dev/null +++ b/packages/tc-web/src/components/positions/tc-job-listing/tc-job-listing.tsx @@ -0,0 +1,39 @@ +import { Component, Prop, h } from "@stencil/core"; +import { parseTags } from "../../../util/util"; + +@Component({ + tag: "tc-job-listing", + styleUrl: "tc-job-listing.css", + shadow: true, +}) +export class JobListing { + @Prop() jobTitle: string; + @Prop() description: string; + @Prop() tags: string; + @Prop() imageSrc: string; + + render() { + return ( +
+
+
{this.jobTitle}
+

{this.description}

+
    + {parseTags(this.tags).map((tag) => ( +
    + {tag} +
    + ))} +
+
+
+ Job related image +
+
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-bulletpoint-list/readme.md b/packages/tc-web/src/components/tc-bulletpoint-list/readme.md new file mode 100644 index 00000000..77ec3f8e --- /dev/null +++ b/packages/tc-web/src/components/tc-bulletpoint-list/readme.md @@ -0,0 +1,17 @@ +# tc-prerequisite + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------ | ----------- | -------- | ---------------------- | +| `backgroundColor` | `background-color` | | `string` | `"rgb(255, 255, 255)"` | +| `bulletpoints` | `bulletpoints` | | `"[]"` | `undefined` | +| `header` | `title` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.css b/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.tsx b/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.tsx new file mode 100644 index 00000000..1fd09768 --- /dev/null +++ b/packages/tc-web/src/components/tc-bulletpoint-list/tc-bulletpoint-list.tsx @@ -0,0 +1,42 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-bulletpoint-list", + styleUrl: "tc-bulletpoint-list.css", + shadow: true, +}) +export class BulletpointList { + @Prop({ attribute: "title" }) header: string; + @Prop() bulletpoints: "[]"; + @Prop() backgroundColor: string = "rgb(255, 255, 255)"; + + get bulletpointArray() { + try { + return JSON.parse(this.bulletpoints); + } catch (e) { + console.error("Error parsing tags:", e); + return []; + } + } + + render() { + return ( +
+

+ {this.header} +

+ +
    + {this.bulletpointArray.map((bulletpoint, index) => ( +
  • + {bulletpoint} +
  • + ))} +
+
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-collapsible/readme.md b/packages/tc-web/src/components/tc-collapsible/readme.md new file mode 100644 index 00000000..b8f27806 --- /dev/null +++ b/packages/tc-web/src/components/tc-collapsible/readme.md @@ -0,0 +1,18 @@ +# tc-project + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------ | ----------- | -------- | ---------------------- | +| `backgroundColor` | `background-color` | | `string` | `"rgb(255, 255, 255)"` | +| `colTitle` | `col-title` | | `string` | `undefined` | +| `description` | `description` | | `string` | `""` | +| `tags` | `tags` | | `string` | `"[]"` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-collapsible/tc-collapsible.css b/packages/tc-web/src/components/tc-collapsible/tc-collapsible.css new file mode 100644 index 00000000..bcc75575 --- /dev/null +++ b/packages/tc-web/src/components/tc-collapsible/tc-collapsible.css @@ -0,0 +1,3 @@ +:host() { + display: block; +} diff --git a/packages/tc-web/src/components/tc-collapsible/tc-collapsible.tsx b/packages/tc-web/src/components/tc-collapsible/tc-collapsible.tsx new file mode 100644 index 00000000..36a13c37 --- /dev/null +++ b/packages/tc-web/src/components/tc-collapsible/tc-collapsible.tsx @@ -0,0 +1,65 @@ +import { Component, h, Prop, State } from "@stencil/core"; +import { parseTags } from "../../util/util"; + +@Component({ + tag: "tc-collapsible", + styleUrl: "tc-collapsible.css", + shadow: true, +}) +export class TcCollapsible { + @Prop() colTitle: string; + @Prop() description: string = ""; + @Prop() tags: string = "[]"; + @Prop() backgroundColor: string = "rgb(255, 255, 255)"; + + @State() showDetails: boolean = false; + toggleDetails = () => { + this.showDetails = !this.showDetails; + }; + + render() { + return ( +
+
+
+

+ {this.colTitle} +

+
{this.description}
+
+ +
+
+
+ {parseTags(this.tags).map((tag) => ( +
+ {tag} +
+ ))} +
+
+ {this.showDetails && } +
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-grid-container/readme.md b/packages/tc-web/src/components/tc-grid-container/readme.md new file mode 100644 index 00000000..f0d3ef52 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-container/readme.md @@ -0,0 +1,19 @@ +# tc-grid-container + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------ | ----------- | -------- | ---------------------- | +| `backgroundColor` | `background-color` | | `string` | `"rgb(255, 255, 255)"` | +| `columns` | `columns` | | `number` | `1` | +| `gap` | `gap` | | `string` | `""` | +| `lgColumns` | `lg-columns` | | `number` | `4` | +| `mdColumns` | `md-columns` | | `number` | `2` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-grid-container/tc-grid-container.css b/packages/tc-web/src/components/tc-grid-container/tc-grid-container.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-container/tc-grid-container.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-grid-container/tc-grid-container.tsx b/packages/tc-web/src/components/tc-grid-container/tc-grid-container.tsx new file mode 100644 index 00000000..02d7e663 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-container/tc-grid-container.tsx @@ -0,0 +1,94 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-grid-container", + shadow: true, + styleUrl: "tc-grid-container.css", +}) +export class TcGridContainer { + @Prop() mdColumns: 1|2|3|4|5|6 = 2; + @Prop() lgColumns: 1|2|3|4|5|6 = 4; + @Prop() columns: 1|2|3|4|5|6 = 1; + @Prop() gap: 'sm' | 'md' | 'lg' | 'xl' = "md"; + @Prop() backgroundColor: string = "rgb(255, 255, 255)"; + + // Default to 2 columns + + render() { + const gridClasses = `grid ${this.getMdColumns()} ${this.getColumns()} ${this.getGap()} ${this.getLgColumns()}`; + return ( +
+ +
+ ); + } + + private getMdColumns(): string { + switch (this.mdColumns) { + case 1: + return "md:grid-cols-1"; + case 2: + return "md:grid-cols-2"; + case 3: + return "md:grid-cols-3 "; + case 4: + return "md:grid-cols-4 "; + case 5: + return "md:grid-cols-5 "; + case 6: + return "md:grid-cols-6"; + } + } + + private getLgColumns(): string { + switch (this.lgColumns) { + case 1: + return "lg:grid-cols-1"; + case 2: + return "lg:grid-cols-2"; + case 3: + return "lg:grid-cols-3"; + case 4: + return "lg:grid-cols-4"; + case 5: + return "lg:grid-cols-5"; + case 6: + return "lg:grid-cols-6"; + } + } + + private getColumns(): string { + switch (this.columns) { + case 1: + return "grid-cols-1"; + case 2: + return "grid-cols-2 "; + case 3: + return "grid-cols-3"; + case 4: + return "grid-cols-4"; + case 5: + return "grid-cols-5"; + case 6: + return "grid-cols-6"; + } + } + + private getGap(): string { + switch (this.gap) { + case "sm": + return "gap-2 md:gap-4 lg:gap-6"; + case "md": + return "gap-4 md:gap-8 lg:gap-12"; + case "lg": + return "gap-8 md:gap-12 lg:gap-16"; + case "xl": + return "gap-12 md:gap-16 lg: gap-20"; + default: + return `gap-4 md:gap-8 lg:gap-12`; + } + } +} diff --git a/packages/tc-web/src/components/tc-grid-item/readme.md b/packages/tc-web/src/components/tc-grid-item/readme.md new file mode 100644 index 00000000..bcccdd36 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-item/readme.md @@ -0,0 +1,18 @@ +# tc-framework-item + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ---------- | ----------- | ----------- | -------- | ----------- | +| `giTitle` | `title` | | `string` | `undefined` | +| `imageSrc` | `image-src` | | `string` | `undefined` | +| `link` | `link` | | `string` | `undefined` | +| `width` | `width` | | `string` | `"lg"` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-grid-item/tc-grid-item.css b/packages/tc-web/src/components/tc-grid-item/tc-grid-item.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-item/tc-grid-item.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-grid-item/tc-grid-item.tsx b/packages/tc-web/src/components/tc-grid-item/tc-grid-item.tsx new file mode 100644 index 00000000..7b114319 --- /dev/null +++ b/packages/tc-web/src/components/tc-grid-item/tc-grid-item.tsx @@ -0,0 +1,61 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-grid-item", + styleUrl: "tc-grid-item.css", + shadow: true, +}) +export class GridItem { + @Prop() imageSrc: string; + @Prop({ attribute: "title" }) giTitle: string; + @Prop() link: string; + @Prop() width: string = "lg"; + + render() { + const gridItemStyle = `flex flex-col items-center font-normal shadow-md font-sans m-2 ${this.getWidth()}`; + return ( + + ); + } + + private getWidth(): string { + switch (this.width) { + case "2xl": + return "mx-1 md:mx-2 lg:mx-4"; + case "xl": + return "mx-2 md:mx-4 lg:mx-8"; + case "lg": + return "mx-4 md:mx-8 lg:mx-16"; + case "md": + return "mx-8 md:mx-16 lg:mx-24"; + case "sm": + return "mx-16 md:mx-24 lg:mx-30"; + case "xs": + return "mx-24 md:mx-32 lg:mx-40"; + default: + return "mx-2 md:mx-4 lg:mx-8"; + } + } +} diff --git a/packages/tc-web/src/components/tc-img-quote-card/readme.md b/packages/tc-web/src/components/tc-img-quote-card/readme.md new file mode 100644 index 00000000..f160592b --- /dev/null +++ b/packages/tc-web/src/components/tc-img-quote-card/readme.md @@ -0,0 +1,22 @@ +# tc-testimonial + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------ | ----------- | --------- | ----------- | +| `altText` | `alt-text` | | `string` | `"Picture"` | +| `backgroundColor` | `background-color` | | `string` | `"#FFFFFF"` | +| `borderColor` | `border-color` | | `string` | `""` | +| `imageOnLeft` | `image-on-left` | | `boolean` | `false` | +| `imageSrc` | `image-src` | | `string` | `undefined` | +| `pro` | `title` | | `string` | `undefined` | +| `quote` | `quote` | | `string` | `undefined` | +| `quotee` | `quotee` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.css b/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.tsx b/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.tsx new file mode 100644 index 00000000..965b7300 --- /dev/null +++ b/packages/tc-web/src/components/tc-img-quote-card/tc-img-quote-card.tsx @@ -0,0 +1,91 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-img-quote-card", + styleUrl: "tc-img-quote-card.css", + shadow: true, +}) +export class ImgQuoteCard { + @Prop() quote: string; + @Prop() quotee: string; + @Prop() imageOnLeft: boolean = false; + @Prop() imageSrc: string; + @Prop({ attribute: "title" }) pro: string; + @Prop() altText: string = "Picture"; + @Prop() backgroundColor: string = "#FFFFFF"; + @Prop() borderColor: string = ""; + + render() { + const imageSection = ( +
+ {this.altText} +
+ ); + + const textSection = ( +
+

{this.pro}

+
+ +

{this.quote}

+ +
+
+

{this.quotee}

+
+
+ ); + + return ( +
+ {imageSection} + {textSection} +
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-img-text-card/readme.md b/packages/tc-web/src/components/tc-img-text-card/readme.md new file mode 100644 index 00000000..31cf0373 --- /dev/null +++ b/packages/tc-web/src/components/tc-img-text-card/readme.md @@ -0,0 +1,20 @@ +# tc-job-card + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| --------------------- | ---------------------- | ----------- | --------- | ----------- | +| `borderColor` | `border-color` | | `string` | `""` | +| `detailedDescription` | `detailed-description` | | `string` | `undefined` | +| `imageOnLeft` | `image-on-left` | | `boolean` | `false` | +| `imageSrc` | `image-src` | | `string` | `undefined` | +| `shortDescription` | `short-description` | | `string` | `undefined` | +| `tcImgTextCardTitle` | `title` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.css b/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.tsx b/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.tsx new file mode 100644 index 00000000..e4e8f4dc --- /dev/null +++ b/packages/tc-web/src/components/tc-img-text-card/tc-img-text-card.tsx @@ -0,0 +1,49 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-img-text-card", + styleUrl: "tc-img-text-card.css", + shadow: true, +}) +export class TcImgTextCard { + @Prop() imageSrc: string; + @Prop({ attribute: "title" }) tcImgTextCardTitle: string; + @Prop() shortDescription: string; + @Prop() detailedDescription: string; + @Prop() imageOnLeft: boolean = false; + @Prop() borderColor: string = ""; + + render() { + const imageClass = this.imageOnLeft ? "lg:order-1" : "lg:order-2"; + const textClass = this.imageOnLeft ? "lg:order-2" : "lg:order-1"; + const borderStyle = this.borderColor + ? `border-${this.borderColor} border-solid` + : ""; + + return ( +
+
+
+
+ {this.tcImgTextCardTitle} +
+
+

+ {this.tcImgTextCardTitle} +

+

{this.shortDescription}

+

{this.detailedDescription}

+
+
+
+
+
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-segment-container/readme.md b/packages/tc-web/src/components/tc-segment-container/readme.md new file mode 100644 index 00000000..39d21ab6 --- /dev/null +++ b/packages/tc-web/src/components/tc-segment-container/readme.md @@ -0,0 +1,16 @@ +# segment-container + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------ | ----------- | -------- | ----------- | +| `backgroundColor` | `background-color` | | `string` | `undefined` | +| `segTitle` | `seg-title` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-segment-container/tc-segment-container.css b/packages/tc-web/src/components/tc-segment-container/tc-segment-container.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-segment-container/tc-segment-container.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-segment-container/tc-segment-container.tsx b/packages/tc-web/src/components/tc-segment-container/tc-segment-container.tsx new file mode 100644 index 00000000..95a537a4 --- /dev/null +++ b/packages/tc-web/src/components/tc-segment-container/tc-segment-container.tsx @@ -0,0 +1,33 @@ +// segment-container.tsx +import { Component, Prop, h, Host } from "@stencil/core"; + +@Component({ + tag: "segment-container", + styleUrl: "tc-segment-container.css", + shadow: true, +}) +export class SegmentContainer { + @Prop({attribute:"title"}) segTitle: string; + @Prop() backgroundColor: string; + + render() { + const style = this.backgroundColor + ? { "background-color": this.backgroundColor } + : {}; + + return ( + +
+
+ {this.segTitle && ( +

+ {this.segTitle} +

+ )} + +
+
+
+ ); + } +} diff --git a/packages/tc-web/src/components/tc-subtitle/readme.md b/packages/tc-web/src/components/tc-subtitle/readme.md new file mode 100644 index 00000000..785399da --- /dev/null +++ b/packages/tc-web/src/components/tc-subtitle/readme.md @@ -0,0 +1,15 @@ +# tc-open-positions + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| -------- | --------- | ----------- | -------- | ----------- | +| `level` | `level` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-subtitle/tc-open-positions.css b/packages/tc-web/src/components/tc-subtitle/tc-open-positions.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-subtitle/tc-open-positions.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-subtitle/tc-open-positions.tsx b/packages/tc-web/src/components/tc-subtitle/tc-open-positions.tsx new file mode 100644 index 00000000..fbd8ef83 --- /dev/null +++ b/packages/tc-web/src/components/tc-subtitle/tc-open-positions.tsx @@ -0,0 +1,40 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-open-positions", + styleUrl: "tc-open-positions.css", + shadow: true, +}) +export class OpenPositions { + @Prop() level: string; // Corrected the property name spelling. + + render() { + return ( +
+

{this.level}

+
+ +
+
+ ); + } + + private handleSlotChange(e: Event) { + const slot = e.target as HTMLSlotElement; + const nodes = slot.assignedNodes({ flatten: true }); + if (nodes.length === 0) { + this.renderFallbackMessage(); + } + } + + private renderFallbackMessage() { + const container = document.querySelector(".slot-container"); + container.innerHTML = ` +
+
+ Currently no positions advertised +
+
+ `; + } +} diff --git a/packages/tc-web/src/components/tc-svg-icon-card/readme.md b/packages/tc-web/src/components/tc-svg-icon-card/readme.md new file mode 100644 index 00000000..62799b20 --- /dev/null +++ b/packages/tc-web/src/components/tc-svg-icon-card/readme.md @@ -0,0 +1,22 @@ +# tc-benefits-section + + + + +## Properties + +| Property | Attribute | Description | Type | Default | +| ----------------- | ------------------- | ----------- | -------- | ------------------------------ | +| `advantageTitle` | `title` | | `string` | `undefined` | +| `backgroundColor` | `background-color` | | `string` | `"rgb(255, 255, 255)"` | +| `iconBackground` | `icon-background` | | `string` | `"rgb(0, 0, 0)"` | +| `iconColor` | `icon-color` | | `string` | `"rgb(255, 255, 255)"` | +| `iconSvgPath` | `icon-svg-path` | | `string` | `undefined` | +| `iconSvgViewBox` | `icon-svg-view-box` | | `string` | `undefined` | +| `iconSvgXmlns` | `icon-svg-xmlns` | | `string` | `"http://www.w3.org/2000/svg"` | +| `text` | `text` | | `string` | `undefined` | + + +---------------------------------------------- + +*Built with [StencilJS](https://stenciljs.com/)* diff --git a/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.css b/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.css new file mode 100644 index 00000000..5d4e87f3 --- /dev/null +++ b/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.css @@ -0,0 +1,3 @@ +:host { + display: block; +} diff --git a/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.tsx b/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.tsx new file mode 100644 index 00000000..28bf8a9c --- /dev/null +++ b/packages/tc-web/src/components/tc-svg-icon-card/tc-svg-icon-card.tsx @@ -0,0 +1,45 @@ +import { Component, Prop, h } from "@stencil/core"; + +@Component({ + tag: "tc-svg-icon-card", + styleUrl: "tc-svg-icon-card.css", + shadow: true, +}) +export class SVGIconCard { + @Prop({ attribute: "title" }) advantageTitle: string; + @Prop() text: string; + @Prop() iconSvgPath: string; + @Prop() iconSvgViewBox: string; + @Prop() iconColor: string = "rgb(255, 255, 255)"; + @Prop() iconBackground: string = "rgb(0, 0, 0)"; + @Prop() iconSvgXmlns: string = "http://www.w3.org/2000/svg"; + @Prop() backgroundColor: string = "rgb(255, 255, 255)"; + + render() { + return ( +
+
+ + + +
+

+ {this.advantageTitle} +

+

+ {this.text} +

+
+ ); + } +} diff --git a/packages/tc-web/src/index.html b/packages/tc-web/src/index.html new file mode 100644 index 00000000..98abecb1 --- /dev/null +++ b/packages/tc-web/src/index.html @@ -0,0 +1,226 @@ + + + + + + TC WEB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/tc-web/src/index.ts b/packages/tc-web/src/index.ts new file mode 100644 index 00000000..803cc7df --- /dev/null +++ b/packages/tc-web/src/index.ts @@ -0,0 +1 @@ +export { Components, JSX } from "./components"; diff --git a/packages/tc-web/src/util/util.tsx b/packages/tc-web/src/util/util.tsx new file mode 100644 index 00000000..03e675be --- /dev/null +++ b/packages/tc-web/src/util/util.tsx @@ -0,0 +1,8 @@ +export function parseTags(tagsJson: string): string[] { + try { + return JSON.parse(tagsJson); + } catch (e) { + console.error("Error parsing tags:", e); + return []; // Return empty array in case of error + } +} diff --git a/packages/tc-web/stencil.config.ts b/packages/tc-web/stencil.config.ts new file mode 100644 index 00000000..31b14df0 --- /dev/null +++ b/packages/tc-web/stencil.config.ts @@ -0,0 +1,36 @@ +import { Config } from "@stencil/core"; +import { sass } from "@stencil/sass"; +import tailwind, { + tailwindHMR, + setPluginConfigurationDefaults, +} from "stencil-tailwind-plugin"; +import tailwindcss from "tailwindcss"; +import tailwindConf from "./tailwind.config"; +import autoprefixer from "autoprefixer"; + +setPluginConfigurationDefaults({ + tailwindConf, + postcss: { + plugins: [tailwindcss(), autoprefixer()], + }, +}); + +export const config: Config = { + namespace: "stencil-component-example", + outputTargets: [ + { + type: "dist", + esmLoaderPath: "../loader", + }, + { + type: "docs-readme", + }, + { + type: "www", + serviceWorker: null, // disable service workers + baseUrl: "https://poimen.github.io/", + dir: "docs", + }, + ], + plugins: [sass(), tailwind(), tailwindHMR()], +}; diff --git a/packages/tc-web/tailwind.config.js b/packages/tc-web/tailwind.config.js new file mode 100644 index 00000000..85eaa6a0 --- /dev/null +++ b/packages/tc-web/tailwind.config.js @@ -0,0 +1,42 @@ +const defaultTheme = require("tailwindcss/defaultTheme"); +module.exports = { + content: ["./src/**/*.{html,js,tsx}"], + theme: { + extend: { + colors: { + uzhblue: "#0028A5", + uzhcyan: "#4AC9E3", + uzhapple: "#A4D233", + uzhgold: "#FFC845", + uzhorange: "FC4C02", + uzhberry: "#BF0D3E", + uzhlgrey2: "#EFEFEF", + uzhlgrey3: "#E7E7E7", + }, + boxShadow: { + uzh: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)", + }, + + fontFamily: { + sans: [ + '"Source Sans 3"', + '"Source Sans Pro"', + ...defaultTheme.fontFamily.sans, + ], + title: [ + '"Source Sans 3"', + '"Source Sans Pro"', + ...defaultTheme.fontFamily.sans, + ], + }, + }, + }, + plugins: [ + require("@tailwindcss/typography"), + require("@tailwindcss/forms"), + require("@tailwindcss/aspect-ratio"), + ], + corePlugins: { + preflight: false, + }, +}; diff --git a/packages/tc-web/tsconfig.json b/packages/tc-web/tsconfig.json new file mode 100644 index 00000000..5971d5da --- /dev/null +++ b/packages/tc-web/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "allowUnreachableCode": false, + "declaration": false, + "experimentalDecorators": true, + "lib": ["dom", "es2017"], + "moduleResolution": "node", + "module": "esnext", + "target": "es2017", + "noUnusedLocals": true, + "noUnusedParameters": true, + "jsx": "react", + "jsxFactory": "h" + }, + "include": ["src"], + "exclude": ["node_modules"] +}