@pure-ds/core 0.4.11 → 0.4.13

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.
@@ -135,10 +135,7 @@ class DateHelper {
135
135
  * @csspart day - Individual day cells
136
136
  * @csspart task - Event items within days
137
137
  */
138
- customElements.define(
139
- "pds-calendar",
140
-
141
- class extends HTMLElement {
138
+ class PdsCalendar extends HTMLElement {
142
139
  #date;
143
140
  #dayNames;
144
141
  #monthNames;
@@ -520,8 +517,8 @@ button.btn-xs {
520
517
  this.startDay = new Date(this.year, this.month, 0).getDay();
521
518
 
522
519
  const calendarHtml = /*html*/ `
523
- <div class="calendar-container">
524
- <nav class="calendar-header">
520
+ <div class="calendar-container" part="calendar-container">
521
+ <nav class="calendar-header" part="calendar-header">
525
522
  <button class="btn-outline prev btn-xs"><pds-icon icon="arrow-left" size="xs"></pds-icon></button>
526
523
  <div class="current-month">
527
524
  <h3 class="month-name">${this.#monthNames[this.month]}</h3>
@@ -530,7 +527,7 @@ button.btn-xs {
530
527
  <button class="btn-outline next btn-xs"><pds-icon icon="arrow-right" size="xs"></pds-icon></button>
531
528
  </nav>
532
529
 
533
- <div class="calendar">
530
+ <div class="calendar" part="calendar">
534
531
  ${this.getDayNamesHtml()}
535
532
  ${this.getDaysHtml()}
536
533
  </div>
@@ -763,7 +760,7 @@ button.btn-xs {
763
760
  for (const item of list) {
764
761
  const html = /*html*/ `<div class="task task--${
765
762
  item.type || "info"
766
- }">
763
+ }" part="task">
767
764
  <div class="task__detail">
768
765
  <h3>
769
766
  ${item.title}
@@ -816,22 +813,23 @@ button.btn-xs {
816
813
  this.month === todayMonth && this.year === todayYear;
817
814
 
818
815
  for (let i = 0; i < this.startDay; i++) {
819
- html.add(/*html*/ `<div class="day day-disabled"></div>`);
816
+ html.add(/*html*/ `<div class="day day-disabled" part="day"></div>`);
820
817
  }
821
818
  for (let i = 1; i <= this.daysInMonth; i++) {
822
819
  const isTodayClass =
823
820
  isCurrentMonth && i === todayDay ? "day-today" : "";
824
821
  html.add(/*html*/ `
825
- <div data-day="${i}" class="day ${isTodayClass}">
822
+ <div data-day="${i}" class="day ${isTodayClass}" part="day">
826
823
  <span class="nr">${i}<span>
827
824
  </div>`);
828
825
  }
829
826
  const endDay =
830
827
  6 - new Date(this.year, this.month, this.daysInMonth).getDay();
831
828
  for (let i = 1; i <= endDay; i++) {
832
- html.add(/*html*/ `<div class="day day-disabled"></div>`);
829
+ html.add(/*html*/ `<div class="day day-disabled" part="day"></div>`);
833
830
  }
834
831
  return html.toHTML();
835
832
  }
836
833
  }
837
- );
834
+ }
835
+ customElements.define("pds-calendar", PdsCalendar);
@@ -19,7 +19,7 @@ const PDS = window.PDS;
19
19
  * @csspart grab-handle - The drag handle indicator
20
20
  * @csspart content - The drawer content section
21
21
  */
22
- customElements.define("pds-drawer", class extends HTMLElement {
22
+ class PdsDrawer extends HTMLElement {
23
23
  #isDragging = false;
24
24
  #startX = 0;
25
25
  #startY = 0;
@@ -854,4 +854,5 @@ customElements.define("pds-drawer", class extends HTMLElement {
854
854
  }
855
855
  }
856
856
  }
857
- })
857
+ }
858
+ customElements.define("pds-drawer", PdsDrawer);
@@ -4,7 +4,10 @@
4
4
  * @element pds-scrollrow
5
5
  * @slot default - Scrollable tile content
6
6
  * @slot heading - Optional heading content rendered in the component header
7
+ *
7
8
  * @csspart viewport - The scrollable container element
9
+ * @csspart prev - The previous/left scroll navigation button
10
+ * @csspart next - The next/right scroll navigation button
8
11
  *
9
12
  * @attr {string} label - Accessible label for the scroll region; also used as fallback heading copy
10
13
  * @attr {"start"|"center"} snap - Snap alignment for tiles when scrolling (default: start)
@@ -16,6 +16,7 @@
16
16
  * @slot right - Content for the right (or bottom) panel.
17
17
  *
18
18
  * @csspart toggle - The mobile toggle button.
19
+ * @csspart splitter - The draggable splitter bar between panels.
19
20
  *
20
21
  * @cssprop --left-width - Width of the left panel in horizontal layout.
21
22
  * @cssprop --color-border - Color of the splitter bar.
@@ -39,9 +40,7 @@
39
40
  * <div slot="right">Bottom Panel Content</div>
40
41
  * </pds-splitpanel>
41
42
  */
42
- customElements.define(
43
- "pds-splitpanel",
44
- class extends HTMLElement {
43
+ class PdsSplitpanel extends HTMLElement {
45
44
  static get observedAttributes() {
46
45
  return ["layout", "defaultsplit", "breakpoint", "open"];
47
46
  }
@@ -165,7 +164,7 @@ customElements.define(
165
164
  <div class="left-panel">
166
165
  <slot name="left"></slot>
167
166
  </div>
168
- <div class="splitter"></div>
167
+ <div class="splitter" part="splitter"></div>
169
168
  <div class="right-panel">
170
169
  <slot name="right"></slot>
171
170
  </div>
@@ -186,7 +185,7 @@ customElements.define(
186
185
  :host {
187
186
  display: flex;
188
187
  position: relative;
189
- height: 100%;
188
+ min-height: 0;
190
189
  width: 100%;
191
190
  }
192
191
 
@@ -218,11 +217,11 @@ customElements.define(
218
217
  cursor: col-resize;
219
218
  position: relative;
220
219
  z-index: 1;
220
+ align-self: stretch;
221
221
  }
222
222
 
223
223
  :host([layout="horizontal"]) .splitter {
224
224
  width: 5px;
225
- height: 100%;
226
225
  }
227
226
 
228
227
  :host([layout="vertical"]) .splitter {
@@ -398,4 +397,4 @@ customElements.define(
398
397
  this.$icon.setAttribute("icon", this._open ? "x" : "list");
399
398
  }
400
399
  }
401
- );
400
+ customElements.define("pds-splitpanel", PdsSplitpanel);
@@ -3,17 +3,17 @@
3
3
  "tags": [
4
4
  {
5
5
  "name": "pds-calendar",
6
- "description": "anonymous_0 component",
6
+ "description": "PdsCalendar component",
7
7
  "attributes": [
8
8
  {
9
9
  "name": "date",
10
- "description": ""
10
+ "description": "The date to display (defaults to current date). Accepts any valid date string"
11
11
  }
12
12
  ]
13
13
  },
14
14
  {
15
- "name": "pds-calendar",
16
- "description": "anonymous_0 component",
15
+ "name": "pds-drawer",
16
+ "description": "PdsDrawer component",
17
17
  "attributes": [
18
18
  {
19
19
  "name": "open",
@@ -726,24 +726,24 @@
726
726
  ]
727
727
  },
728
728
  {
729
- "name": "pds-calendar",
730
- "description": "anonymous_0 component",
729
+ "name": "pds-splitpanel",
730
+ "description": "PdsSplitpanel component",
731
731
  "attributes": [
732
732
  {
733
733
  "name": "layout",
734
- "description": ""
734
+ "description": "The layout direction of the panels. Can be \"horizontal\" or \"vertical\". Defaults to \"horizontal\"."
735
735
  },
736
736
  {
737
737
  "name": "defaultsplit",
738
- "description": ""
738
+ "description": "The initial size of the primary (left/top) panel. Defaults to \"450px\"."
739
739
  },
740
740
  {
741
741
  "name": "breakpoint",
742
- "description": ""
742
+ "description": "The viewport width in pixels below which the component switches to mobile view. Defaults to 1024."
743
743
  },
744
744
  {
745
745
  "name": "open",
746
- "description": ""
746
+ "description": "Controls the visibility of the primary panel in mobile view."
747
747
  }
748
748
  ]
749
749
  },
@@ -815,6 +815,11 @@
815
815
  "description": "Creates a toggle switch element from a checkbox.\n\nExample:\n<label data-toggle>\n<input type=\"checkbox\">\n<span data-label>Enable notifications</span>\n</label>",
816
816
  "valueSet": "v"
817
817
  },
818
+ {
819
+ "name": "data-required",
820
+ "description": "Enhances required form fields using an asterisk in the label.\n\nExample:\n<form data-required action=\"#\" method=\"post\">\n<label>\n<span>Field Label</span>\n<input type=\"text\" required>\n</label>\n<nav class=\"form-actions\">\n<button type=\"submit\" class=\"btn-primary\">Submit</button>\n</nav>\n</form>",
821
+ "valueSet": "v"
822
+ },
818
823
  {
819
824
  "name": "data-open",
820
825
  "description": "Enhances a checkbox/radio group to be open (have a way to add and remove items).\n\nExample:\n<fieldset role=\"group\" data-open>\n<label>\n<span data-label>Test</span>\n<input value=\"lala\" name=\"test1\" type=\"radio\" />\n</label>\n</fieldset>",
@@ -5,8 +5,10 @@ function enhanceAccordion(elem) {
5
5
  elem.dataset.enhancedAccordion = "true";
6
6
 
7
7
  elem.addEventListener("toggle", (event) => {
8
- if (event.target.open) {
9
- elem.querySelectorAll("details[open]").forEach((details) => {
8
+ // Only handle toggle events from direct child details elements
9
+ // to avoid closing parent details when nested accordions are used
10
+ if (event.target.open && event.target.parentElement === elem) {
11
+ elem.querySelectorAll(":scope > details[open]").forEach((details) => {
10
12
  if (details !== event.target) {
11
13
  details.open = false;
12
14
  }