@prioticket/design-system-web 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/COMPONENT-DOCUMENTATION.md +608 -0
  2. package/README.md +229 -0
  3. package/component-documentation.json +1681 -0
  4. package/dist/components/pd-button.cjs.js +99 -0
  5. package/dist/components/pd-button.es.js +156 -0
  6. package/dist/components/pd-card.cjs.js +59 -0
  7. package/dist/components/pd-card.es.js +93 -0
  8. package/dist/components/pd-checkbox.cjs.js +85 -0
  9. package/dist/components/pd-checkbox.es.js +154 -0
  10. package/dist/components/pd-chip.cjs.js +118 -0
  11. package/dist/components/pd-chip.es.js +220 -0
  12. package/dist/components/pd-dialog.cjs.js +195 -0
  13. package/dist/components/pd-dialog.es.js +285 -0
  14. package/dist/components/pd-expandable-card.cjs.js +134 -0
  15. package/dist/components/pd-expandable-card.es.js +205 -0
  16. package/dist/components/pd-fab.cjs.js +119 -0
  17. package/dist/components/pd-fab.es.js +179 -0
  18. package/dist/components/pd-icon-button.cjs.js +159 -0
  19. package/dist/components/pd-icon-button.es.js +268 -0
  20. package/dist/components/pd-icon.cjs.js +71 -0
  21. package/dist/components/pd-icon.es.js +102 -0
  22. package/dist/components/pd-list.cjs.js +108 -0
  23. package/dist/components/pd-list.es.js +229 -0
  24. package/dist/components/pd-menu-item.cjs.js +85 -0
  25. package/dist/components/pd-menu-item.es.js +156 -0
  26. package/dist/components/pd-menu.cjs.js +42 -0
  27. package/dist/components/pd-menu.es.js +122 -0
  28. package/dist/components/pd-progress.cjs.js +72 -0
  29. package/dist/components/pd-progress.es.js +119 -0
  30. package/dist/components/pd-radio.cjs.js +38 -0
  31. package/dist/components/pd-radio.es.js +153 -0
  32. package/dist/components/pd-segmented-button.cjs.js +135 -0
  33. package/dist/components/pd-segmented-button.es.js +234 -0
  34. package/dist/components/pd-segmented-stepper.cjs.js +191 -0
  35. package/dist/components/pd-segmented-stepper.es.js +333 -0
  36. package/dist/components/pd-select.cjs.js +59 -0
  37. package/dist/components/pd-select.es.js +136 -0
  38. package/dist/components/pd-slider.cjs.js +42 -0
  39. package/dist/components/pd-slider.es.js +123 -0
  40. package/dist/components/pd-stepper.cjs.js +279 -0
  41. package/dist/components/pd-stepper.es.js +375 -0
  42. package/dist/components/pd-switch.cjs.js +57 -0
  43. package/dist/components/pd-switch.es.js +126 -0
  44. package/dist/components/pd-tabs.cjs.js +32 -0
  45. package/dist/components/pd-tabs.es.js +139 -0
  46. package/dist/components/pd-text-field.cjs.js +86 -0
  47. package/dist/components/pd-text-field.es.js +202 -0
  48. package/dist/design-system-web.css +1 -0
  49. package/dist/fonts/ProximaNova-Bold.woff2 +0 -0
  50. package/dist/fonts/ProximaNova-Extrabld.woff2 +0 -0
  51. package/dist/fonts/ProximaNova-Light.woff2 +0 -0
  52. package/dist/fonts/ProximaNova-Medium.woff2 +0 -0
  53. package/dist/fonts/ProximaNova-Regular.woff2 +0 -0
  54. package/dist/fonts/ProximaNova-Semibold.woff2 +0 -0
  55. package/dist/fonts/ProximaNovaCond-Semibold.woff2 +0 -0
  56. package/dist/fonts-only.css +59 -0
  57. package/dist/fonts.cjs.js +1 -0
  58. package/dist/fonts.es.js +1 -0
  59. package/dist/prioticket-design-system-web.cjs.js +1 -0
  60. package/dist/prioticket-design-system-web.es.js +52 -0
  61. package/dist/theme-only.css +311 -0
  62. package/dist/theme-with-fonts.cjs.js +1 -0
  63. package/dist/theme-with-fonts.css +372 -0
  64. package/dist/theme-with-fonts.es.js +2 -0
  65. package/dist/theme.cjs.js +1 -0
  66. package/dist/theme.es.js +1 -0
  67. package/dist/types/components/pd-button.d.ts +30 -0
  68. package/dist/types/components/pd-card.d.ts +8 -0
  69. package/dist/types/components/pd-checkbox.d.ts +16 -0
  70. package/dist/types/components/pd-chip.d.ts +26 -0
  71. package/dist/types/components/pd-dialog.d.ts +49 -0
  72. package/dist/types/components/pd-expandable-card.d.ts +39 -0
  73. package/dist/types/components/pd-fab.d.ts +17 -0
  74. package/dist/types/components/pd-icon-button.d.ts +24 -0
  75. package/dist/types/components/pd-icon.d.ts +9 -0
  76. package/dist/types/components/pd-list.d.ts +36 -0
  77. package/dist/types/components/pd-menu-item.d.ts +38 -0
  78. package/dist/types/components/pd-menu.d.ts +58 -0
  79. package/dist/types/components/pd-progress.d.ts +30 -0
  80. package/dist/types/components/pd-radio.d.ts +54 -0
  81. package/dist/types/components/pd-segmented-button.d.ts +53 -0
  82. package/dist/types/components/pd-segmented-stepper.d.ts +65 -0
  83. package/dist/types/components/pd-select.d.ts +46 -0
  84. package/dist/types/components/pd-slider.d.ts +43 -0
  85. package/dist/types/components/pd-stepper.d.ts +47 -0
  86. package/dist/types/components/pd-switch.d.ts +37 -0
  87. package/dist/types/components/pd-tabs.d.ts +54 -0
  88. package/dist/types/components/pd-text-field.d.ts +30 -0
  89. package/dist/types/fonts.d.ts +1 -0
  90. package/dist/types/index.d.ts +22 -0
  91. package/dist/types/theme-with-fonts.d.ts +2 -0
  92. package/dist/types/theme.d.ts +1 -0
  93. package/package.json +93 -0
@@ -0,0 +1,57 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lit"),e=require("lit/decorators.js");require("@material/web/switch/switch.js");require("@material/web/icon/icon.js");var n=Object.defineProperty,h=Object.getOwnPropertyDescriptor,t=(i,s,c,l)=>{for(var r=l>1?void 0:l?h(s,c):s,d=i.length-1,a;d>=0;d--)(a=i[d])&&(r=(l?a(s,c,r):a(r))||r);return l&&r&&n(s,c,r),r};exports.PdSwitch=class extends o.LitElement{constructor(){super(...arguments),this.selected=!1,this.disabled=!1,this.selectedIcon="",this.unselectedIcon="",this.showOnlySelectedIcon=!1,this.name="",this.value="on",this.ariaLabel="",this.required=!1}render(){return o.html`
2
+ <md-switch
3
+ ?selected=${this.selected}
4
+ ?disabled=${this.disabled}
5
+ ?show-only-selected-icon=${this.showOnlySelectedIcon}
6
+ name=${this.name}
7
+ value=${this.value}
8
+ aria-label=${this.ariaLabel}
9
+ ?required=${this.required}
10
+ @change=${this.handleChange}
11
+ @input=${this.handleInput}
12
+ >
13
+ ${this.selectedIcon?o.html`<md-icon slot="selected-icon">${this.selectedIcon}</md-icon>`:""}
14
+ ${this.unselectedIcon?o.html`<md-icon slot="unselected-icon">${this.unselectedIcon}</md-icon>`:""}
15
+ </md-switch>
16
+ `}handleChange(s){const c=s.target;this.selected=c.selected,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{selected:this.selected}}))}handleInput(s){const c=s.target;this.selected=c.selected,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{selected:this.selected}}))}};exports.PdSwitch.styles=o.css`
17
+ :host {
18
+ display: inline-flex;
19
+ align-items: center;
20
+ }
21
+
22
+ md-switch {
23
+ /* Apply Prioticket design system tokens */
24
+ --md-switch-selected-track-color: var(--md-sys-color-primary);
25
+ --md-switch-selected-handle-color: var(--md-sys-color-on-primary);
26
+ --md-switch-selected-focus-track-color: var(--md-sys-color-primary);
27
+ --md-switch-selected-hover-track-color: var(--md-sys-color-primary);
28
+ --md-switch-selected-pressed-track-color: var(--md-sys-color-primary);
29
+
30
+ --md-switch-unselected-track-color: var(--md-sys-color-surface-variant);
31
+ --md-switch-unselected-handle-color: var(--md-sys-color-outline);
32
+ --md-switch-unselected-focus-track-color: var(--md-sys-color-surface-variant);
33
+ --md-switch-unselected-hover-track-color: var(--md-sys-color-surface-variant);
34
+ --md-switch-unselected-pressed-track-color: var(--md-sys-color-surface-variant);
35
+
36
+ --md-switch-track-shape: var(--md-sys-shape-corner-full);
37
+ --md-switch-handle-shape: var(--md-sys-shape-corner-full);
38
+
39
+ /* Icon colors */
40
+ --md-switch-selected-icon-color: var(--md-sys-color-on-primary-container);
41
+ --md-switch-unselected-icon-color: var(--md-sys-color-surface-container-highest);
42
+ }
43
+
44
+ :host([disabled]) md-switch {
45
+ --md-switch-disabled-selected-track-color: var(--md-sys-color-on-surface);
46
+ --md-switch-disabled-selected-handle-color: var(--md-sys-color-surface);
47
+ --md-switch-disabled-unselected-track-color: var(--md-sys-color-surface-variant);
48
+ --md-switch-disabled-unselected-handle-color: var(--md-sys-color-on-surface);
49
+ opacity: 0.38;
50
+ }
51
+
52
+ /* Focus styles */
53
+ md-switch:focus-visible {
54
+ outline: 2px solid var(--md-sys-color-primary);
55
+ outline-offset: 2px;
56
+ }
57
+ `;t([e.query("md-switch")],exports.PdSwitch.prototype,"switch",2);t([e.property({type:Boolean,reflect:!0})],exports.PdSwitch.prototype,"selected",2);t([e.property({type:Boolean,reflect:!0})],exports.PdSwitch.prototype,"disabled",2);t([e.property({type:String,attribute:"selected-icon"})],exports.PdSwitch.prototype,"selectedIcon",2);t([e.property({type:String,attribute:"unselected-icon"})],exports.PdSwitch.prototype,"unselectedIcon",2);t([e.property({type:Boolean,attribute:"show-only-selected-icon"})],exports.PdSwitch.prototype,"showOnlySelectedIcon",2);t([e.property({type:String})],exports.PdSwitch.prototype,"name",2);t([e.property({type:String})],exports.PdSwitch.prototype,"value",2);t([e.property({type:String,attribute:"aria-label"})],exports.PdSwitch.prototype,"ariaLabel",2);t([e.property({type:Boolean})],exports.PdSwitch.prototype,"required",2);exports.PdSwitch=t([e.customElement("pd-switch")],exports.PdSwitch);
@@ -0,0 +1,126 @@
1
+ import { css as h, LitElement as m, html as n } from "lit";
2
+ import { query as p, property as s, customElement as u } from "lit/decorators.js";
3
+ import "@material/web/switch/switch.js";
4
+ import "@material/web/icon/icon.js";
5
+ var y = Object.defineProperty, v = Object.getOwnPropertyDescriptor, t = (r, c, i, l) => {
6
+ for (var o = l > 1 ? void 0 : l ? v(c, i) : c, d = r.length - 1, a; d >= 0; d--)
7
+ (a = r[d]) && (o = (l ? a(c, i, o) : a(o)) || o);
8
+ return l && o && y(c, i, o), o;
9
+ };
10
+ let e = class extends m {
11
+ constructor() {
12
+ super(...arguments), this.selected = !1, this.disabled = !1, this.selectedIcon = "", this.unselectedIcon = "", this.showOnlySelectedIcon = !1, this.name = "", this.value = "on", this.ariaLabel = "", this.required = !1;
13
+ }
14
+ render() {
15
+ return n`
16
+ <md-switch
17
+ ?selected=${this.selected}
18
+ ?disabled=${this.disabled}
19
+ ?show-only-selected-icon=${this.showOnlySelectedIcon}
20
+ name=${this.name}
21
+ value=${this.value}
22
+ aria-label=${this.ariaLabel}
23
+ ?required=${this.required}
24
+ @change=${this.handleChange}
25
+ @input=${this.handleInput}
26
+ >
27
+ ${this.selectedIcon ? n`<md-icon slot="selected-icon">${this.selectedIcon}</md-icon>` : ""}
28
+ ${this.unselectedIcon ? n`<md-icon slot="unselected-icon">${this.unselectedIcon}</md-icon>` : ""}
29
+ </md-switch>
30
+ `;
31
+ }
32
+ handleChange(r) {
33
+ const c = r.target;
34
+ this.selected = c.selected, this.dispatchEvent(new CustomEvent("change", {
35
+ bubbles: !0,
36
+ composed: !0,
37
+ detail: { selected: this.selected }
38
+ }));
39
+ }
40
+ handleInput(r) {
41
+ const c = r.target;
42
+ this.selected = c.selected, this.dispatchEvent(new CustomEvent("input", {
43
+ bubbles: !0,
44
+ composed: !0,
45
+ detail: { selected: this.selected }
46
+ }));
47
+ }
48
+ };
49
+ e.styles = h`
50
+ :host {
51
+ display: inline-flex;
52
+ align-items: center;
53
+ }
54
+
55
+ md-switch {
56
+ /* Apply Prioticket design system tokens */
57
+ --md-switch-selected-track-color: var(--md-sys-color-primary);
58
+ --md-switch-selected-handle-color: var(--md-sys-color-on-primary);
59
+ --md-switch-selected-focus-track-color: var(--md-sys-color-primary);
60
+ --md-switch-selected-hover-track-color: var(--md-sys-color-primary);
61
+ --md-switch-selected-pressed-track-color: var(--md-sys-color-primary);
62
+
63
+ --md-switch-unselected-track-color: var(--md-sys-color-surface-variant);
64
+ --md-switch-unselected-handle-color: var(--md-sys-color-outline);
65
+ --md-switch-unselected-focus-track-color: var(--md-sys-color-surface-variant);
66
+ --md-switch-unselected-hover-track-color: var(--md-sys-color-surface-variant);
67
+ --md-switch-unselected-pressed-track-color: var(--md-sys-color-surface-variant);
68
+
69
+ --md-switch-track-shape: var(--md-sys-shape-corner-full);
70
+ --md-switch-handle-shape: var(--md-sys-shape-corner-full);
71
+
72
+ /* Icon colors */
73
+ --md-switch-selected-icon-color: var(--md-sys-color-on-primary-container);
74
+ --md-switch-unselected-icon-color: var(--md-sys-color-surface-container-highest);
75
+ }
76
+
77
+ :host([disabled]) md-switch {
78
+ --md-switch-disabled-selected-track-color: var(--md-sys-color-on-surface);
79
+ --md-switch-disabled-selected-handle-color: var(--md-sys-color-surface);
80
+ --md-switch-disabled-unselected-track-color: var(--md-sys-color-surface-variant);
81
+ --md-switch-disabled-unselected-handle-color: var(--md-sys-color-on-surface);
82
+ opacity: 0.38;
83
+ }
84
+
85
+ /* Focus styles */
86
+ md-switch:focus-visible {
87
+ outline: 2px solid var(--md-sys-color-primary);
88
+ outline-offset: 2px;
89
+ }
90
+ `;
91
+ t([
92
+ p("md-switch")
93
+ ], e.prototype, "switch", 2);
94
+ t([
95
+ s({ type: Boolean, reflect: !0 })
96
+ ], e.prototype, "selected", 2);
97
+ t([
98
+ s({ type: Boolean, reflect: !0 })
99
+ ], e.prototype, "disabled", 2);
100
+ t([
101
+ s({ type: String, attribute: "selected-icon" })
102
+ ], e.prototype, "selectedIcon", 2);
103
+ t([
104
+ s({ type: String, attribute: "unselected-icon" })
105
+ ], e.prototype, "unselectedIcon", 2);
106
+ t([
107
+ s({ type: Boolean, attribute: "show-only-selected-icon" })
108
+ ], e.prototype, "showOnlySelectedIcon", 2);
109
+ t([
110
+ s({ type: String })
111
+ ], e.prototype, "name", 2);
112
+ t([
113
+ s({ type: String })
114
+ ], e.prototype, "value", 2);
115
+ t([
116
+ s({ type: String, attribute: "aria-label" })
117
+ ], e.prototype, "ariaLabel", 2);
118
+ t([
119
+ s({ type: Boolean })
120
+ ], e.prototype, "required", 2);
121
+ e = t([
122
+ u("pd-switch")
123
+ ], e);
124
+ export {
125
+ e as PdSwitch
126
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("lit"),i=require("lit/decorators.js");require("@material/web/tabs/tabs.js");require("@material/web/tabs/primary-tab.js");require("@material/web/tabs/secondary-tab.js");require("@material/web/icon/icon.js");var d=Object.defineProperty,b=Object.getOwnPropertyDescriptor,o=(l,t,a,e)=>{for(var s=e>1?void 0:e?b(t,a):t,n=l.length-1,c;n>=0;n--)(c=l[n])&&(s=(e?c(t,a,s):c(s))||s);return e&&s&&d(t,a,s),s};exports.PdTabs=class extends r.LitElement{constructor(){super(...arguments),this.activeTabIndex=0,this.autoActivate=!1,this.tabs=[],this.slottedTabs=[]}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.collectTabsFromSlot(),0)}firstUpdated(){this.collectTabsFromSlot(),this.updateComplete.then(()=>this.forceActiveTabUpdate())}collectTabsFromSlot(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const a=t.assignedElements({flatten:!0}),e=[];a.forEach(s=>{if(s.tagName==="PD-TAB"){const n=s;e.push({label:n.textContent?.trim()||"",icon:n.getAttribute("icon")||void 0,secondary:n.hasAttribute("secondary"),inlineIcon:n.hasAttribute("inline-icon"),ariaLabel:n.getAttribute("aria-label")||void 0})}}),this.slottedTabs=e,this.requestUpdate()}handleSlotChange(){this.collectTabsFromSlot(),this.updateComplete.then(()=>this.forceActiveTabUpdate())}forceActiveTabUpdate(){const t=this.shadowRoot?.querySelector("md-tabs");t&&this.activeTabIndex!==void 0&&(t.activeTabIndex=this.activeTabIndex)}renderTab(t,a){const e=t.icon?r.html`<md-icon slot="icon">${t.icon}</md-icon>`:"";return t.secondary?r.html`
2
+ <md-secondary-tab
3
+ ?inline-icon=${t.inlineIcon}
4
+ aria-label=${t.ariaLabel||t.label}
5
+ >
6
+ ${e}
7
+ ${t.label}
8
+ </md-secondary-tab>
9
+ `:r.html`
10
+ <md-primary-tab
11
+ ?inline-icon=${t.inlineIcon}
12
+ aria-label=${t.ariaLabel||t.label}
13
+ >
14
+ ${e}
15
+ ${t.label}
16
+ </md-primary-tab>
17
+ `}updated(t){super.updated(t),t.has("activeTabIndex")&&this.updateComplete.then(()=>this.forceActiveTabUpdate())}render(){const t=this.tabs.length>0?this.tabs:this.slottedTabs;return r.html`
18
+ <md-tabs
19
+ .activeTabIndex=${this.activeTabIndex}
20
+ ?auto-activate=${this.autoActivate}
21
+ @change=${this.handleChange}
22
+ >
23
+ ${t.map((a,e)=>this.renderTab(a,e))}
24
+ </md-tabs>
25
+ <div style="display: none;">
26
+ <slot @slotchange=${this.handleSlotChange}></slot>
27
+ </div>
28
+ `}handleChange(t){const a=t.target;this.activeTabIndex=a.activeTabIndex,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{activeTabIndex:this.activeTabIndex}}))}};o([i.property({type:Number,attribute:"active-tab-index"})],exports.PdTabs.prototype,"activeTabIndex",2);o([i.property({type:Boolean,attribute:"auto-activate"})],exports.PdTabs.prototype,"autoActivate",2);o([i.property({type:Array})],exports.PdTabs.prototype,"tabs",2);o([i.state()],exports.PdTabs.prototype,"slottedTabs",2);exports.PdTabs=o([i.customElement("pd-tabs")],exports.PdTabs);exports.PdTab=class extends r.LitElement{constructor(){super(...arguments),this.secondary=!1,this.inlineIcon=!1,this.icon="",this.ariaLabel=""}render(){return r.html`<slot></slot>`}};exports.PdTab.styles=r.css`
29
+ :host {
30
+ display: none;
31
+ }
32
+ `;o([i.property({type:Boolean})],exports.PdTab.prototype,"secondary",2);o([i.property({type:Boolean,attribute:"inline-icon"})],exports.PdTab.prototype,"inlineIcon",2);o([i.property({type:String})],exports.PdTab.prototype,"icon",2);o([i.property({type:String,attribute:"aria-label"})],exports.PdTab.prototype,"ariaLabel",2);exports.PdTab=o([i.customElement("pd-tab")],exports.PdTab);
@@ -0,0 +1,139 @@
1
+ import { css as u, LitElement as p, html as c } from "lit";
2
+ import { property as r, state as m, customElement as h } from "lit/decorators.js";
3
+ import "@material/web/tabs/tabs.js";
4
+ import "@material/web/tabs/primary-tab.js";
5
+ import "@material/web/tabs/secondary-tab.js";
6
+ import "@material/web/icon/icon.js";
7
+ var v = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (t, a, i, s) => {
8
+ for (var e = s > 1 ? void 0 : s ? T(a, i) : a, d = t.length - 1, b; d >= 0; d--)
9
+ (b = t[d]) && (e = (s ? b(a, i, e) : b(e)) || e);
10
+ return s && e && v(a, i, e), e;
11
+ };
12
+ let l = class extends p {
13
+ constructor() {
14
+ super(...arguments), this.activeTabIndex = 0, this.autoActivate = !1, this.tabs = [], this.slottedTabs = [];
15
+ }
16
+ connectedCallback() {
17
+ super.connectedCallback(), setTimeout(() => this.collectTabsFromSlot(), 0);
18
+ }
19
+ firstUpdated() {
20
+ this.collectTabsFromSlot(), this.updateComplete.then(() => this.forceActiveTabUpdate());
21
+ }
22
+ collectTabsFromSlot() {
23
+ const t = this.shadowRoot?.querySelector("slot");
24
+ if (!t) return;
25
+ const a = t.assignedElements({ flatten: !0 }), i = [];
26
+ a.forEach((s) => {
27
+ if (s.tagName === "PD-TAB") {
28
+ const e = s;
29
+ i.push({
30
+ label: e.textContent?.trim() || "",
31
+ icon: e.getAttribute("icon") || void 0,
32
+ secondary: e.hasAttribute("secondary"),
33
+ inlineIcon: e.hasAttribute("inline-icon"),
34
+ ariaLabel: e.getAttribute("aria-label") || void 0
35
+ });
36
+ }
37
+ }), this.slottedTabs = i, this.requestUpdate();
38
+ }
39
+ handleSlotChange() {
40
+ this.collectTabsFromSlot(), this.updateComplete.then(() => this.forceActiveTabUpdate());
41
+ }
42
+ forceActiveTabUpdate() {
43
+ const t = this.shadowRoot?.querySelector("md-tabs");
44
+ t && this.activeTabIndex !== void 0 && (t.activeTabIndex = this.activeTabIndex);
45
+ }
46
+ renderTab(t, a) {
47
+ const i = t.icon ? c`<md-icon slot="icon">${t.icon}</md-icon>` : "";
48
+ return t.secondary ? c`
49
+ <md-secondary-tab
50
+ ?inline-icon=${t.inlineIcon}
51
+ aria-label=${t.ariaLabel || t.label}
52
+ >
53
+ ${i}
54
+ ${t.label}
55
+ </md-secondary-tab>
56
+ ` : c`
57
+ <md-primary-tab
58
+ ?inline-icon=${t.inlineIcon}
59
+ aria-label=${t.ariaLabel || t.label}
60
+ >
61
+ ${i}
62
+ ${t.label}
63
+ </md-primary-tab>
64
+ `;
65
+ }
66
+ updated(t) {
67
+ super.updated(t), t.has("activeTabIndex") && this.updateComplete.then(() => this.forceActiveTabUpdate());
68
+ }
69
+ render() {
70
+ const t = this.tabs.length > 0 ? this.tabs : this.slottedTabs;
71
+ return c`
72
+ <md-tabs
73
+ .activeTabIndex=${this.activeTabIndex}
74
+ ?auto-activate=${this.autoActivate}
75
+ @change=${this.handleChange}
76
+ >
77
+ ${t.map((a, i) => this.renderTab(a, i))}
78
+ </md-tabs>
79
+ <div style="display: none;">
80
+ <slot @slotchange=${this.handleSlotChange}></slot>
81
+ </div>
82
+ `;
83
+ }
84
+ handleChange(t) {
85
+ const a = t.target;
86
+ this.activeTabIndex = a.activeTabIndex, this.dispatchEvent(new CustomEvent("change", {
87
+ bubbles: !0,
88
+ composed: !0,
89
+ detail: { activeTabIndex: this.activeTabIndex }
90
+ }));
91
+ }
92
+ };
93
+ o([
94
+ r({ type: Number, attribute: "active-tab-index" })
95
+ ], l.prototype, "activeTabIndex", 2);
96
+ o([
97
+ r({ type: Boolean, attribute: "auto-activate" })
98
+ ], l.prototype, "autoActivate", 2);
99
+ o([
100
+ r({ type: Array })
101
+ ], l.prototype, "tabs", 2);
102
+ o([
103
+ m()
104
+ ], l.prototype, "slottedTabs", 2);
105
+ l = o([
106
+ h("pd-tabs")
107
+ ], l);
108
+ let n = class extends p {
109
+ constructor() {
110
+ super(...arguments), this.secondary = !1, this.inlineIcon = !1, this.icon = "", this.ariaLabel = "";
111
+ }
112
+ render() {
113
+ return c`<slot></slot>`;
114
+ }
115
+ };
116
+ n.styles = u`
117
+ :host {
118
+ display: none;
119
+ }
120
+ `;
121
+ o([
122
+ r({ type: Boolean })
123
+ ], n.prototype, "secondary", 2);
124
+ o([
125
+ r({ type: Boolean, attribute: "inline-icon" })
126
+ ], n.prototype, "inlineIcon", 2);
127
+ o([
128
+ r({ type: String })
129
+ ], n.prototype, "icon", 2);
130
+ o([
131
+ r({ type: String, attribute: "aria-label" })
132
+ ], n.prototype, "ariaLabel", 2);
133
+ n = o([
134
+ h("pd-tab")
135
+ ], n);
136
+ export {
137
+ n as PdTab,
138
+ l as PdTabs
139
+ };
@@ -0,0 +1,86 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lit"),a=require("lit/static-html.js"),t=require("lit/decorators.js");require("@material/web/textfield/filled-text-field.js");require("@material/web/textfield/outlined-text-field.js");require("@material/web/icon/icon.js");var x=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(s,o,l,p)=>{for(var e=p>1?void 0:p?h(o,l):o,d=s.length-1,n;d>=0;d--)(n=s[d])&&(e=(p?n(o,l,e):n(e))||e);return p&&e&&x(o,l,e),e};exports.PdTextField=class extends i.LitElement{constructor(){super(...arguments),this.variant="outlined",this.label="",this.placeholder="",this.value="",this.supportingText="",this.errorText="",this.prefixText="",this.suffixText="",this.disabled=!1,this.readonly=!1,this.required=!1,this.error=!1,this.type="text",this.rows=2,this.cols=20,this.leadingIcon="",this.trailingIcon=""}getTextFieldTemplate(){const o=this.leadingIcon?i.html`<md-icon slot="leadingicon">${this.leadingIcon}</md-icon>`:"",l=this.trailingIcon?i.html`<md-icon slot="trailingicon">${this.trailingIcon}</md-icon>`:"",p=i.html`${o}${l}`,e={label:this.label||"",placeholder:this.placeholder||"",value:this.value||"","supporting-text":this.supportingText||"","error-text":this.errorText||"","prefix-text":this.prefixText||"","suffix-text":this.suffixText||"",disabled:this.disabled,required:this.required,error:this.error,maxlength:this.maxlength,minlength:this.minlength};if(this.type==="textarea"){const d=this.variant==="filled"?"md-filled-text-field":"md-outlined-text-field",n=a.unsafeStatic(d);return a.html`
2
+ <${n}
3
+ type="textarea"
4
+ rows=${this.rows}
5
+ cols=${this.cols}
6
+ .label=${e.label}
7
+ .placeholder=${e.placeholder}
8
+ .value=${e.value}
9
+ supporting-text=${e["supporting-text"]}
10
+ error-text=${e["error-text"]}
11
+ prefix-text=${e["prefix-text"]}
12
+ suffix-text=${e["suffix-text"]}
13
+ maxlength=${e.maxlength||i.nothing}
14
+ minlength=${e.minlength||i.nothing}
15
+ ?disabled=${e.disabled}
16
+ ?required=${e.required}
17
+ ?error=${e.error}
18
+ @input=${this._handleInput}
19
+ @change=${this._handleChange}
20
+ >
21
+ ${p}
22
+ </${n}>
23
+ `}else return this.variant==="filled"?i.html`
24
+ <md-filled-text-field
25
+ type=${this.type||"text"}
26
+ .label=${e.label}
27
+ .placeholder=${e.placeholder}
28
+ .value=${e.value}
29
+ supporting-text=${e["supporting-text"]}
30
+ error-text=${e["error-text"]}
31
+ prefix-text=${e["prefix-text"]}
32
+ suffix-text=${e["suffix-text"]}
33
+ ?disabled=${e.disabled}
34
+ ?required=${e.required}
35
+ ?error=${e.error}
36
+ maxlength=${e.maxlength||i.nothing}
37
+ minlength=${e.minlength||i.nothing}
38
+ @input=${this._handleInput}
39
+ @change=${this._handleChange}
40
+ >
41
+ ${p}
42
+ </md-filled-text-field>
43
+ `:i.html`
44
+ <md-outlined-text-field
45
+ type=${this.type||"text"}
46
+ .label=${e.label}
47
+ .placeholder=${e.placeholder}
48
+ .value=${e.value}
49
+ supporting-text=${e["supporting-text"]}
50
+ error-text=${e["error-text"]}
51
+ prefix-text=${e["prefix-text"]}
52
+ suffix-text=${e["suffix-text"]}
53
+ ?disabled=${e.disabled}
54
+ ?required=${e.required}
55
+ ?error=${e.error}
56
+ maxlength=${e.maxlength||i.nothing}
57
+ minlength=${e.minlength||i.nothing}
58
+ @input=${this._handleInput}
59
+ @change=${this._handleChange}
60
+ >
61
+ ${p}
62
+ </md-outlined-text-field>
63
+ `}render(){return this.getTextFieldTemplate()}_handleInput(o){const l=o.target;this.value=l.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:l.value},bubbles:!0}))}_handleChange(o){const l=o.target;this.value=l.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:l.value},bubbles:!0}))}};exports.PdTextField.styles=i.css`
64
+ :host {
65
+ display: block;
66
+ width: 100%;
67
+ /* Set default shape for ALL Prioticket text fields */
68
+ --md-filled-text-field-container-shape: var(--md-sys-shape-corner-small);
69
+ --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small);
70
+ }
71
+
72
+ md-filled-text-field,
73
+ md-outlined-text-field {
74
+ width: 100%;
75
+ display: block;
76
+ /* Transition for smooth visual feedback */
77
+ transition: all 150ms ease-in-out;
78
+ }
79
+
80
+ /* Textarea specific styling */
81
+ md-filled-text-field[type="textarea"],
82
+ md-outlined-text-field[type="textarea"] {
83
+ min-height: 100px;
84
+ resize: vertical;
85
+ }
86
+ `;r([t.property({type:String})],exports.PdTextField.prototype,"variant",2);r([t.property({type:String})],exports.PdTextField.prototype,"label",2);r([t.property({type:String})],exports.PdTextField.prototype,"placeholder",2);r([t.property({type:String})],exports.PdTextField.prototype,"value",2);r([t.property({type:String,attribute:"supporting-text"})],exports.PdTextField.prototype,"supportingText",2);r([t.property({type:String,attribute:"error-text"})],exports.PdTextField.prototype,"errorText",2);r([t.property({type:String,attribute:"prefix-text"})],exports.PdTextField.prototype,"prefixText",2);r([t.property({type:String,attribute:"suffix-text"})],exports.PdTextField.prototype,"suffixText",2);r([t.property({type:Boolean})],exports.PdTextField.prototype,"disabled",2);r([t.property({type:Boolean})],exports.PdTextField.prototype,"readonly",2);r([t.property({type:Boolean})],exports.PdTextField.prototype,"required",2);r([t.property({type:Boolean})],exports.PdTextField.prototype,"error",2);r([t.property({type:String})],exports.PdTextField.prototype,"type",2);r([t.property({type:Number})],exports.PdTextField.prototype,"rows",2);r([t.property({type:Number})],exports.PdTextField.prototype,"cols",2);r([t.property({type:String})],exports.PdTextField.prototype,"leadingIcon",2);r([t.property({type:String})],exports.PdTextField.prototype,"trailingIcon",2);r([t.property({type:Number})],exports.PdTextField.prototype,"maxlength",2);r([t.property({type:Number})],exports.PdTextField.prototype,"minlength",2);exports.PdTextField=r([t.customElement("pd-text-field")],exports.PdTextField);
@@ -0,0 +1,202 @@
1
+ import { css as x, LitElement as u, html as d, nothing as p } from "lit";
2
+ import { unsafeStatic as f, html as g } from "lit/static-html.js";
3
+ import { property as i, customElement as m } from "lit/decorators.js";
4
+ import "@material/web/textfield/filled-text-field.js";
5
+ import "@material/web/textfield/outlined-text-field.js";
6
+ import "@material/web/icon/icon.js";
7
+ var c = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (n, l, a, t) => {
8
+ for (var o = t > 1 ? void 0 : t ? y(l, a) : l, s = n.length - 1, h; s >= 0; s--)
9
+ (h = n[s]) && (o = (t ? h(l, a, o) : h(o)) || o);
10
+ return t && o && c(l, a, o), o;
11
+ };
12
+ let e = class extends u {
13
+ constructor() {
14
+ super(...arguments), this.variant = "outlined", this.label = "", this.placeholder = "", this.value = "", this.supportingText = "", this.errorText = "", this.prefixText = "", this.suffixText = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.error = !1, this.type = "text", this.rows = 2, this.cols = 20, this.leadingIcon = "", this.trailingIcon = "";
15
+ }
16
+ getTextFieldTemplate() {
17
+ const n = this.leadingIcon ? d`<md-icon slot="leadingicon">${this.leadingIcon}</md-icon>` : "", l = this.trailingIcon ? d`<md-icon slot="trailingicon">${this.trailingIcon}</md-icon>` : "", a = d`${n}${l}`, t = {
18
+ label: this.label || "",
19
+ placeholder: this.placeholder || "",
20
+ value: this.value || "",
21
+ "supporting-text": this.supportingText || "",
22
+ "error-text": this.errorText || "",
23
+ "prefix-text": this.prefixText || "",
24
+ "suffix-text": this.suffixText || "",
25
+ disabled: this.disabled,
26
+ required: this.required,
27
+ error: this.error,
28
+ maxlength: this.maxlength,
29
+ minlength: this.minlength
30
+ };
31
+ if (this.type === "textarea") {
32
+ const o = this.variant === "filled" ? "md-filled-text-field" : "md-outlined-text-field", s = f(o);
33
+ return g`
34
+ <${s}
35
+ type="textarea"
36
+ rows=${this.rows}
37
+ cols=${this.cols}
38
+ .label=${t.label}
39
+ .placeholder=${t.placeholder}
40
+ .value=${t.value}
41
+ supporting-text=${t["supporting-text"]}
42
+ error-text=${t["error-text"]}
43
+ prefix-text=${t["prefix-text"]}
44
+ suffix-text=${t["suffix-text"]}
45
+ maxlength=${t.maxlength || p}
46
+ minlength=${t.minlength || p}
47
+ ?disabled=${t.disabled}
48
+ ?required=${t.required}
49
+ ?error=${t.error}
50
+ @input=${this._handleInput}
51
+ @change=${this._handleChange}
52
+ >
53
+ ${a}
54
+ </${s}>
55
+ `;
56
+ } else return this.variant === "filled" ? d`
57
+ <md-filled-text-field
58
+ type=${this.type || "text"}
59
+ .label=${t.label}
60
+ .placeholder=${t.placeholder}
61
+ .value=${t.value}
62
+ supporting-text=${t["supporting-text"]}
63
+ error-text=${t["error-text"]}
64
+ prefix-text=${t["prefix-text"]}
65
+ suffix-text=${t["suffix-text"]}
66
+ ?disabled=${t.disabled}
67
+ ?required=${t.required}
68
+ ?error=${t.error}
69
+ maxlength=${t.maxlength || p}
70
+ minlength=${t.minlength || p}
71
+ @input=${this._handleInput}
72
+ @change=${this._handleChange}
73
+ >
74
+ ${a}
75
+ </md-filled-text-field>
76
+ ` : d`
77
+ <md-outlined-text-field
78
+ type=${this.type || "text"}
79
+ .label=${t.label}
80
+ .placeholder=${t.placeholder}
81
+ .value=${t.value}
82
+ supporting-text=${t["supporting-text"]}
83
+ error-text=${t["error-text"]}
84
+ prefix-text=${t["prefix-text"]}
85
+ suffix-text=${t["suffix-text"]}
86
+ ?disabled=${t.disabled}
87
+ ?required=${t.required}
88
+ ?error=${t.error}
89
+ maxlength=${t.maxlength || p}
90
+ minlength=${t.minlength || p}
91
+ @input=${this._handleInput}
92
+ @change=${this._handleChange}
93
+ >
94
+ ${a}
95
+ </md-outlined-text-field>
96
+ `;
97
+ }
98
+ render() {
99
+ return this.getTextFieldTemplate();
100
+ }
101
+ _handleInput(n) {
102
+ const l = n.target;
103
+ this.value = l.value, this.dispatchEvent(new CustomEvent("input", {
104
+ detail: { value: l.value },
105
+ bubbles: !0
106
+ }));
107
+ }
108
+ _handleChange(n) {
109
+ const l = n.target;
110
+ this.value = l.value, this.dispatchEvent(new CustomEvent("change", {
111
+ detail: { value: l.value },
112
+ bubbles: !0
113
+ }));
114
+ }
115
+ };
116
+ e.styles = x`
117
+ :host {
118
+ display: block;
119
+ width: 100%;
120
+ /* Set default shape for ALL Prioticket text fields */
121
+ --md-filled-text-field-container-shape: var(--md-sys-shape-corner-small);
122
+ --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small);
123
+ }
124
+
125
+ md-filled-text-field,
126
+ md-outlined-text-field {
127
+ width: 100%;
128
+ display: block;
129
+ /* Transition for smooth visual feedback */
130
+ transition: all 150ms ease-in-out;
131
+ }
132
+
133
+ /* Textarea specific styling */
134
+ md-filled-text-field[type="textarea"],
135
+ md-outlined-text-field[type="textarea"] {
136
+ min-height: 100px;
137
+ resize: vertical;
138
+ }
139
+ `;
140
+ r([
141
+ i({ type: String })
142
+ ], e.prototype, "variant", 2);
143
+ r([
144
+ i({ type: String })
145
+ ], e.prototype, "label", 2);
146
+ r([
147
+ i({ type: String })
148
+ ], e.prototype, "placeholder", 2);
149
+ r([
150
+ i({ type: String })
151
+ ], e.prototype, "value", 2);
152
+ r([
153
+ i({ type: String, attribute: "supporting-text" })
154
+ ], e.prototype, "supportingText", 2);
155
+ r([
156
+ i({ type: String, attribute: "error-text" })
157
+ ], e.prototype, "errorText", 2);
158
+ r([
159
+ i({ type: String, attribute: "prefix-text" })
160
+ ], e.prototype, "prefixText", 2);
161
+ r([
162
+ i({ type: String, attribute: "suffix-text" })
163
+ ], e.prototype, "suffixText", 2);
164
+ r([
165
+ i({ type: Boolean })
166
+ ], e.prototype, "disabled", 2);
167
+ r([
168
+ i({ type: Boolean })
169
+ ], e.prototype, "readonly", 2);
170
+ r([
171
+ i({ type: Boolean })
172
+ ], e.prototype, "required", 2);
173
+ r([
174
+ i({ type: Boolean })
175
+ ], e.prototype, "error", 2);
176
+ r([
177
+ i({ type: String })
178
+ ], e.prototype, "type", 2);
179
+ r([
180
+ i({ type: Number })
181
+ ], e.prototype, "rows", 2);
182
+ r([
183
+ i({ type: Number })
184
+ ], e.prototype, "cols", 2);
185
+ r([
186
+ i({ type: String })
187
+ ], e.prototype, "leadingIcon", 2);
188
+ r([
189
+ i({ type: String })
190
+ ], e.prototype, "trailingIcon", 2);
191
+ r([
192
+ i({ type: Number })
193
+ ], e.prototype, "maxlength", 2);
194
+ r([
195
+ i({ type: Number })
196
+ ], e.prototype, "minlength", 2);
197
+ e = r([
198
+ m("pd-text-field")
199
+ ], e);
200
+ export {
201
+ e as PdTextField
202
+ };