@redvars/peacock 3.8.5 → 3.9.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.
- package/dist/button.js +4 -0
- package/dist/button.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +249 -15
- package/dist/custom-elements.json +1029 -167
- package/dist/floating-controller-CZYwnRVu.js +185 -0
- package/dist/floating-controller-CZYwnRVu.js.map +1 -0
- package/dist/{floating-controller-CnUZnOhK.js → floating-ui.dom-oQieRCpS.js} +2 -183
- package/dist/floating-ui.dom-oQieRCpS.js.map +1 -0
- package/dist/html-editor.js +3 -21091
- package/dist/html-editor.js.map +1 -1
- package/dist/index-DcbiqHpf.js +21091 -0
- package/dist/index-DcbiqHpf.js.map +1 -0
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/loader.js +15 -2
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +4439 -0
- package/dist/markdown-editor.js.map +1 -0
- package/dist/menu.js +2 -1
- package/dist/menu.js.map +1 -1
- package/dist/popover.js +2 -1
- package/dist/popover.js.map +1 -1
- package/dist/{select-D85kpjUt.js → select-CnnPbvpQ.js} +68 -71
- package/dist/select-CnnPbvpQ.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/input/input.d.ts +5 -5
- package/dist/src/markdown-editor/index.d.ts +2 -0
- package/dist/src/markdown-editor/markdown-editor.d.ts +116 -0
- package/dist/src/timeline/index.d.ts +2 -0
- package/dist/src/timeline/timeline-item.d.ts +23 -0
- package/dist/src/timeline/timeline.d.ts +27 -0
- package/dist/sub-menu.js +2 -1
- package/dist/sub-menu.js.map +1 -1
- package/dist/timeline-item.js +175 -0
- package/dist/timeline-item.js.map +1 -0
- package/dist/timeline.js +69 -0
- package/dist/timeline.js.map +1 -0
- package/dist/tooltip.js +2 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -1
- package/readme.md +2 -2
- package/src/button/button/button-sizes.scss +4 -0
- package/src/index.ts +2 -0
- package/src/input/input.ts +85 -82
- package/src/loader.ts +12 -0
- package/src/markdown-editor/index.ts +3 -0
- package/src/markdown-editor/markdown-editor.scss +378 -0
- package/src/markdown-editor/markdown-editor.ts +994 -0
- package/src/timeline/index.ts +2 -0
- package/src/timeline/timeline-item.scss +108 -0
- package/src/timeline/timeline-item.ts +62 -0
- package/src/timeline/timeline.scss +21 -0
- package/src/timeline/timeline.ts +43 -0
- package/dist/floating-controller-CnUZnOhK.js.map +0 -1
- package/dist/select-D85kpjUt.js.map +0 -1
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.
|
|
5
|
+
"version": "3.9.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -50,13 +50,16 @@
|
|
|
50
50
|
"@tiptap/extension-underline": "^2.11.3",
|
|
51
51
|
"@tiptap/pm": "^2.11.3",
|
|
52
52
|
"@tiptap/starter-kit": "^2.11.3",
|
|
53
|
+
"@tiptap/suggestion": "^2.11.3",
|
|
53
54
|
"@types/prettier": "^3.0.0",
|
|
54
55
|
"d3": "^7.9.0",
|
|
55
56
|
"install": "^0.13.0",
|
|
56
57
|
"js-beautify": "^1.15.4",
|
|
57
58
|
"lit": "^3.1.4",
|
|
59
|
+
"marked": "^14.1.3",
|
|
58
60
|
"modern-monaco": "^0.4.0",
|
|
59
61
|
"monaco-editor": "^0.55.1",
|
|
62
|
+
"turndown": "^7.2.0",
|
|
60
63
|
"npm": "^11.11.0",
|
|
61
64
|
"prettier": "^3.8.1",
|
|
62
65
|
"rollup-plugin-postcss": "^4.0.2",
|
|
@@ -75,6 +78,7 @@
|
|
|
75
78
|
"@types/js-beautify": "^1.14.3",
|
|
76
79
|
"@types/mocha": "^10.0.7",
|
|
77
80
|
"@types/prismjs": "^1.26.6",
|
|
81
|
+
"@types/turndown": "^5.0.5",
|
|
78
82
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
79
83
|
"@typescript-eslint/parser": "^7.16.0",
|
|
80
84
|
"@wc-toolkit/jsdoc-tags": "^1.1.0",
|
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.
|
|
47
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.9.0/dist/assets/styles.css"></link>
|
|
48
48
|
<script type='module'
|
|
49
|
-
src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.
|
|
49
|
+
src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.9.0/dist/loader.js'></script>
|
|
50
50
|
</head>
|
|
51
51
|
|
|
52
52
|
<wc-button>Button</wc-button>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
--button-height: 2rem;
|
|
6
6
|
--private-button-icon-size: 1rem;
|
|
7
7
|
--private-button-container-padding: 0.75rem;
|
|
8
|
+
--private-button-icon-label-spacing: 0.5rem;
|
|
8
9
|
|
|
9
10
|
--private-button-font-size: 0.875rem !important;
|
|
10
11
|
--private-button-font-weight: var(--font-weight-medium) !important;
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
--button-height: 3.5rem;
|
|
31
32
|
--private-button-icon-size: 1.5rem;
|
|
32
33
|
--private-button-container-padding: 1.5rem;
|
|
34
|
+
--private-button-icon-label-spacing: 0.5rem;
|
|
33
35
|
|
|
34
36
|
--private-button-font-size: 1rem !important;
|
|
35
37
|
--private-button-font-weight: var(--font-weight-medium) !important;
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
--button-height: 6rem;
|
|
43
45
|
--private-button-icon-size: 2rem;
|
|
44
46
|
--private-button-container-padding: 3rem;
|
|
47
|
+
--private-button-icon-label-spacing: 0.75rem;
|
|
45
48
|
|
|
46
49
|
--private-button-font-size: 1.5rem !important;
|
|
47
50
|
--private-button-font-weight: var(--font-weight-regular) !important;
|
|
@@ -54,6 +57,7 @@
|
|
|
54
57
|
--button-height: 8.5rem;
|
|
55
58
|
--private-button-icon-size: 2.5rem;
|
|
56
59
|
--private-button-container-padding: 4rem;
|
|
60
|
+
--private-button-icon-label-spacing: 1rem;
|
|
57
61
|
|
|
58
62
|
--private-button-font-size: 2rem !important;
|
|
59
63
|
--private-button-font-weight: var(--font-weight-regular) !important;
|
package/src/index.ts
CHANGED
|
@@ -42,11 +42,13 @@ export { Popover, PopoverContent } from './popover/index.js';
|
|
|
42
42
|
export { Breadcrumb, BreadcrumbItem } from './breadcrumb/index.js';
|
|
43
43
|
export { Menu, MenuItem, SubMenu } from './menu/index.js';
|
|
44
44
|
export { List, ListItem } from './list/index.js';
|
|
45
|
+
export { Timeline, TimelineItem } from './timeline/index.js';
|
|
45
46
|
export { Item } from './item/index.js';
|
|
46
47
|
|
|
47
48
|
export { CodeHighlighter } from './code-highlighter/index.js';
|
|
48
49
|
export { CodeEditor } from './code-editor/index.js';
|
|
49
50
|
export { HtmlEditor } from './html-editor/index.js';
|
|
51
|
+
export { MarkdownEditor } from './markdown-editor/index.js';
|
|
50
52
|
export { Image } from './image/index.js';
|
|
51
53
|
export { Svg } from './svg/index.js';
|
|
52
54
|
export { Tab, TabGroup, TabPanel, Tabs } from './tabs/index.js';
|
package/src/input/input.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { html, nothing } from
|
|
2
|
-
import { property, query, state } from
|
|
1
|
+
import { html, nothing } from "lit";
|
|
2
|
+
import { property, query, state } from "lit/decorators.js";
|
|
3
3
|
|
|
4
|
-
import { redispatchEvent } from
|
|
5
|
-
import { spread } from
|
|
4
|
+
import { redispatchEvent } from "@/__internal/utils/dispatch-event-utils.js";
|
|
5
|
+
import { spread } from "@/__internal/directive/spread.js";
|
|
6
6
|
|
|
7
|
-
import BaseInput from
|
|
8
|
-
import styles from
|
|
7
|
+
import BaseInput from "./BaseInput.js";
|
|
8
|
+
import styles from "./input.scss";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @label Input
|
|
@@ -23,46 +23,52 @@ export class Input extends BaseInput {
|
|
|
23
23
|
static styles = [styles];
|
|
24
24
|
|
|
25
25
|
@property({ type: String })
|
|
26
|
-
value =
|
|
26
|
+
value = "";
|
|
27
27
|
|
|
28
28
|
@property({ type: String })
|
|
29
|
-
name: string =
|
|
29
|
+
name: string = "";
|
|
30
30
|
|
|
31
|
-
@property({ type: String })
|
|
31
|
+
@property({ type: String })
|
|
32
|
+
placeholder = "";
|
|
32
33
|
|
|
33
|
-
@property({ type: String })
|
|
34
|
+
@property({ type: String })
|
|
35
|
+
label = "";
|
|
34
36
|
|
|
35
|
-
@property({ type: Boolean, reflect: true })
|
|
37
|
+
@property({ type: Boolean, reflect: true })
|
|
38
|
+
inline = false;
|
|
36
39
|
|
|
37
|
-
@property({ type: String, reflect: true })
|
|
40
|
+
@property({ type: String, reflect: true })
|
|
41
|
+
size: "sm" | "md" | "lg" = "md";
|
|
38
42
|
|
|
39
|
-
@property({ type: String })
|
|
40
|
-
|
|
43
|
+
@property({ type: String })
|
|
44
|
+
type: "text" | "password" | "email" | "tel" = "text";
|
|
41
45
|
|
|
42
|
-
@property({ type: String })
|
|
46
|
+
@property({ type: String })
|
|
47
|
+
autocomplete: "on" | "off" = "off";
|
|
43
48
|
|
|
44
|
-
@property({ type: Object })
|
|
49
|
+
@property({ type: Object })
|
|
50
|
+
configAria: Record<string, string> = {};
|
|
45
51
|
|
|
46
52
|
@property({ type: String })
|
|
47
|
-
variant:
|
|
53
|
+
variant: "filled" | "outlined" | "default" = "default";
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* Helper text to display below the input.
|
|
51
57
|
*/
|
|
52
|
-
@property({ type: String, attribute:
|
|
53
|
-
helperText: string =
|
|
58
|
+
@property({ type: String, attribute: "helper-text" })
|
|
59
|
+
helperText: string = "";
|
|
54
60
|
|
|
55
61
|
@property({ type: Boolean })
|
|
56
62
|
error: boolean = false;
|
|
57
63
|
|
|
58
|
-
@property({ type: String, attribute:
|
|
59
|
-
errorText: string =
|
|
64
|
+
@property({ type: String, attribute: "error-text" })
|
|
65
|
+
errorText: string = "";
|
|
60
66
|
|
|
61
67
|
@property({ type: Boolean })
|
|
62
68
|
warning: boolean = false;
|
|
63
69
|
|
|
64
|
-
@property({ type: String, attribute:
|
|
65
|
-
warningText: string =
|
|
70
|
+
@property({ type: String, attribute: "warning-text" })
|
|
71
|
+
warningText: string = "";
|
|
66
72
|
|
|
67
73
|
@state()
|
|
68
74
|
private focused = false;
|
|
@@ -74,15 +80,16 @@ export class Input extends BaseInput {
|
|
|
74
80
|
* Returns true when the text field has been interacted with. Native
|
|
75
81
|
* validation errors only display in response to user interactions.
|
|
76
82
|
*/
|
|
77
|
-
@state()
|
|
83
|
+
@state()
|
|
84
|
+
private dirty = false;
|
|
78
85
|
|
|
79
|
-
@query(
|
|
86
|
+
@query(".input-element")
|
|
80
87
|
private inputElement?: HTMLInputElement;
|
|
81
88
|
|
|
82
89
|
override async focus() {
|
|
83
90
|
await Promise.all([
|
|
84
|
-
customElements.whenDefined(
|
|
85
|
-
customElements.whenDefined(
|
|
91
|
+
customElements.whenDefined("wc-input"),
|
|
92
|
+
customElements.whenDefined("wc-field"),
|
|
86
93
|
]);
|
|
87
94
|
await this.updateComplete;
|
|
88
95
|
this.inputElement?.focus();
|
|
@@ -94,8 +101,8 @@ export class Input extends BaseInput {
|
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
private handleInitialAttributes() {
|
|
97
|
-
Array.from(this.attributes).forEach(attr => {
|
|
98
|
-
if (attr.name.startsWith(
|
|
104
|
+
Array.from(this.attributes).forEach((attr) => {
|
|
105
|
+
if (attr.name.startsWith("aria-")) {
|
|
99
106
|
this.configAria[attr.name] = attr.value;
|
|
100
107
|
this.removeAttribute(attr.name);
|
|
101
108
|
}
|
|
@@ -108,7 +115,7 @@ export class Input extends BaseInput {
|
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
private __handleFocusChange = (event: FocusEvent) => {
|
|
111
|
-
this.focused = event.type ===
|
|
118
|
+
this.focused = event.type === "focus";
|
|
112
119
|
};
|
|
113
120
|
|
|
114
121
|
private __redispatchEvent(event: Event) {
|
|
@@ -116,72 +123,68 @@ export class Input extends BaseInput {
|
|
|
116
123
|
}
|
|
117
124
|
|
|
118
125
|
render() {
|
|
119
|
-
const displayType =
|
|
120
|
-
|
|
126
|
+
const displayType = this.type === "password" && this.passwordVisible
|
|
127
|
+
? "text"
|
|
128
|
+
: this.type;
|
|
121
129
|
|
|
122
130
|
return html`
|
|
123
131
|
<wc-field
|
|
124
|
-
?required
|
|
125
|
-
?disabled
|
|
126
|
-
?readonly
|
|
127
|
-
?skeleton
|
|
128
|
-
helper-text
|
|
129
|
-
?error
|
|
130
|
-
error-text
|
|
131
|
-
?warning
|
|
132
|
-
variant
|
|
133
|
-
?populated
|
|
134
|
-
warning-text
|
|
135
|
-
label
|
|
136
|
-
?focused
|
|
137
|
-
.host
|
|
132
|
+
?required="${this.required}"
|
|
133
|
+
?disabled="${this.disabled}"
|
|
134
|
+
?readonly="${this.readonly}"
|
|
135
|
+
?skeleton="${this.skeleton}"
|
|
136
|
+
helper-text="${this.helperText}"
|
|
137
|
+
?error="${this.error}"
|
|
138
|
+
error-text="${this.errorText}"
|
|
139
|
+
?warning="${this.warning}"
|
|
140
|
+
variant="${this.variant}"
|
|
141
|
+
?populated="${!!this.value}"
|
|
142
|
+
warning-text="${this.warningText}"
|
|
143
|
+
label="${this.label}"
|
|
144
|
+
?focused="${this.focused}"
|
|
145
|
+
.host="${this}"
|
|
138
146
|
class="input-wrapper"
|
|
139
147
|
>
|
|
140
148
|
<slot name="start" slot="field-start"></slot>
|
|
141
149
|
|
|
142
150
|
<input
|
|
143
151
|
class="input input-element"
|
|
144
|
-
name
|
|
145
|
-
type
|
|
146
|
-
placeholder
|
|
147
|
-
autocomplete
|
|
148
|
-
.value
|
|
149
|
-
?readonly
|
|
150
|
-
?required
|
|
151
|
-
?disabled
|
|
152
|
-
@input
|
|
153
|
-
@change
|
|
154
|
-
@focus
|
|
155
|
-
@blur
|
|
152
|
+
name="${this.name}"
|
|
153
|
+
type="${displayType}"
|
|
154
|
+
placeholder="${this.placeholder}"
|
|
155
|
+
autocomplete="${this.autocomplete}"
|
|
156
|
+
.value="${this.value}"
|
|
157
|
+
?readonly="${this.readonly}"
|
|
158
|
+
?required="${this.required}"
|
|
159
|
+
?disabled="${this.disabled}"
|
|
160
|
+
@input="${this.__handleInput}"
|
|
161
|
+
@change="${this.__redispatchEvent}"
|
|
162
|
+
@focus="${this.__handleFocusChange}"
|
|
163
|
+
@blur="${this.__handleFocusChange}"
|
|
156
164
|
${spread(this.configAria)}
|
|
157
165
|
/>
|
|
158
166
|
|
|
159
|
-
|
|
167
|
+
<slot name="end" slot="field-end"></slot>
|
|
168
|
+
|
|
169
|
+
${this.type === "password"
|
|
160
170
|
? html`
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
: 'visibility'}
|
|
178
|
-
></wc-icon>
|
|
179
|
-
</wc-icon-button>
|
|
180
|
-
</wc-tooltip>
|
|
181
|
-
`
|
|
171
|
+
<wc-icon-button
|
|
172
|
+
class="password-toggle"
|
|
173
|
+
variant="text"
|
|
174
|
+
slot="field-end"
|
|
175
|
+
tooltip="${this.passwordVisible
|
|
176
|
+
? "Hide password"
|
|
177
|
+
: "Show password"}"
|
|
178
|
+
@click="${() => {
|
|
179
|
+
this.passwordVisible = !this.passwordVisible;
|
|
180
|
+
}}"
|
|
181
|
+
>
|
|
182
|
+
<wc-icon
|
|
183
|
+
name="${this.passwordVisible ? "visibility_off" : "visibility"}"
|
|
184
|
+
></wc-icon>
|
|
185
|
+
</wc-icon-button>
|
|
186
|
+
`
|
|
182
187
|
: nothing}
|
|
183
|
-
|
|
184
|
-
<slot name="end" slot="field-end"></slot>
|
|
185
188
|
</wc-field>
|
|
186
189
|
`;
|
|
187
190
|
}
|
package/src/loader.ts
CHANGED
|
@@ -34,6 +34,8 @@ import { SubMenu } from '@/menu/sub-menu/sub-menu.js';
|
|
|
34
34
|
import { Item } from '@/item/item.js';
|
|
35
35
|
import { List } from '@/list/list.js';
|
|
36
36
|
import { ListItem } from '@/list/list-item.js';
|
|
37
|
+
import { Timeline } from '@/timeline/timeline.js';
|
|
38
|
+
import { TimelineItem } from '@/timeline/timeline-item.js';
|
|
37
39
|
|
|
38
40
|
import { Accordion } from '@/accordion/accordion.js';
|
|
39
41
|
import { Link } from '@/link/link.js';
|
|
@@ -262,6 +264,10 @@ const loaderConfig: LoaderConfig = {
|
|
|
262
264
|
importPath: `${distDirectory}/html-editor.js`,
|
|
263
265
|
dependencies: ['wc-code-editor'],
|
|
264
266
|
},
|
|
267
|
+
'wc-markdown-editor': {
|
|
268
|
+
importPath: `${distDirectory}/markdown-editor.js`,
|
|
269
|
+
dependencies: ['wc-code-editor'],
|
|
270
|
+
},
|
|
265
271
|
'wc-code-highlighter': {
|
|
266
272
|
importPath: `${distDirectory}/code-highlighter.js`,
|
|
267
273
|
},
|
|
@@ -301,6 +307,12 @@ const loaderConfig: LoaderConfig = {
|
|
|
301
307
|
'wc-list-item': {
|
|
302
308
|
CustomElementClass: ListItem,
|
|
303
309
|
},
|
|
310
|
+
'wc-timeline': {
|
|
311
|
+
CustomElementClass: Timeline,
|
|
312
|
+
},
|
|
313
|
+
'wc-timeline-item': {
|
|
314
|
+
CustomElementClass: TimelineItem,
|
|
315
|
+
},
|
|
304
316
|
'wc-item': {
|
|
305
317
|
CustomElementClass: Item,
|
|
306
318
|
},
|