@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/dist/accordion-item.js +28 -38
- package/dist/accordion-item.js.map +1 -1
- package/dist/accordion.js +8 -0
- package/dist/accordion.js.map +1 -1
- package/dist/button.js +17 -17
- package/dist/button.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +27 -18
- package/dist/custom-elements.json +38 -38
- package/dist/pagination.js +15 -10
- package/dist/pagination.js.map +1 -1
- package/dist/src/accordion/accordion-item.d.ts +0 -6
- package/dist/src/accordion/accordion.d.ts +5 -0
- package/dist/src/button/button/button.d.ts +16 -16
- package/dist/table.js +4 -9
- package/dist/table.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/src/accordion/accordion-item.scss +34 -12
- package/src/accordion/accordion-item.ts +27 -38
- package/src/accordion/accordion.ts +7 -0
- package/src/button/button/button.ts +17 -17
- package/src/pagination/pagination.scss +15 -10
- package/src/table/table.scss +3 -9
- package/src/table/table.ts +1 -1
package/package.json
CHANGED
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.
|
|
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.
|
|
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(
|
|
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)
|
|
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(
|
|
134
|
-
|
|
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(
|
|
167
|
-
|
|
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
|
|
199
|
+
:host-context([leading-toggle]) {
|
|
174
200
|
.header-button {
|
|
175
|
-
flex-direction: row
|
|
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.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
<
|
|
153
|
-
|
|
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
|
|
47
|
+
* @cssprop --button-container-shape - Defines the border radius of the button container shape.
|
|
48
48
|
*
|
|
49
|
-
* @cssprop --button-container-shape-start-start
|
|
50
|
-
* @cssprop --button-container-shape-start-end
|
|
51
|
-
* @cssprop --button-container-shape-end-start
|
|
52
|
-
* @cssprop --button-container-shape-end-end
|
|
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
|
|
56
|
-
* @cssprop --filled-button-label-text-color
|
|
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
|
|
59
|
-
* @cssprop --outlined-button-label-text-color
|
|
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
|
|
61
|
+
* @cssprop --text-button-label-text-color - Text color of the text button label.
|
|
62
62
|
*
|
|
63
|
-
* @cssprop --tonal-button-container-color
|
|
64
|
-
* @cssprop --tonal-button-label-text-color
|
|
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
|
|
67
|
-
* @cssprop --elevated-button-label-text-color
|
|
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
|
|
70
|
-
* @cssprop --neo-button-label-text-color
|
|
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 =
|
|
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:
|
|
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
|
-
@
|
|
18
|
-
flex-wrap:
|
|
19
|
-
justify-content:
|
|
20
|
-
row-gap:
|
|
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
|
-
|
|
46
|
+
order: 3;
|
|
47
|
+
margin-inline-start: 0;
|
|
48
|
+
inline-size: 100%;
|
|
44
49
|
display: flex;
|
|
45
50
|
align-items: center;
|
|
46
51
|
|
|
47
|
-
@
|
|
48
|
-
order:
|
|
49
|
-
margin-inline-start:
|
|
50
|
-
inline-size:
|
|
52
|
+
@container (min-width: 48rem) {
|
|
53
|
+
order: 0;
|
|
54
|
+
margin-inline-start: auto;
|
|
55
|
+
inline-size: auto;
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
|
package/src/table/table.scss
CHANGED
|
@@ -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)
|
|
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-
|
|
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);
|