@ptcwebops/ptcw-design 3.1.5 → 3.1.7

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.
@@ -11749,6 +11749,8 @@ const PtcTextfield = class {
11749
11749
  if (this.el.classList.contains('invalid-field')) {
11750
11750
  this.el.classList.remove('invalid-field');
11751
11751
  }
11752
+ this.inputValue = this.iti.getNumber();
11753
+ // console.log('sending phone number: ' + this.inputValue);
11752
11754
  }
11753
11755
  else if (!this.iti.isValidNumber()) {
11754
11756
  if (!this.mdcTextfield.classList.contains('mdc-text-field--invalid')) {
@@ -115,9 +115,9 @@ const PtcModalQuiz = class {
115
115
  const PriorityOptions = () => {
116
116
  return index.h("div", { class: "options-container" }, index.h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.Low) }, index.h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `1` }), index.h("label", { class: "option-label", htmlFor: `1` }, index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Low (1% - 30%)"))), index.h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.Medium) }, index.h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `2` }), index.h("label", { class: "option-label", htmlFor: `2` }, index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Medium (31% - 65%)"))), index.h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.High) }, index.h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `3` }), index.h("label", { class: "option-label", htmlFor: `3` }, index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "High (66% - 100%)"))));
117
117
  };
118
- return (index.h(index.Host, null, index.h("div", { class: "modal-quiz-container" }, index.h("div", null, index.h("div", null, index.h("div", { class: "modal-quiz-progress" }, index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "x-small", "font-weight": "w-4", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Question ", this.currentQuestion, " of ", this.totalQuestions), index.h(ProgressDots, null)), index.h("div", { class: "modal-quiz-content" }, index.h("div", { class: "content" }, index.h("ptc-title", { type: "h2", "text-align": "left", "title-size": "xx-large", "title-color": "gray", upperline: "dotted", "title-display": "inline-block", "title-shadow": "", "title-height": "densest", "title-margin": "margin-1", "title-weight": "w-8", "is-plm-hub": "false" }, index.h("slot", { name: `question-${this.currentQuestion}-title` })), index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, index.h("slot", { name: `question-${this.currentQuestion}-subtitle` })), index.h(PriorityOptions, null), index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, (this.currentSelectedPriority) ? index.h("slot", { name: this.getPriorityAnswerSlotName() }) : null), index.h("div", { class: "modal-quiz-ctas" }, index.h("ptc-button", { type: "link", color: "ptc-tertiary", onClick: () => this.handlePreviousClick(), disabled: (this.currentQuestion === 1) }, "Previous"), index.h("ptc-spacer", { size: "large", breakpoint: "x-small" }), (this.currentQuestion === this.totalQuestions) ?
119
- index.h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleEmailReportClick(e), disabled: this.currentSelectedPriority == null }, "Email Full Report") :
120
- index.h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleNextClick(e), disabled: this.currentSelectedPriority == null }, "Next Question"))), index.h("div", { class: "image" }, index.h("slot", { name: `question-${this.currentQuestion}-image` })))))), index.h("slot", { name: "script" })));
118
+ return (index.h(index.Host, null, index.h("div", { class: "modal-quiz-container" }, index.h("div", null, index.h("div", null, index.h("div", { class: "modal-quiz-progress" }, index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "x-small", "font-weight": "w-4", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Question ", this.currentQuestion, " of ", this.totalQuestions), index.h(ProgressDots, null)), index.h("div", { class: "modal-quiz-content" }, index.h("div", { class: "content" }, index.h("ptc-title", { type: "h2", "text-align": "left", "title-size": "xx-large", "title-color": "gray", upperline: "dotted", "title-display": "inline-block", "title-shadow": "", "title-height": "densest", "title-margin": "margin-1", "title-weight": "w-8", "is-plm-hub": "false" }, index.h("slot", { name: `question-${this.currentQuestion}-title` })), index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, index.h("slot", { name: `question-${this.currentQuestion}-subtitle` })), index.h(PriorityOptions, null), index.h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, (this.currentSelectedPriority) ? index.h("slot", { name: this.getPriorityAnswerSlotName() }) : null), index.h("div", { class: "modal-quiz-ctas" }, index.h("ptc-button", { type: "link", color: "ptc-tertiary", onClick: () => this.handlePreviousClick(), disabled: (this.currentQuestion === 1) }, index.h("slot", { name: "previous-ques-text" })), index.h("ptc-spacer", { size: "large", breakpoint: "x-small" }), (this.currentQuestion === this.totalQuestions) ?
119
+ index.h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleEmailReportClick(e), disabled: this.currentSelectedPriority == null }, index.h("slot", { name: "email-results-text" })) :
120
+ index.h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleNextClick(e), disabled: this.currentSelectedPriority == null }, index.h("slot", { name: "next-ques-text" })))), index.h("div", { class: "image" }, index.h("slot", { name: `question-${this.currentQuestion}-image` })))))), index.h("slot", { name: "script" })));
121
121
  }
122
122
  get el() { return index.getElement(this); }
123
123
  };
@@ -106,9 +106,9 @@ export class PtcModalQuiz {
106
106
  const PriorityOptions = () => {
107
107
  return h("div", { class: "options-container" }, h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.Low) }, h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `1` }), h("label", { class: "option-label", htmlFor: `1` }, h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Low (1% - 30%)"))), h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.Medium) }, h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `2` }), h("label", { class: "option-label", htmlFor: `2` }, h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Medium (31% - 65%)"))), h("div", { class: "radio-input", onClick: e => this.handlePriorityOptionClick(e, Priority.High) }, h("input", { type: "radio", name: `modal-quiz-${this.currentQuestion}`, id: `3` }), h("label", { class: "option-label", htmlFor: `3` }, h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "High (66% - 100%)"))));
108
108
  };
109
- return (h(Host, null, h("div", { class: "modal-quiz-container" }, h("div", null, h("div", null, h("div", { class: "modal-quiz-progress" }, h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "x-small", "font-weight": "w-4", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Question ", this.currentQuestion, " of ", this.totalQuestions), h(ProgressDots, null)), h("div", { class: "modal-quiz-content" }, h("div", { class: "content" }, h("ptc-title", { type: "h2", "text-align": "left", "title-size": "xx-large", "title-color": "gray", upperline: "dotted", "title-display": "inline-block", "title-shadow": "", "title-height": "densest", "title-margin": "margin-1", "title-weight": "w-8", "is-plm-hub": "false" }, h("slot", { name: `question-${this.currentQuestion}-title` })), h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, h("slot", { name: `question-${this.currentQuestion}-subtitle` })), h(PriorityOptions, null), h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, (this.currentSelectedPriority) ? h("slot", { name: this.getPriorityAnswerSlotName() }) : null), h("div", { class: "modal-quiz-ctas" }, h("ptc-button", { type: "link", color: "ptc-tertiary", onClick: () => this.handlePreviousClick(), disabled: (this.currentQuestion === 1) }, "Previous"), h("ptc-spacer", { size: "large", breakpoint: "x-small" }), (this.currentQuestion === this.totalQuestions) ?
110
- h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleEmailReportClick(e), disabled: this.currentSelectedPriority == null }, "Email Full Report") :
111
- h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleNextClick(e), disabled: this.currentSelectedPriority == null }, "Next Question"))), h("div", { class: "image" }, h("slot", { name: `question-${this.currentQuestion}-image` })))))), h("slot", { name: "script" })));
109
+ return (h(Host, null, h("div", { class: "modal-quiz-container" }, h("div", null, h("div", null, h("div", { class: "modal-quiz-progress" }, h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "x-small", "font-weight": "w-4", "para-align": "justify", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, "Question ", this.currentQuestion, " of ", this.totalQuestions), h(ProgressDots, null)), h("div", { class: "modal-quiz-content" }, h("div", { class: "content" }, h("ptc-title", { type: "h2", "text-align": "left", "title-size": "xx-large", "title-color": "gray", upperline: "dotted", "title-display": "inline-block", "title-shadow": "", "title-height": "densest", "title-margin": "margin-1", "title-weight": "w-8", "is-plm-hub": "false" }, h("slot", { name: `question-${this.currentQuestion}-title` })), h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, h("slot", { name: `question-${this.currentQuestion}-subtitle` })), h(PriorityOptions, null), h("ptc-para", { "ellipsis-line-cutoff": "0", "font-size": "small", "font-weight": "w-4", "para-align": "left", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush", "para-style": "", "para-z-index": "z-1", styles: "" }, (this.currentSelectedPriority) ? h("slot", { name: this.getPriorityAnswerSlotName() }) : null), h("div", { class: "modal-quiz-ctas" }, h("ptc-button", { type: "link", color: "ptc-tertiary", onClick: () => this.handlePreviousClick(), disabled: (this.currentQuestion === 1) }, h("slot", { name: "previous-ques-text" })), h("ptc-spacer", { size: "large", breakpoint: "x-small" }), (this.currentQuestion === this.totalQuestions) ?
110
+ h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleEmailReportClick(e), disabled: this.currentSelectedPriority == null }, h("slot", { name: "email-results-text" })) :
111
+ h("ptc-button", { type: "link", color: "ptc-secondary", onClick: e => this.handleNextClick(e), disabled: this.currentSelectedPriority == null }, h("slot", { name: "next-ques-text" })))), h("div", { class: "image" }, h("slot", { name: `question-${this.currentQuestion}-image` })))))), h("slot", { name: "script" })));
112
112
  }
113
113
  static get is() { return "ptc-modal-quiz"; }
114
114
  static get encapsulation() { return "shadow"; }
@@ -94,6 +94,8 @@ export class PtcTextfield {
94
94
  if (this.el.classList.contains('invalid-field')) {
95
95
  this.el.classList.remove('invalid-field');
96
96
  }
97
+ this.inputValue = this.iti.getNumber();
98
+ // console.log('sending phone number: ' + this.inputValue);
97
99
  }
98
100
  else if (!this.iti.isValidNumber()) {
99
101
  if (!this.mdcTextfield.classList.contains('mdc-text-field--invalid')) {
@@ -3,6 +3,12 @@ import { html } from 'lit';
3
3
  export default {
4
4
  title: 'Atoms/ptc-link',
5
5
  tags: ['autodocs'],
6
+ parameters: {
7
+ design: {
8
+ type: "figma",
9
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1802%3A62&mode=design&t=e6dLB5mUTCuEu23J-1",
10
+ },
11
+ },
6
12
  argTypes: {
7
13
  disabled: {
8
14
  control: 'boolean',
@@ -0,0 +1,96 @@
1
+ import "./style.css";
2
+ import colors from "./colors.json";
3
+
4
+ const meta = {
5
+ title: 'Design Tokens/Color',
6
+ parameters: {
7
+ design: {
8
+ type: "figma",
9
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1718%3A247&mode=design&t=3CAodvJ7V1gNzCOU-1",
10
+ },
11
+ },
12
+ };
13
+
14
+ export default meta;
15
+
16
+ export const About = {
17
+ render: () => {
18
+ const colorPicker = document.createElement('div');
19
+
20
+ const colorBaseSelect = document.createElement('section');
21
+ const select = document.createElement('select');
22
+ select.id = "color-base";
23
+ const colorBases = Object.keys(colors);
24
+ for (let color of colorBases) {
25
+ select.insertAdjacentHTML(
26
+ 'beforeend',
27
+ `<option value="${color}">${color}</option>`
28
+ )
29
+ };
30
+ colorBaseSelect.insertAdjacentHTML('beforeend', '<label>Color</label>');
31
+ colorBaseSelect.insertAdjacentElement('beforeend', select);
32
+
33
+ const colorVariantInput = document.createElement('section');
34
+ const input = document.createElement('input');
35
+ input.id = "color-variant";
36
+ input.type = "number";
37
+ input.value = 7;
38
+ input.min = 1;
39
+ input.max = 12;
40
+ colorVariantInput.insertAdjacentHTML('beforeend', '<label>Variant</label>');
41
+ colorVariantInput.insertAdjacentElement('beforeend', input);
42
+
43
+ const colorBlock = document.createElement('section');
44
+ colorBlock.id = "color-block";
45
+ colorBlock.style.background = "#00890B";
46
+ colorBlock.style.marginBottom = "50px";
47
+ colorBlock.value = "--color-green-07";
48
+
49
+ const colorVariable = document.createElement('section');
50
+ colorVariable.insertAdjacentHTML('beforeend', "<label>Variable</label>");
51
+ colorVariable.insertAdjacentHTML('beforeend', "<code id='color-variable'>--color-green-07</code>");
52
+
53
+ const colorHexCode = document.createElement('section');
54
+ colorHexCode.insertAdjacentHTML('beforeend', "<label>Hex code</label>");
55
+ colorHexCode.insertAdjacentHTML('beforeend', "<code id='color-hex-code'>#00890B</code>");
56
+
57
+ select.addEventListener('change', e => {
58
+ let colorBase = e.target.value;
59
+ let colorVariant = document.getElementById('color-variant');
60
+ let colorBlock = document.getElementById('color-block');
61
+ let colorVariable = document.getElementById('color-variable');
62
+ let colorHex = document.getElementById('color-hex-code');
63
+
64
+ colorVariant.max = colors[colorBase].length;
65
+ colorVariant.value = 1;
66
+ let colorHexCode = colors[colorBase][0]["code"];
67
+ colorBlock.style.background = colorHexCode;
68
+ colorVariable.innerText = colors[colorBase][0]["variable"];
69
+ colorHex.innerText = colorHexCode;
70
+ });
71
+
72
+ input.addEventListener('change', e => {
73
+ let colorBase = document.getElementById('color-base').value;
74
+ let colorVariant = e.target;
75
+ let colorBlock = document.getElementById('color-block');
76
+ let colorVariable = document.getElementById('color-variable');
77
+ let colorHex = document.getElementById('color-hex-code');
78
+
79
+ let colorVariantValue = colorVariant.value;
80
+ colorVariant.max = colors[colorBase].length;
81
+ let colorHexCode = colors[colorBase][colorVariantValue-1]["code"];
82
+ colorBlock.style.background = colorHexCode;
83
+ colorVariable.innerText = colors[colorBase][colorVariantValue-1]["variable"];
84
+ colorHex.innerText = colorHexCode;
85
+ });
86
+
87
+ colorPicker.insertAdjacentHTML('beforeend', "<h2>Color Palette 2.0</h2>");
88
+ colorPicker.insertAdjacentElement('beforeend', colorBaseSelect);
89
+ colorPicker.insertAdjacentElement('beforeend', colorVariantInput);
90
+ colorPicker.insertAdjacentElement('beforeend', colorBlock);
91
+ colorPicker.insertAdjacentElement('beforeend', colorVariable);
92
+ colorPicker.insertAdjacentElement('beforeend', colorHexCode);
93
+
94
+ return colorPicker;
95
+ }
96
+ }
@@ -0,0 +1,98 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Temp',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1718%3A247&mode=design&t=3CAodvJ7V1gNzCOU-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <style>
16
+ input {
17
+ padding: 5px 8px 5px 8px;
18
+ width: 200px;
19
+ border-radius: 8px;
20
+ border: 1px solid var(--color-gray-04);
21
+ }
22
+
23
+ select {
24
+ padding: 5px 8px 5px 8px;
25
+ width: 200px;
26
+ border-radius: 8px;
27
+ border: 1px solid var(--color-gray-04);
28
+ }
29
+
30
+ #color-block {
31
+ height: 100px;
32
+ width: 100px;
33
+ border-radius: 5px;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ font-size: 16px;
38
+ }
39
+ </style>
40
+
41
+ <h2>Color</h2>
42
+
43
+ <div style="margin-bottom: 50px">
44
+ <div>
45
+ <label>Color</label><br/>
46
+ <select>
47
+ <option selected="selected" value="green">Green</option>
48
+ <option value="blue">Blue</option>
49
+ <option value="orange">Orange</option>
50
+ <option value="red">Red</option>
51
+ <option value="gray">Gray</option>
52
+ </select>
53
+ </div>
54
+ <br/>
55
+ <div>
56
+ <label>Variant</label><br/>
57
+ <input id="number" type="number" value="7" min="1" max="12"/>
58
+ </div>
59
+ </div>
60
+ <div id="color-block" style="background:#00890B" value="--color-green-07"></div>
61
+ <br />
62
+ <div>
63
+ <label>Variable</label><br/>
64
+ <code id="color-variable">--color-green-07</code>
65
+ </div>
66
+ <br/>
67
+ <div>
68
+ <label>Hex code</label><br/>
69
+ <code id="color-hex-code">#00890B</code>
70
+ </div>
71
+
72
+ <script>
73
+ const colors = {
74
+ "green": ["#E1F1E2","#BDE1BF","#97CF9B","#7DC382","#5CB463","#33A13C","#00890B","#006E09","#005807","#004606","#003805","#002D04"],
75
+ "blue": ["#E1EDF6","#C3DDEE","#A1C9E5","#89BBDF","#6CAAD7","#4795CD","#197BC0","#14629A","#104E7B","#0D3E62","#0A324E","#08283E"],
76
+ "orange": ["#F8EDE3","#F0DBC7","#E7C7A7","#E1B991","#D9A876","#CF9254","#C37729","#9C5F21","#7D4C1A","#643D15","#503111","#40270E"],
77
+ "red": ["#FAE6E6","#F4CDCD","#EDB1B1","#E99D9D","#E38484","#DC6565","#D33E3E","#A7232E","#861C25","#6B161E","#561218","#450E13"],
78
+ "gray": ["#F6F6F6","#E4E7E9","#BEC6CA","#AEB8BD","#9AA6AD","#819099","#617480","#4E5D66","#3E4A52","#323B42","#282F35","#20262A"]
79
+ }
80
+ document.querySelector('select').addEventListener('change', e => {
81
+ let colorBase = e.target.value;
82
+ let colorVariant = document.querySelector('#number').value;
83
+ let colorHexCode = colors[colorBase][colorVariant-1];
84
+ document.getElementById('color-block').style.background = colorHexCode;
85
+ document.getElementById('color-variable').innerText = "--color-"+colorBase+"-"+colorVariant.padStart(2,'0');
86
+ document.getElementById('color-hex-code').innerText = colorHexCode;
87
+ });
88
+ document.querySelector('#number').addEventListener('change', e => {
89
+ let colorBase = document.querySelector('select').value;
90
+ let colorVariant = e.target.value;
91
+ let colorHexCode = colors[colorBase][colorVariant-1];
92
+ document.getElementById('color-block').style.background = colorHexCode;
93
+ document.getElementById('color-variable').innerText = "--color-"+colorBase+"-"+colorVariant.padStart(2,'0');
94
+ document.getElementById('color-hex-code').innerText = colorHexCode;
95
+ });
96
+ </script>
97
+ `
98
+ }
@@ -0,0 +1,19 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Containers',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1771%3A59&mode=design&t=mXFihiX08xo9n6HS-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <h2>Containers</h2>
16
+ `
17
+ }
18
+
19
+ export const About = AboutTemplate.bind({});
@@ -0,0 +1,68 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Elevations',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1%3A261&mode=design&t=6gVgJ9yDrxuMo3pg-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <style>
16
+ table {
17
+ border-collapse: collapse;
18
+ width: 100%;
19
+ border: 1px solid whitesmoke;
20
+ border-radius: 7px;
21
+ box-shadow: var(--ptc-shadow-x-small);
22
+ margin: 10px 0 30px 0;
23
+ }
24
+
25
+ th, td {
26
+ text-align: left;
27
+ padding: 25px;
28
+ border: 1px solid whitesmoke;
29
+ }
30
+ tr:nth-child(even) {background-color: #f2f2f2;}
31
+ </style>
32
+ <h2>Elevation</h2>
33
+ <p>Elevation tokens are used to give elements the appearance of being raised off the page. Use them with the <strong>box-shadow</strong> property. These are especially useful for menus, popovers, and dialogs.</p>
34
+
35
+ <table>
36
+ <thead>
37
+ <tr>
38
+ <th>Token</th>
39
+ <th>Example</th>
40
+ </tr>
41
+ </thead>
42
+ <tbody>
43
+ <tr>
44
+ <td>--ptc-shadow-x-small</td>
45
+ <td><div class="elevation-demo" style="box-shadow: var(--ptc-shadow-x-small);"></div></td>
46
+ </tr>
47
+ <tr>
48
+ <td>--ptc-shadow-small</td>
49
+ <td><div class="elevation-demo" style="box-shadow: var(--ptc-shadow-small);"></div></td>
50
+ </tr>
51
+ <tr>
52
+ <td>--ptc-shadow-medium</td>
53
+ <td><div class="elevation-demo" style="box-shadow: var(--ptc-shadow-medium);"></div></td>
54
+ </tr>
55
+ <tr>
56
+ <td>--ptc-shadow-large</td>
57
+ <td><div class="elevation-demo" style="box-shadow: var(--ptc-shadow-large);"></div></td>
58
+ </tr>
59
+ <tr>
60
+ <td>--ptc-shadow-x-large</td>
61
+ <td><div class="elevation-demo" style="box-shadow: var(--ptc-shadow-x-large);"></div></td>
62
+ </tr>
63
+ </tbody>
64
+ </table>
65
+ `
66
+ }
67
+
68
+ export const About = AboutTemplate.bind({});
@@ -0,0 +1,22 @@
1
+ import { html } from 'lit';
2
+ import { Source } from '@storybook/blocks';
3
+
4
+ export default {
5
+ title: 'Design Tokens/Grid',
6
+ parameters: {
7
+ design: {
8
+ type: "figma",
9
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1637%3A58&mode=design&t=wElsipYyzT8825HE-1",
10
+ },
11
+ },
12
+ };
13
+
14
+ const AboutTemplate = args => {
15
+ return html `
16
+ <h2>Grid</h2>
17
+ <p>PTC Design System is using Griddle. Credits to Dave Berning. <br>
18
+ Please check the <a href="https://github.com/daveberning/griddle#spacing-modifiers" target="_blank">github documentation</a>
19
+ <p>
20
+ `
21
+ }
22
+ export const About = AboutTemplate.bind({});
@@ -0,0 +1,13 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Motion',
5
+ };
6
+
7
+ const AboutTemplate = args => {
8
+ return html `
9
+ <h2>Motion</h2>
10
+ `
11
+ }
12
+
13
+ export const About = AboutTemplate.bind({});
@@ -0,0 +1,69 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Shape',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1%3A296&mode=design&t=mXFihiX08xo9n6HS-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <style>
16
+ table {
17
+ border-collapse: collapse;
18
+ width: 100%;
19
+ border: 1px solid whitesmoke;
20
+ border-radius: 7px;
21
+ box-shadow: var(--ptc-shadow-x-small);
22
+ margin: 10px 0 30px 0;
23
+ }
24
+
25
+ th, td {
26
+ text-align: left;
27
+ padding: 25px;
28
+ border: 1px solid whitesmoke;
29
+ }
30
+ tr:nth-child(even) {background-color: #f2f2f2;}
31
+ </style>
32
+
33
+ <h2>Shape</h2>
34
+
35
+ <h3>Border Radius</h3>
36
+
37
+ <p>Border radius tokens are used to give sharp edges a more subtle, rounded effect. They use rem units so they scale with the base font size. The pixel values displayed are based on a 16px font size.</p>
38
+
39
+ <table>
40
+ <tr>
41
+ <td>Token</td>
42
+ <td>Value</td>
43
+ <td>Example</td>
44
+ </tr>
45
+ <tr>
46
+ <td>--ptc-border-radius-standard</td>
47
+ <td>0.25rem (4px)</td>
48
+ <td><div class="border-radius-demo" style="border-radius: var(--ptc-border-radius-standard);"></div></td>
49
+ </tr>
50
+ <tr>
51
+ <td>--ptc-border-radius-large</td>
52
+ <td>0.75rem (12px)</td>
53
+ <td><div class="border-radius-demo" style="border-radius: var(--ptc-border-radius-large);"></div></td>
54
+ </tr>
55
+ <tr>
56
+ <td>--ptc-border-radius-pill</td>
57
+ <td>9999px</td>
58
+ <td><div class="border-radius-demo" style="border-radius: var(--ptc-border-radius-pill); width: 6rem;"></div></td>
59
+ </tr>
60
+ <tr>
61
+ <td>--ptc-border-radius-circle</td>
62
+ <td>50%</td>
63
+ <td><div class="border-radius-demo" style="border-radius: var(--ptc-border-radius-circle);"></div></td>
64
+ </tr>
65
+ </table>
66
+ `
67
+ }
68
+
69
+ export const About = AboutTemplate.bind({});
@@ -0,0 +1,128 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Space',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1%3A305&mode=design&t=6gVgJ9yDrxuMo3pg-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <style>
16
+ table {
17
+ border-collapse: collapse;
18
+ width: 100%;
19
+ border: 1px solid whitesmoke;
20
+ border-radius: 7px;
21
+ box-shadow: var(--ptc-shadow-x-small);
22
+ margin: 10px 0 30px 0;
23
+ }
24
+
25
+ th, td {
26
+ text-align: left;
27
+ padding: 25px;
28
+ border: 1px solid whitesmoke;
29
+ }
30
+ tr:nth-child(even) {background-color: #f2f2f2;}
31
+ </style>
32
+
33
+ <h2>Space</h2>
34
+
35
+ <h3>Element Spacing</h3>
36
+ <table>
37
+ <tr>
38
+ <td>Token</td>
39
+ <td>Value</td>
40
+ <td>Example</td>
41
+ </tr>
42
+ <tr>
43
+ <td>--ptc-element-spacing-01</td>
44
+ <td>0.25rem (4px)</td>
45
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-01); height: var(--ptc-element-spacing-01)"></div></td>
46
+ </tr>
47
+ <tr>
48
+ <td>--ptc-element-spacing-02</td>
49
+ <td>0.5rem (8px)</td>
50
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-02); height: var(--ptc-element-spacing-02)"></div></td>
51
+ </tr>
52
+ <tr>
53
+ <td>--ptc-element-spacing-03</td>
54
+ <td>0.75rem (12px)</td>
55
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-03); height: var(--ptc-element-spacing-03)"></div></td>
56
+ </tr>
57
+ <tr>
58
+ <td>--ptc-element-spacing-04</td>
59
+ <td>1rem (16px)</td>
60
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-04); height: var(--ptc-element-spacing-04)"></div></td>
61
+ </tr>
62
+ <tr>
63
+ <td>--ptc-element-spacing-05</td>
64
+ <td>1.25rem (20px)</td>
65
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-05); height: var(--ptc-element-spacing-05)"></div></td>
66
+ </tr>
67
+ <tr>
68
+ <td>--ptc-element-spacing-06</td>
69
+ <td>1.5rem (24px)</td>
70
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-06); height: var(--ptc-element-spacing-06)"></div></td>
71
+ </tr>
72
+ <tr>
73
+ <td>--ptc-element-spacing-07</td>
74
+ <td>2rem (32px)</td>
75
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-07); height: var(--ptc-element-spacing-07)"></div></td>
76
+ </tr>
77
+ <tr>
78
+ <td>--ptc-element-spacing-08</td>
79
+ <td>2.5rem (40px)</td>
80
+ <td><div class="spacing-demo" style="width:var(--ptc-element-spacing-08); height: var(--ptc-element-spacing-08)"></div></td>
81
+ </tr>
82
+ </table>
83
+
84
+ <hr />
85
+
86
+ <h3>Layout Spacing</h3>
87
+ <table>
88
+ <tr>
89
+ <td>Token</td>
90
+ <td>Value</td>
91
+ <td>Example</td>
92
+ </tr>
93
+ <tr>
94
+ <td>--ptc-layout-spacing-01</td>
95
+ <td>0.5rem (8px)</td>
96
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-01); height: var(--ptc-layout-spacing-01)"></div></td>
97
+ </tr>
98
+ <tr>
99
+ <td>--ptc-layout-spacing-02</td>
100
+ <td>1rem (16px)</td>
101
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-02); height: var(--ptc-layout-spacing-02)"></div></td>
102
+ </tr>
103
+ <tr>
104
+ <td>--ptc-layout-spacing-03</td>
105
+ <td>1.5rem (24px)</td>
106
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-03); height: var(--ptc-layout-spacing-03)"></div></td>
107
+ </tr>
108
+ <tr>
109
+ <td>--ptc-layout-spacing-04</td>
110
+ <td>2rem (32px)</td>
111
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-04); height: var(--ptc-layout-spacing-04)"></div></td>
112
+ </tr>
113
+ <tr>
114
+ <td>--ptc-layout-spacing-05</td>
115
+ <td>4rem (64px)</td>
116
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-05); height: var(--ptc-layout-spacing-05)"></div></td>
117
+ </tr>
118
+ <tr>
119
+ <td>--ptc-layout-spacing-06</td>
120
+ <td>5rem (80px)</td>
121
+ <td><div class="spacing-demo" style="width:var(--ptc-layout-spacing-06); height: var(--ptc-layout-spacing-06)"></div></td>
122
+ </tr>
123
+ </table>
124
+ `
125
+ }
126
+
127
+ export const About = AboutTemplate.bind({});
128
+
@@ -0,0 +1,20 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Design Tokens/Typography',
5
+ parameters: {
6
+ design: {
7
+ type: "figma",
8
+ url: "https://www.figma.com/file/vN5aEOCLun1QmatmlVBeX0/PTC.com-UX-Library?type=design&node-id=1802%3A60&mode=design&t=mXFihiX08xo9n6HS-1",
9
+ },
10
+ },
11
+ };
12
+
13
+ const AboutTemplate = args => {
14
+ return html `
15
+ <h2>Typography</h2>
16
+ <p>PTC Design System is using google fonts</p>
17
+ `
18
+ }
19
+
20
+ export const About = AboutTemplate.bind({});