@redvars/peacock 3.8.4 → 3.8.5

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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@redvars/peacock",
3
3
  "description": "The foundation for beautiful user interfaces",
4
4
  "license": "Apache-2.0",
5
- "version": "3.8.4",
5
+ "version": "3.8.5",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -44,9 +44,9 @@ Visit [https://peacock.redvars.com](https://peacock.redvars.com) to view the doc
44
44
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
45
45
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
46
46
 
47
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.4/dist/assets/styles.css"></link>
47
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.5/dist/assets/styles.css"></link>
48
48
  <script type='module'
49
- src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.4/dist/loader.js'></script>
49
+ src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.8.5/dist/loader.js'></script>
50
50
  </head>
51
51
 
52
52
  <wc-button>Button</wc-button>
@@ -13,7 +13,10 @@
13
13
  .expansion-panel {
14
14
  border: var(--_accordion-item-border, 1px solid var(--color-outline-variant));
15
15
  border-radius: var(--shape-corner-medium); // 12dp — M3 medium shape
16
- background-color: var(--_accordion-item-background, var(--color-surface-container-low));
16
+ background-color: var(
17
+ --_accordion-item-background,
18
+ var(--color-surface-container-low)
19
+ );
17
20
  overflow: hidden; // clip children to border-radius
18
21
  transition:
19
22
  background-color var(--duration-medium1) var(--easing-standard),
@@ -24,6 +27,7 @@
24
27
  .header-button {
25
28
  position: relative;
26
29
  display: flex;
30
+ flex-direction: row-reverse;
27
31
  align-items: center;
28
32
  width: 100%;
29
33
  min-height: 3rem; // 48dp — grows with description
@@ -62,6 +66,11 @@
62
66
  }
63
67
  }
64
68
 
69
+ .header-content {
70
+ display: flex;
71
+ flex: 1;
72
+ }
73
+
65
74
  // ─── Header Label (title + description column) ──────────────────────────────
66
75
 
67
76
  .header-label {
@@ -117,7 +126,8 @@
117
126
  .panel-content {
118
127
  display: grid;
119
128
  grid-template-rows: 0fr;
120
- transition: grid-template-rows var(--duration-medium1) var(--easing-standard);
129
+ transition: grid-template-rows var(--duration-medium1)
130
+ var(--easing-standard);
121
131
  }
122
132
 
123
133
  .content-inner {
@@ -130,8 +140,16 @@
130
140
  // ─── Disabled State ─────────────────────────────────────────────────────────
131
141
 
132
142
  &.disabled {
133
- background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
134
- border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
143
+ background-color: color-mix(
144
+ in srgb,
145
+ var(--color-surface-container-low) 38%,
146
+ transparent
147
+ );
148
+ border-color: color-mix(
149
+ in srgb,
150
+ var(--color-outline-variant) 38%,
151
+ transparent
152
+ );
135
153
 
136
154
  .header-button {
137
155
  cursor: not-allowed;
@@ -163,20 +181,24 @@
163
181
  // ─── Disabled State (border + bg dimmed) ────────────────────────────────────
164
182
 
165
183
  &.disabled {
166
- background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
167
- border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
184
+ background-color: color-mix(
185
+ in srgb,
186
+ var(--color-surface-container-low) 38%,
187
+ transparent
188
+ );
189
+ border-color: color-mix(
190
+ in srgb,
191
+ var(--color-outline-variant) 38%,
192
+ transparent
193
+ );
168
194
  }
169
195
  }
170
196
 
171
197
  // ─── Toggle position: before ─────────────────────────────────────────────────
172
198
 
173
- :host([toggle-position='before']) {
199
+ :host-context([leading-toggle]) {
174
200
  .header-button {
175
- flex-direction: row-reverse;
201
+ flex-direction: row;
176
202
  justify-content: flex-end;
177
203
  }
178
-
179
- .header-label {
180
- flex: 1;
181
- }
182
204
  }
@@ -56,14 +56,6 @@ export class AccordionItem extends LitElement {
56
56
  @property({ type: Boolean, reflect: true, attribute: 'hide-toggle' })
57
57
  hideToggle: boolean = false;
58
58
 
59
- /**
60
- * Position of the toggle icon relative to the panel title.
61
- * `'after'` places it at the trailing end (default, matches M3).
62
- * `'before'` places it at the leading start.
63
- */
64
- @property({ type: String, reflect: true, attribute: 'toggle-position' })
65
- togglePosition: 'before' | 'after' = 'after';
66
-
67
59
  /** True when the `description` slot contains at least one non-empty node. */
68
60
  @state()
69
61
  private _hasDescriptionSlot = false;
@@ -136,37 +128,34 @@ export class AccordionItem extends LitElement {
136
128
  ?disabled=${this.disabled}
137
129
  @click=${this._handleToggle}
138
130
  >
139
- ${this.togglePosition === 'before'
140
- ? this._renderToggleIcon()
141
- : nothing}
142
- <span class="header-label">
143
- <span part="title" class="panel-title">
144
- <slot
145
- name="heading"
146
- @slotchange=${(e: Event) =>
147
- AccordionItem._onSlotChange(e, v => {
148
- this._hasHeadingSlot = v;
149
- })}
150
- ></slot>
131
+ ${this._renderToggleIcon()}
132
+ <div class="header-content">
133
+ <span class="header-label">
134
+ <span part="title" class="panel-title">
135
+ <slot
136
+ name="heading"
137
+ @slotchange=${(e: Event) =>
138
+ AccordionItem._onSlotChange(e, v => {
139
+ this._hasHeadingSlot = v;
140
+ })}
141
+ ></slot>
142
+ </span>
143
+ <span
144
+ part="description"
145
+ class="panel-description"
146
+ ?hidden=${!this._hasDescriptionSlot}
147
+ >
148
+ <slot
149
+ name="description"
150
+ @slotchange=${(e: Event) =>
151
+ AccordionItem._onSlotChange(e, v => {
152
+ this._hasDescriptionSlot = v;
153
+ })}
154
+ ></slot>
155
+ </span>
151
156
  </span>
152
- <span
153
- part="description"
154
- class="panel-description"
155
- ?hidden=${!this._hasDescriptionSlot}
156
- >
157
- <slot
158
- name="description"
159
- @slotchange=${(e: Event) =>
160
- AccordionItem._onSlotChange(e, v => {
161
- this._hasDescriptionSlot = v;
162
- })}
163
- ></slot>
164
- </span>
165
- </span>
166
- <slot name="header-actions" class="header-actions"></slot>
167
- ${this.togglePosition === 'after'
168
- ? this._renderToggleIcon()
169
- : nothing}
157
+ <slot name="header-actions" class="header-actions"></slot>
158
+ </div>
170
159
  </button>
171
160
  <div
172
161
  id=${`panel-content-${this.#id}`}
@@ -45,6 +45,13 @@ export class Accordion extends LitElement {
45
45
  @property({ type: String, reflect: true })
46
46
  variant: 'default' | 'flat' = 'default';
47
47
 
48
+ /**
49
+ * When `true`, the toggle icon is placed at the leading start of the header.
50
+ * When `false` (default), the icon is placed at the trailing end.
51
+ */
52
+ @property({ type: Boolean, reflect: true, attribute: 'leading-toggle' })
53
+ leadingToggle = false;
54
+
48
55
  @queryAssignedElements({ selector: 'wc-accordion-item' })
49
56
  items!: Array<AccordionItem>;
50
57
 
@@ -44,30 +44,30 @@ export type {
44
44
  * @overview
45
45
  * <p>Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. Button labels express what action will occur when the user interacts with it.</p>
46
46
  *
47
- * @cssprop --button-container-shape: Defines the border radius of the button container shape.
47
+ * @cssprop --button-container-shape - Defines the border radius of the button container shape.
48
48
  *
49
- * @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.
50
- * @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.
51
- * @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.
52
- * @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.
49
+ * @cssprop --button-container-shape-start-start - Defines the start position of the button container shape.
50
+ * @cssprop --button-container-shape-start-end - Defines the end position of the button container shape.
51
+ * @cssprop --button-container-shape-end-start - Defines the start position of the button container shape.
52
+ * @cssprop --button-container-shape-end-end - Defines the end position of the button container shape.
53
53
  *
54
54
  *
55
- * @cssprop --filled-button-container-color: Color of the filled button container.
56
- * @cssprop --filled-button-label-text-color: Text color of the filled button label.
55
+ * @cssprop --filled-button-container-color - Color of the filled button container.
56
+ * @cssprop --filled-button-label-text-color - Text color of the filled button label.
57
57
  *
58
- * @cssprop --outlined-button-container-color: Color of the outlined button container.
59
- * @cssprop --outlined-button-label-text-color: Text color of the outlined button label.
58
+ * @cssprop --outlined-button-container-color - Color of the outlined button container.
59
+ * @cssprop --outlined-button-label-text-color - Text color of the outlined button label.
60
60
  *
61
- * @cssprop --text-button-label-text-color: Text color of the text button label.
61
+ * @cssprop --text-button-label-text-color - Text color of the text button label.
62
62
  *
63
- * @cssprop --tonal-button-container-color: Color of the tonal button container.
64
- * @cssprop --tonal-button-label-text-color: Text color of the tonal button label.
63
+ * @cssprop --tonal-button-container-color - Color of the tonal button container.
64
+ * @cssprop --tonal-button-label-text-color - Text color of the tonal button label.
65
65
  *
66
- * @cssprop --elevated-button-container-color: Color of the elevated button container.
67
- * @cssprop --elevated-button-label-text-color: Text color of the elevated button label.
66
+ * @cssprop --elevated-button-container-color - Color of the elevated button container.
67
+ * @cssprop --elevated-button-label-text-color - Text color of the elevated button label.
68
68
  *
69
- * @cssprop --neo-button-container-color: Color of the neo button container.
70
- * @cssprop --neo-button-label-text-color: Text color of the neo button label.
69
+ * @cssprop --neo-button-container-color - Color of the neo button container.
70
+ * @cssprop --neo-button-label-text-color - Text color of the neo button label.
71
71
  *
72
72
  * @fires {MouseEvent} click - Dispatched when the button is clicked.
73
73
  *
@@ -104,7 +104,7 @@ export class Button extends mixinBaseButton(
104
104
  * When `false`, the icon is placed before the label (leading).
105
105
  */
106
106
  @property({ type: Boolean, reflect: true, attribute: 'trailing-icon' })
107
- trailingIcon = true;
107
+ trailingIcon = false;
108
108
 
109
109
  /**
110
110
  * Button size.
@@ -4,20 +4,23 @@
4
4
 
5
5
  :host {
6
6
  display: block;
7
+ container-type: inline-size;
7
8
  }
8
9
 
9
10
  .pagination {
10
11
  display: flex;
11
12
  align-items: center;
12
- justify-content: flex-end;
13
+ justify-content: space-between;
14
+ flex-wrap: wrap;
13
15
  gap: var(--spacing-200, 1rem);
16
+ row-gap: var(--spacing-100, 0.5rem);
14
17
  background: var(--color-surface, #fff);
15
18
  padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
16
19
 
17
- @media (max-width: 48rem) {
18
- flex-wrap: wrap;
19
- justify-content: space-between;
20
- row-gap: var(--spacing-100, 0.5rem);
20
+ @container (min-width: 48rem) {
21
+ flex-wrap: nowrap;
22
+ justify-content: flex-end;
23
+ row-gap: 0;
21
24
  }
22
25
 
23
26
  .page-size {
@@ -40,14 +43,16 @@
40
43
  }
41
44
 
42
45
  .pagination-item-count {
43
- margin-inline-start: auto;
46
+ order: 3;
47
+ margin-inline-start: 0;
48
+ inline-size: 100%;
44
49
  display: flex;
45
50
  align-items: center;
46
51
 
47
- @media (max-width: 48rem) {
48
- order: 3;
49
- margin-inline-start: 0;
50
- inline-size: 100%;
52
+ @container (min-width: 48rem) {
53
+ order: 0;
54
+ margin-inline-start: auto;
55
+ inline-size: auto;
51
56
  }
52
57
  }
53
58
 
@@ -8,7 +8,8 @@
8
8
  min-height: 20em;
9
9
  --table-border-color: var(--color-outline-variant);
10
10
  --table-border: 1px solid var(--table-border-color);
11
- --table-col-content-padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
11
+ --table-col-content-padding: var(--spacing-150, 0.75rem)
12
+ var(--spacing-200, 1rem);
12
13
  }
13
14
 
14
15
  .table {
@@ -86,11 +87,7 @@
86
87
  }
87
88
 
88
89
  .col-action {
89
- --button-border-radius: 0;
90
-
91
- &.has-focus {
92
- z-index: 12;
93
- }
90
+ --button-container-shape: 0;
94
91
  }
95
92
 
96
93
  .checkbox {
@@ -110,7 +107,6 @@
110
107
  .fixed-columns {
111
108
  position: sticky;
112
109
  left: 0;
113
- z-index: 1;
114
110
  }
115
111
 
116
112
  .scrollable-columns {
@@ -119,7 +115,6 @@
119
115
  }
120
116
 
121
117
  .header {
122
- z-index: 2;
123
118
  position: sticky;
124
119
  top: 0;
125
120
 
@@ -157,7 +152,6 @@
157
152
  &:focus {
158
153
  outline: none;
159
154
  border-bottom-color: var(--color-primary);
160
- z-index: 1;
161
155
 
162
156
  .col-content {
163
157
  border-color: var(--color-primary);
@@ -237,7 +237,7 @@ export class Table extends LitElement {
237
237
  ? 'keyboard_arrow_up'
238
238
  : 'keyboard_arrow_down';
239
239
  }
240
- return '';
240
+ return 'unfold_more';
241
241
  }
242
242
 
243
243
  private onSortClick(col: TableColumn) {