@idp.global/catalog 1.1.1
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/assets/v2/draw-41d55381-b162-433d-956c-fe4cd400212e.png +0 -0
- package/assets/v2/draw-bd386bf3-ce94-4452-88da-05ae372fae35.png +0 -0
- package/assets/v2/draw-be69231a-f491-4bd3-9a47-71561ce14c15.png +0 -0
- package/assets/v2/draw-d58859a8-0615-44ec-80fe-626033c888f7.png +0 -0
- package/assets/v2/draw-db67b502-d987-4226-a5f8-d57e3f8d7ba9.png +0 -0
- package/assets/v2/draw-e6ac3ef5-5a93-464d-9d3f-5ae7b7278bdd.png +0 -0
- package/changelog.md +26 -0
- package/dist_bundle/bundle.js +6385 -0
- package/dist_ts_web/00_commitinfo_data.d.ts +8 -0
- package/dist_ts_web/00_commitinfo_data.js +9 -0
- package/dist_ts_web/elements/idp-admin-shell.d.ts +292 -0
- package/dist_ts_web/elements/idp-admin-shell.js +2615 -0
- package/dist_ts_web/elements/idp-approval-card.d.ts +25 -0
- package/dist_ts_web/elements/idp-approval-card.js +274 -0
- package/dist_ts_web/elements/idp-badge.d.ts +14 -0
- package/dist_ts_web/elements/idp-badge.js +135 -0
- package/dist_ts_web/elements/idp-button.d.ts +21 -0
- package/dist_ts_web/elements/idp-button.js +234 -0
- package/dist_ts_web/elements/idp-card.d.ts +15 -0
- package/dist_ts_web/elements/idp-card.js +139 -0
- package/dist_ts_web/elements/idp-checkbox.d.ts +23 -0
- package/dist_ts_web/elements/idp-checkbox.js +233 -0
- package/dist_ts_web/elements/idp-dashboard-window.d.ts +23 -0
- package/dist_ts_web/elements/idp-dashboard-window.js +587 -0
- package/dist_ts_web/elements/idp-data-table.d.ts +45 -0
- package/dist_ts_web/elements/idp-data-table.js +472 -0
- package/dist_ts_web/elements/idp-form-submit.d.ts +20 -0
- package/dist_ts_web/elements/idp-form-submit.js +136 -0
- package/dist_ts_web/elements/idp-form.d.ts +31 -0
- package/dist_ts_web/elements/idp-form.js +197 -0
- package/dist_ts_web/elements/idp-icon.d.ts +18 -0
- package/dist_ts_web/elements/idp-icon.js +204 -0
- package/dist_ts_web/elements/idp-inbox-preview.d.ts +18 -0
- package/dist_ts_web/elements/idp-inbox-preview.js +245 -0
- package/dist_ts_web/elements/idp-input.d.ts +26 -0
- package/dist_ts_web/elements/idp-input.js +249 -0
- package/dist_ts_web/elements/idp-landing-hero.d.ts +15 -0
- package/dist_ts_web/elements/idp-landing-hero.js +209 -0
- package/dist_ts_web/elements/idp-landing-page.d.ts +21 -0
- package/dist_ts_web/elements/idp-landing-page.js +694 -0
- package/dist_ts_web/elements/idp-mobile-frame.d.ts +14 -0
- package/dist_ts_web/elements/idp-mobile-frame.js +195 -0
- package/dist_ts_web/elements/idp-mobile-showcase.d.ts +16 -0
- package/dist_ts_web/elements/idp-mobile-showcase.js +339 -0
- package/dist_ts_web/elements/idp-select.d.ts +28 -0
- package/dist_ts_web/elements/idp-select.js +179 -0
- package/dist_ts_web/elements/idp-toggle.d.ts +15 -0
- package/dist_ts_web/elements/idp-toggle.js +134 -0
- package/dist_ts_web/elements/index.d.ts +20 -0
- package/dist_ts_web/elements/index.js +21 -0
- package/dist_ts_web/elements/tokens.d.ts +21 -0
- package/dist_ts_web/elements/tokens.js +190 -0
- package/dist_ts_web/index.d.ts +1 -0
- package/dist_ts_web/index.js +2 -0
- package/dist_ts_web/pages/index.d.ts +5 -0
- package/dist_ts_web/pages/index.js +23 -0
- package/dist_watch/bundle.js +120699 -0
- package/dist_watch/bundle.js.map +7 -0
- package/dist_watch/index.html +29 -0
- package/html/index.html +29 -0
- package/html/index.ts +39 -0
- package/license +21 -0
- package/package.json +64 -0
- package/readme.md +103 -0
- package/ts_web/00_commitinfo_data.ts +8 -0
- package/ts_web/elements/idp-admin-shell.ts +2664 -0
- package/ts_web/elements/idp-approval-card.ts +182 -0
- package/ts_web/elements/idp-badge.ts +84 -0
- package/ts_web/elements/idp-button.ts +166 -0
- package/ts_web/elements/idp-card.ts +76 -0
- package/ts_web/elements/idp-checkbox.ts +143 -0
- package/ts_web/elements/idp-dashboard-window.ts +564 -0
- package/ts_web/elements/idp-data-table.ts +407 -0
- package/ts_web/elements/idp-form-submit.ts +65 -0
- package/ts_web/elements/idp-form.ts +159 -0
- package/ts_web/elements/idp-icon.ts +263 -0
- package/ts_web/elements/idp-inbox-preview.ts +192 -0
- package/ts_web/elements/idp-input.ts +151 -0
- package/ts_web/elements/idp-landing-hero.ts +165 -0
- package/ts_web/elements/idp-landing-page.ts +655 -0
- package/ts_web/elements/idp-mobile-frame.ts +137 -0
- package/ts_web/elements/idp-mobile-showcase.ts +295 -0
- package/ts_web/elements/idp-select.ts +119 -0
- package/ts_web/elements/idp-toggle.ts +77 -0
- package/ts_web/elements/index.ts +20 -0
- package/ts_web/elements/tokens.ts +193 -0
- package/ts_web/index.ts +1 -0
- package/ts_web/pages/index.ts +26 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { DeesElement, html, property, customElement, css, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import { idpElementStyles } from './tokens.js';
|
|
3
|
+
import './idp-badge.js';
|
|
4
|
+
import './idp-button.js';
|
|
5
|
+
import './idp-icon.js';
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'idp-approval-card': IdpApprovalCard;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@customElement('idp-approval-card')
|
|
14
|
+
export class IdpApprovalCard extends DeesElement {
|
|
15
|
+
public static demo = () => html`
|
|
16
|
+
<idp-approval-card
|
|
17
|
+
app-name="GitHub"
|
|
18
|
+
app-initials="GH"
|
|
19
|
+
app-color="#24292F"
|
|
20
|
+
request-text="Sign in to github.com"
|
|
21
|
+
location="Berlin · DE"
|
|
22
|
+
device="Safari · MacBook Pro"
|
|
23
|
+
risk="trusted"
|
|
24
|
+
time-label="now"
|
|
25
|
+
></idp-approval-card>
|
|
26
|
+
`;
|
|
27
|
+
public static demoGroups = ['idp.global v3 approval surfaces'];
|
|
28
|
+
|
|
29
|
+
@property({ type: String, attribute: 'app-name' })
|
|
30
|
+
public accessor appName = 'GitHub';
|
|
31
|
+
|
|
32
|
+
@property({ type: String, attribute: 'app-initials' })
|
|
33
|
+
public accessor appInitials = 'GH';
|
|
34
|
+
|
|
35
|
+
@property({ type: String, attribute: 'app-color' })
|
|
36
|
+
public accessor appColor = '#24292F';
|
|
37
|
+
|
|
38
|
+
@property({ type: String, attribute: 'request-text' })
|
|
39
|
+
public accessor requestText = 'Sign in to github.com';
|
|
40
|
+
|
|
41
|
+
@property({ type: String })
|
|
42
|
+
public accessor location = 'Berlin · DE';
|
|
43
|
+
|
|
44
|
+
@property({ type: String })
|
|
45
|
+
public accessor device = 'Safari · MacBook Pro';
|
|
46
|
+
|
|
47
|
+
@property({ type: String })
|
|
48
|
+
public accessor risk: 'trusted' | 'warning' | 'low' = 'trusted';
|
|
49
|
+
|
|
50
|
+
@property({ type: String, attribute: 'time-label' })
|
|
51
|
+
public accessor timeLabel = 'now';
|
|
52
|
+
|
|
53
|
+
@property({ type: Boolean, reflect: true })
|
|
54
|
+
public accessor primary = false;
|
|
55
|
+
|
|
56
|
+
public static styles = [
|
|
57
|
+
...idpElementStyles,
|
|
58
|
+
css`
|
|
59
|
+
:host {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
.card {
|
|
63
|
+
background: var(--idp-card);
|
|
64
|
+
border: 1px solid var(--idp-border);
|
|
65
|
+
border-radius: 12px;
|
|
66
|
+
padding: 14px;
|
|
67
|
+
color: var(--idp-fg);
|
|
68
|
+
}
|
|
69
|
+
:host([primary]) .card {
|
|
70
|
+
border-color: var(--idp-accent);
|
|
71
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--idp-accent), transparent 92%);
|
|
72
|
+
}
|
|
73
|
+
.top {
|
|
74
|
+
display: flex;
|
|
75
|
+
gap: 12px;
|
|
76
|
+
align-items: flex-start;
|
|
77
|
+
}
|
|
78
|
+
.avatar {
|
|
79
|
+
width: 40px;
|
|
80
|
+
height: 40px;
|
|
81
|
+
border-radius: 8px;
|
|
82
|
+
background: var(--app-color);
|
|
83
|
+
color: #fff;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
font-weight: 750;
|
|
89
|
+
letter-spacing: -0.03em;
|
|
90
|
+
flex: 0 0 auto;
|
|
91
|
+
}
|
|
92
|
+
.body {
|
|
93
|
+
flex: 1;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
}
|
|
96
|
+
.line {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
gap: 8px;
|
|
101
|
+
}
|
|
102
|
+
.app {
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
font-weight: 650;
|
|
105
|
+
letter-spacing: -0.02em;
|
|
106
|
+
}
|
|
107
|
+
.time, .sub, .meta {
|
|
108
|
+
color: var(--idp-muted-fg);
|
|
109
|
+
}
|
|
110
|
+
.time {
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
}
|
|
113
|
+
.sub {
|
|
114
|
+
margin-top: 1px;
|
|
115
|
+
font-size: 13px;
|
|
116
|
+
}
|
|
117
|
+
.meta {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-wrap: wrap;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: 10px;
|
|
122
|
+
margin-top: 9px;
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
}
|
|
125
|
+
.meta-item {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 4px;
|
|
129
|
+
}
|
|
130
|
+
.actions {
|
|
131
|
+
display: flex;
|
|
132
|
+
gap: 8px;
|
|
133
|
+
margin-top: 12px;
|
|
134
|
+
}
|
|
135
|
+
idp-button:first-child {
|
|
136
|
+
flex: 1;
|
|
137
|
+
}
|
|
138
|
+
idp-button:last-child {
|
|
139
|
+
flex: 2;
|
|
140
|
+
}
|
|
141
|
+
`,
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
private dispatchAction(actionArg: 'approve' | 'deny') {
|
|
145
|
+
this.dispatchEvent(new CustomEvent(`idp-${actionArg}`, {
|
|
146
|
+
detail: {
|
|
147
|
+
appName: this.appName,
|
|
148
|
+
requestText: this.requestText,
|
|
149
|
+
},
|
|
150
|
+
bubbles: true,
|
|
151
|
+
composed: true,
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public render(): TemplateResult {
|
|
156
|
+
const badgeVariant = this.risk === 'warning' ? 'warn' : 'ok';
|
|
157
|
+
const badgeText = this.risk === 'warning' ? 'new network' : 'trusted';
|
|
158
|
+
return html`
|
|
159
|
+
<article class="card" style="--app-color: ${this.appColor}">
|
|
160
|
+
<div class="top">
|
|
161
|
+
<div class="avatar">${this.appInitials}</div>
|
|
162
|
+
<div class="body">
|
|
163
|
+
<div class="line">
|
|
164
|
+
<div class="app">${this.appName}</div>
|
|
165
|
+
<div class="time">${this.timeLabel}</div>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="sub">${this.requestText}</div>
|
|
168
|
+
<div class="meta">
|
|
169
|
+
<span class="meta-item"><idp-icon name="location" size="12"></idp-icon>${this.location}</span>
|
|
170
|
+
<span class="meta-item"><idp-icon name="laptop" size="12"></idp-icon>${this.device}</span>
|
|
171
|
+
<idp-badge variant=${badgeVariant as any}>${badgeText}</idp-badge>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="actions">
|
|
176
|
+
<idp-button variant="outline" @click=${() => this.dispatchAction('deny')}>Deny</idp-button>
|
|
177
|
+
<idp-button variant="accent" icon="check" @click=${() => this.dispatchAction('approve')}>Approve</idp-button>
|
|
178
|
+
</div>
|
|
179
|
+
</article>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { DeesElement, html, property, customElement, css, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import { idpElementStyles } from './tokens.js';
|
|
3
|
+
|
|
4
|
+
export type TIdpBadgeVariant = 'default' | 'accent' | 'ok' | 'warn' | 'error' | 'outline';
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'idp-badge': IdpBadge;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@customElement('idp-badge')
|
|
13
|
+
export class IdpBadge extends DeesElement {
|
|
14
|
+
public static demo = () => html`
|
|
15
|
+
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
16
|
+
<idp-badge>Default</idp-badge>
|
|
17
|
+
<idp-badge variant="accent">Admin</idp-badge>
|
|
18
|
+
<idp-badge variant="ok">Trusted</idp-badge>
|
|
19
|
+
<idp-badge variant="warn">New network</idp-badge>
|
|
20
|
+
<idp-badge variant="error">Denied</idp-badge>
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
23
|
+
public static demoGroups = ['idp.global v3 primitives'];
|
|
24
|
+
|
|
25
|
+
@property({ type: String })
|
|
26
|
+
public accessor variant: TIdpBadgeVariant = 'default';
|
|
27
|
+
|
|
28
|
+
public static styles = [
|
|
29
|
+
...idpElementStyles,
|
|
30
|
+
css`
|
|
31
|
+
:host {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
}
|
|
34
|
+
.badge {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 4px;
|
|
38
|
+
padding: 2px 8px;
|
|
39
|
+
border: 1px solid transparent;
|
|
40
|
+
border-radius: 999px;
|
|
41
|
+
font-family: var(--idp-mono);
|
|
42
|
+
font-size: 11px;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
letter-spacing: -0.01em;
|
|
45
|
+
line-height: 16px;
|
|
46
|
+
}
|
|
47
|
+
.default {
|
|
48
|
+
background: var(--idp-muted);
|
|
49
|
+
color: var(--idp-muted-fg);
|
|
50
|
+
}
|
|
51
|
+
.accent {
|
|
52
|
+
background: var(--idp-accent-soft);
|
|
53
|
+
color: var(--idp-accent);
|
|
54
|
+
}
|
|
55
|
+
.ok {
|
|
56
|
+
background: var(--idp-ok-bg);
|
|
57
|
+
color: var(--idp-ok);
|
|
58
|
+
border-color: var(--idp-ok-border);
|
|
59
|
+
}
|
|
60
|
+
.warn {
|
|
61
|
+
background: var(--idp-warn-bg);
|
|
62
|
+
color: var(--idp-warn);
|
|
63
|
+
border-color: var(--idp-warn-border);
|
|
64
|
+
}
|
|
65
|
+
.error {
|
|
66
|
+
background: var(--idp-error-bg);
|
|
67
|
+
color: var(--idp-error);
|
|
68
|
+
border-color: var(--idp-error-border);
|
|
69
|
+
}
|
|
70
|
+
.accent {
|
|
71
|
+
border-color: var(--idp-info-border);
|
|
72
|
+
}
|
|
73
|
+
.outline {
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: var(--idp-fg);
|
|
76
|
+
border-color: var(--idp-border);
|
|
77
|
+
}
|
|
78
|
+
`,
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
public render(): TemplateResult {
|
|
82
|
+
return html`<span class="badge ${this.variant}"><slot></slot></span>`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeesElement,
|
|
3
|
+
html,
|
|
4
|
+
property,
|
|
5
|
+
customElement,
|
|
6
|
+
css,
|
|
7
|
+
type TemplateResult,
|
|
8
|
+
} from '@design.estate/dees-element';
|
|
9
|
+
import { idpElementStyles } from './tokens.js';
|
|
10
|
+
import './idp-icon.js';
|
|
11
|
+
|
|
12
|
+
export type TIdpButtonVariant = 'default' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'accent';
|
|
13
|
+
export type TIdpButtonSize = 'sm' | 'md' | 'lg';
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'idp-button': IdpButton;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@customElement('idp-button')
|
|
22
|
+
export class IdpButton extends DeesElement {
|
|
23
|
+
public static demo = () => html`
|
|
24
|
+
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
|
25
|
+
<idp-button>Default</idp-button>
|
|
26
|
+
<idp-button variant="accent">Approve</idp-button>
|
|
27
|
+
<idp-button variant="outline">Deny</idp-button>
|
|
28
|
+
<idp-button variant="ghost">Ghost</idp-button>
|
|
29
|
+
<idp-button variant="destructive">Delete</idp-button>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
public static demoGroups = ['idp.global v3 primitives'];
|
|
33
|
+
|
|
34
|
+
@property({ type: String })
|
|
35
|
+
public accessor variant: TIdpButtonVariant = 'default';
|
|
36
|
+
|
|
37
|
+
@property({ type: String })
|
|
38
|
+
public accessor size: TIdpButtonSize = 'md';
|
|
39
|
+
|
|
40
|
+
@property({ type: String })
|
|
41
|
+
public accessor icon = '';
|
|
42
|
+
|
|
43
|
+
@property({ type: String })
|
|
44
|
+
public accessor type: 'button' | 'submit' | 'reset' = 'button';
|
|
45
|
+
|
|
46
|
+
@property({ type: Boolean, reflect: true })
|
|
47
|
+
public accessor disabled = false;
|
|
48
|
+
|
|
49
|
+
@property({ type: Boolean, reflect: true })
|
|
50
|
+
public accessor loading = false;
|
|
51
|
+
|
|
52
|
+
public static styles = [
|
|
53
|
+
...idpElementStyles,
|
|
54
|
+
css`
|
|
55
|
+
:host {
|
|
56
|
+
display: inline-block;
|
|
57
|
+
}
|
|
58
|
+
:host([disabled]) {
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
}
|
|
61
|
+
button {
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
gap: 6px;
|
|
66
|
+
border: 1px solid transparent;
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
font-family: var(--idp-font);
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
letter-spacing: -0.01em;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
|
|
74
|
+
}
|
|
75
|
+
button:active:not(:disabled) {
|
|
76
|
+
transform: translateY(1px);
|
|
77
|
+
}
|
|
78
|
+
button:focus-visible {
|
|
79
|
+
outline: 2px solid color-mix(in srgb, var(--idp-accent), transparent 68%);
|
|
80
|
+
outline-offset: 2px;
|
|
81
|
+
}
|
|
82
|
+
button:disabled {
|
|
83
|
+
opacity: 0.5;
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
}
|
|
86
|
+
.sm {
|
|
87
|
+
height: 32px;
|
|
88
|
+
padding: 0 12px;
|
|
89
|
+
font-size: 13px;
|
|
90
|
+
}
|
|
91
|
+
.md {
|
|
92
|
+
height: 38px;
|
|
93
|
+
padding: 0 14px;
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
}
|
|
96
|
+
.lg {
|
|
97
|
+
height: 44px;
|
|
98
|
+
padding: 0 18px;
|
|
99
|
+
font-size: 15px;
|
|
100
|
+
}
|
|
101
|
+
.default {
|
|
102
|
+
background: var(--idp-primary);
|
|
103
|
+
color: var(--idp-primary-fg);
|
|
104
|
+
}
|
|
105
|
+
.default:hover:not(:disabled) {
|
|
106
|
+
opacity: 0.88;
|
|
107
|
+
}
|
|
108
|
+
.accent {
|
|
109
|
+
background: var(--idp-accent);
|
|
110
|
+
color: var(--idp-accent-fg);
|
|
111
|
+
box-shadow: 0 4px 14px color-mix(in srgb, var(--idp-accent), transparent 64%);
|
|
112
|
+
}
|
|
113
|
+
.accent:hover:not(:disabled) {
|
|
114
|
+
background: var(--idp-accent-hover);
|
|
115
|
+
}
|
|
116
|
+
.secondary {
|
|
117
|
+
background: var(--idp-muted);
|
|
118
|
+
color: var(--idp-fg);
|
|
119
|
+
border-color: var(--idp-border);
|
|
120
|
+
}
|
|
121
|
+
.outline {
|
|
122
|
+
background: transparent;
|
|
123
|
+
color: var(--idp-fg);
|
|
124
|
+
border-color: var(--idp-border);
|
|
125
|
+
}
|
|
126
|
+
.outline:hover:not(:disabled), .secondary:hover:not(:disabled), .ghost:hover:not(:disabled) {
|
|
127
|
+
background: var(--idp-muted);
|
|
128
|
+
}
|
|
129
|
+
.ghost {
|
|
130
|
+
background: transparent;
|
|
131
|
+
color: var(--idp-fg);
|
|
132
|
+
}
|
|
133
|
+
.destructive {
|
|
134
|
+
background: var(--idp-destructive);
|
|
135
|
+
color: var(--idp-accent-fg);
|
|
136
|
+
}
|
|
137
|
+
idp-icon {
|
|
138
|
+
flex: 0 0 auto;
|
|
139
|
+
}
|
|
140
|
+
.spinner {
|
|
141
|
+
width: 13px;
|
|
142
|
+
height: 13px;
|
|
143
|
+
border: 2px solid currentColor;
|
|
144
|
+
border-right-color: transparent;
|
|
145
|
+
border-radius: 999px;
|
|
146
|
+
animation: spin 700ms linear infinite;
|
|
147
|
+
}
|
|
148
|
+
@keyframes spin {
|
|
149
|
+
to {
|
|
150
|
+
transform: rotate(360deg);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`,
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
public render(): TemplateResult {
|
|
157
|
+
return html`
|
|
158
|
+
<button class="${this.variant} ${this.size}" type=${this.type} ?disabled=${this.disabled || this.loading} part="button">
|
|
159
|
+
${this.loading
|
|
160
|
+
? html`<span class="spinner" aria-hidden="true"></span>`
|
|
161
|
+
: this.icon ? html`<idp-icon name=${this.icon as any} size="14"></idp-icon>` : html``}
|
|
162
|
+
<slot></slot>
|
|
163
|
+
</button>
|
|
164
|
+
`;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { DeesElement, html, property, customElement, css, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import { idpElementStyles } from './tokens.js';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'idp-card': IdpCard;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@customElement('idp-card')
|
|
11
|
+
export class IdpCard extends DeesElement {
|
|
12
|
+
public static demo = () => html`<idp-card headline="Card title" description="Muted supporting text.">Card content</idp-card>`;
|
|
13
|
+
public static demoGroups = ['idp.global v3 primitives'];
|
|
14
|
+
|
|
15
|
+
@property({ type: String })
|
|
16
|
+
public accessor headline = '';
|
|
17
|
+
|
|
18
|
+
@property({ type: String })
|
|
19
|
+
public accessor description = '';
|
|
20
|
+
|
|
21
|
+
@property({ type: Boolean, reflect: true })
|
|
22
|
+
public accessor elevated = false;
|
|
23
|
+
|
|
24
|
+
public static styles = [
|
|
25
|
+
...idpElementStyles,
|
|
26
|
+
css`
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
.card {
|
|
31
|
+
background: var(--idp-card);
|
|
32
|
+
border: 1px solid var(--idp-border);
|
|
33
|
+
border-radius: var(--idp-radius-lg);
|
|
34
|
+
color: var(--idp-fg);
|
|
35
|
+
padding: 20px;
|
|
36
|
+
}
|
|
37
|
+
:host([elevated]) .card {
|
|
38
|
+
box-shadow: 0 8px 24px -10px rgb(0 0 0 / 0.28);
|
|
39
|
+
}
|
|
40
|
+
.head {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
gap: 16px;
|
|
44
|
+
margin-bottom: 16px;
|
|
45
|
+
}
|
|
46
|
+
.headline {
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
font-weight: 650;
|
|
49
|
+
line-height: 1.35;
|
|
50
|
+
}
|
|
51
|
+
.description {
|
|
52
|
+
color: var(--idp-muted-fg);
|
|
53
|
+
font-size: 13px;
|
|
54
|
+
line-height: 1.5;
|
|
55
|
+
margin-top: 3px;
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
public render(): TemplateResult {
|
|
61
|
+
return html`
|
|
62
|
+
<section class="card" part="card">
|
|
63
|
+
${this.headline || this.description ? html`
|
|
64
|
+
<div class="head">
|
|
65
|
+
<div>
|
|
66
|
+
${this.headline ? html`<div class="headline">${this.headline}</div>` : html``}
|
|
67
|
+
${this.description ? html`<div class="description">${this.description}</div>` : html``}
|
|
68
|
+
</div>
|
|
69
|
+
<slot name="action"></slot>
|
|
70
|
+
</div>
|
|
71
|
+
` : html``}
|
|
72
|
+
<slot></slot>
|
|
73
|
+
</section>
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { DeesElement, html, property, customElement, css, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import { idpElementStyles } from './tokens.js';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'idp-checkbox': IdpCheckbox;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@customElement('idp-checkbox')
|
|
11
|
+
export class IdpCheckbox extends DeesElement {
|
|
12
|
+
public static demo = () => html`<idp-checkbox label="I agree to the terms" required></idp-checkbox>`;
|
|
13
|
+
public static demoGroups = ['idp.global v3 primitives'];
|
|
14
|
+
|
|
15
|
+
@property({ type: String })
|
|
16
|
+
public accessor label = '';
|
|
17
|
+
|
|
18
|
+
@property({ type: String })
|
|
19
|
+
public accessor name = '';
|
|
20
|
+
|
|
21
|
+
@property({ type: String })
|
|
22
|
+
public accessor key = '';
|
|
23
|
+
|
|
24
|
+
@property({ type: String })
|
|
25
|
+
public accessor value = 'on';
|
|
26
|
+
|
|
27
|
+
@property({ type: String })
|
|
28
|
+
public accessor hint = '';
|
|
29
|
+
|
|
30
|
+
@property({ type: String })
|
|
31
|
+
public accessor error = '';
|
|
32
|
+
|
|
33
|
+
@property({ type: Boolean, reflect: true })
|
|
34
|
+
public accessor checked = false;
|
|
35
|
+
|
|
36
|
+
@property({ type: Boolean, reflect: true })
|
|
37
|
+
public accessor required = false;
|
|
38
|
+
|
|
39
|
+
@property({ type: Boolean, reflect: true })
|
|
40
|
+
public accessor disabled = false;
|
|
41
|
+
|
|
42
|
+
public static styles = [
|
|
43
|
+
...idpElementStyles,
|
|
44
|
+
css`
|
|
45
|
+
:host {
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
label {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: 18px 1fr;
|
|
51
|
+
gap: 10px;
|
|
52
|
+
align-items: start;
|
|
53
|
+
color: var(--idp-fg);
|
|
54
|
+
font-size: 13px;
|
|
55
|
+
line-height: 1.4;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
input {
|
|
59
|
+
appearance: none;
|
|
60
|
+
width: 18px;
|
|
61
|
+
height: 18px;
|
|
62
|
+
margin: 0;
|
|
63
|
+
border: 1px solid var(--idp-border);
|
|
64
|
+
border-radius: 5px;
|
|
65
|
+
background: var(--idp-card);
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
|
|
68
|
+
}
|
|
69
|
+
input:checked {
|
|
70
|
+
border-color: var(--idp-accent);
|
|
71
|
+
background: var(--idp-accent);
|
|
72
|
+
box-shadow: inset 0 0 0 3px var(--idp-card);
|
|
73
|
+
}
|
|
74
|
+
input:focus-visible {
|
|
75
|
+
outline: 2px solid color-mix(in srgb, var(--idp-accent), transparent 68%);
|
|
76
|
+
outline-offset: 2px;
|
|
77
|
+
}
|
|
78
|
+
input[aria-invalid='true'] {
|
|
79
|
+
border-color: var(--idp-destructive);
|
|
80
|
+
}
|
|
81
|
+
input:disabled,
|
|
82
|
+
:host([disabled]) label {
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
opacity: 0.55;
|
|
85
|
+
}
|
|
86
|
+
.copy {
|
|
87
|
+
display: grid;
|
|
88
|
+
gap: 4px;
|
|
89
|
+
}
|
|
90
|
+
.hint,
|
|
91
|
+
.error {
|
|
92
|
+
color: var(--idp-muted-fg);
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
}
|
|
95
|
+
.error {
|
|
96
|
+
color: var(--idp-destructive);
|
|
97
|
+
}
|
|
98
|
+
`,
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
public validate() {
|
|
102
|
+
if (this.required && !this.checked) {
|
|
103
|
+
this.error = `${this.label || this.name || 'This field'} is required.`;
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.error = '';
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
private handleChange(eventArg: Event) {
|
|
112
|
+
this.checked = (eventArg.target as HTMLInputElement).checked;
|
|
113
|
+
if (this.error) {
|
|
114
|
+
this.validate();
|
|
115
|
+
}
|
|
116
|
+
this.dispatchEvent(new CustomEvent('idp-checkbox-change', {
|
|
117
|
+
detail: { name: this.name || this.key, key: this.key || this.name, checked: this.checked, value: this.value },
|
|
118
|
+
bubbles: true,
|
|
119
|
+
composed: true,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public render(): TemplateResult {
|
|
124
|
+
return html`
|
|
125
|
+
<label>
|
|
126
|
+
<input
|
|
127
|
+
type="checkbox"
|
|
128
|
+
name=${this.name || this.key}
|
|
129
|
+
value=${this.value}
|
|
130
|
+
?checked=${this.checked}
|
|
131
|
+
?required=${this.required}
|
|
132
|
+
?disabled=${this.disabled}
|
|
133
|
+
aria-invalid=${this.error ? 'true' : 'false'}
|
|
134
|
+
@change=${this.handleChange}
|
|
135
|
+
/>
|
|
136
|
+
<span class="copy">
|
|
137
|
+
<span>${this.label}</span>
|
|
138
|
+
${this.error ? html`<span class="error">${this.error}</span>` : this.hint ? html`<span class="hint">${this.hint}</span>` : html``}
|
|
139
|
+
</span>
|
|
140
|
+
</label>
|
|
141
|
+
`;
|
|
142
|
+
}
|
|
143
|
+
}
|