@descope/flow-components 3.20.4 → 3.21.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/fm/114.js +1 -1
- package/dist/fm/114.js.map +1 -1
- package/dist/fm/222.js +1 -1
- package/dist/fm/222.js.map +1 -1
- package/dist/fm/467.js +1 -1
- package/dist/fm/467.js.map +1 -1
- package/dist/fm/985.js +1 -1
- package/dist/fm/985.js.map +1 -1
- package/dist/fm/@mf-types/compiled-types/RecoveryCodesList/RecoveryCodesList.d.ts +19 -0
- package/dist/fm/__federation_expose_componentClasses.js +1 -1
- package/dist/fm/__federation_expose_componentClasses.js.map +1 -1
- package/dist/fm/__federation_expose_components.js +1 -1
- package/dist/fm/__federation_expose_theme.js +1 -1
- package/dist/fm/__federation_expose_theme.js.map +1 -1
- package/dist/fm/flowComponents.js +1 -1
- package/dist/fm/flowComponents.js.map +1 -1
- package/dist/fm/main.js +1 -1
- package/dist/fm/main.js.map +1 -1
- package/dist/fm/mf-manifest.json +1 -1
- package/dist/fm/mf-stats.json +1 -1
- package/dist/index.cjs.js +357 -25
- package/dist/index.d.ts +19 -0
- package/dist/types/RecoveryCodesList/RecoveryCodesList.d.ts +19 -0
- package/package.json +2 -2
package/dist/fm/mf-manifest.json
CHANGED
package/dist/fm/mf-stats.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -89206,6 +89206,36 @@ function requireIndex_cjs () {
|
|
|
89206
89206
|
|
|
89207
89207
|
const componentName$16 = getComponentName('recovery-codes');
|
|
89208
89208
|
|
|
89209
|
+
const NO_ACTION = 'none';
|
|
89210
|
+
const DEFAULT_ERROR_MESSAGE = 'Please save your recovery codes to continue';
|
|
89211
|
+
|
|
89212
|
+
// default button label per action (buttons variant). the icons variant uses the vaadin
|
|
89213
|
+
// glyphs hardcoded in the shadow-DOM template below; the buttons variant uses image srcs.
|
|
89214
|
+
const ACTIONS = {
|
|
89215
|
+
copy: { defaultText: 'Copy' },
|
|
89216
|
+
download: { defaultText: 'Download' },
|
|
89217
|
+
};
|
|
89218
|
+
|
|
89219
|
+
// per-button config suffixes; the full attribute is `${action}-${suffix}`.
|
|
89220
|
+
// `icon`/`icon-dark` are image srcs (the seeded glyph or a custom upload), matching
|
|
89221
|
+
// the standard button's start-icon (light/dark), not a boolean.
|
|
89222
|
+
const BUTTON_SUFFIXES = [
|
|
89223
|
+
'text',
|
|
89224
|
+
'variant',
|
|
89225
|
+
'color',
|
|
89226
|
+
'size',
|
|
89227
|
+
'icon',
|
|
89228
|
+
'icon-dark',
|
|
89229
|
+
];
|
|
89230
|
+
|
|
89231
|
+
// changing any of these rebuilds the buttons (so the editor preview stays live)
|
|
89232
|
+
const BUTTON_ATTRS = [
|
|
89233
|
+
'show-download',
|
|
89234
|
+
...Object.keys(ACTIONS).flatMap((action) =>
|
|
89235
|
+
BUTTON_SUFFIXES.map((suffix) => `${action}-${suffix}`),
|
|
89236
|
+
),
|
|
89237
|
+
];
|
|
89238
|
+
|
|
89209
89239
|
const itemRenderer$5 = ({ value }, _, ref) => {
|
|
89210
89240
|
return `
|
|
89211
89241
|
<descope-text variant="${ref.variant}" mode="${ref.mode}">
|
|
@@ -89219,24 +89249,44 @@ function requireIndex_cjs () {
|
|
|
89219
89249
|
baseSelector: ':host > div',
|
|
89220
89250
|
}) {
|
|
89221
89251
|
static get observedAttributes() {
|
|
89222
|
-
return ['readonly'];
|
|
89252
|
+
return ['readonly', 'required', ...BUTTON_ATTRS];
|
|
89223
89253
|
}
|
|
89224
89254
|
|
|
89255
|
+
// 'none' | 'copied' | 'downloaded' - the last action the user took on the codes
|
|
89256
|
+
#action = NO_ACTION;
|
|
89257
|
+
|
|
89258
|
+
// the error is shown only after a submit attempt (reportValidity), like inputs
|
|
89259
|
+
#showError = false;
|
|
89260
|
+
|
|
89261
|
+
// init() builds the buttons once with all seeded attrs; guards against rebuilding
|
|
89262
|
+
// on every per-attribute change fired during element upgrade (before init runs)
|
|
89263
|
+
#initialized = false;
|
|
89264
|
+
|
|
89225
89265
|
constructor() {
|
|
89226
89266
|
super();
|
|
89227
89267
|
|
|
89228
89268
|
this.attachShadow({ mode: 'open' }).innerHTML = `
|
|
89229
89269
|
<div class="wrapper">
|
|
89230
|
-
<div class="
|
|
89231
|
-
|
|
89232
|
-
<
|
|
89233
|
-
|
|
89270
|
+
<div class="codes-box">
|
|
89271
|
+
<div class="list"></div>
|
|
89272
|
+
<descope-text class="icon-wrapper">
|
|
89273
|
+
<div class="icons">
|
|
89274
|
+
<vaadin-icon class="icon copy-icon" icon="vaadin:copy-o" title="Copy"></vaadin-icon>
|
|
89275
|
+
<vaadin-icon class="icon download-icon" icon="vaadin:download-alt" title="Download"></vaadin-icon>
|
|
89276
|
+
</div>
|
|
89277
|
+
</descope-text>
|
|
89278
|
+
</div>
|
|
89279
|
+
<div class="error-message"></div>
|
|
89280
|
+
<div class="buttons-row"></div>
|
|
89234
89281
|
</div>
|
|
89235
89282
|
`;
|
|
89236
89283
|
|
|
89237
89284
|
this.list = this.shadowRoot.querySelector('.list');
|
|
89238
|
-
this.
|
|
89285
|
+
this.copyIcon = this.shadowRoot.querySelector('.copy-icon');
|
|
89286
|
+
this.downloadIcon = this.shadowRoot.querySelector('.download-icon');
|
|
89239
89287
|
this.iconWrapper = this.shadowRoot.querySelector('.icon-wrapper');
|
|
89288
|
+
this.errorMessageEle = this.shadowRoot.querySelector('.error-message');
|
|
89289
|
+
this.buttonsRow = this.shadowRoot.querySelector('.buttons-row');
|
|
89240
89290
|
|
|
89241
89291
|
injectStyle(
|
|
89242
89292
|
`
|
|
@@ -89245,8 +89295,14 @@ function requireIndex_cjs () {
|
|
|
89245
89295
|
position: relative;
|
|
89246
89296
|
}
|
|
89247
89297
|
.wrapper {
|
|
89298
|
+
display: flex;
|
|
89299
|
+
flex-direction: column;
|
|
89300
|
+
}
|
|
89301
|
+
.codes-box {
|
|
89248
89302
|
display: flex;
|
|
89249
89303
|
justify-content: space-between;
|
|
89304
|
+
box-sizing: border-box;
|
|
89305
|
+
/* border shows the error ring inside the box; style/width/color/radius come from theme */
|
|
89250
89306
|
}
|
|
89251
89307
|
.list {
|
|
89252
89308
|
display: flex;
|
|
@@ -89265,15 +89321,57 @@ function requireIndex_cjs () {
|
|
|
89265
89321
|
.icon-wrapper {
|
|
89266
89322
|
align-self: flex-start;
|
|
89267
89323
|
}
|
|
89324
|
+
.icons {
|
|
89325
|
+
display: flex;
|
|
89326
|
+
flex-direction: column;
|
|
89327
|
+
}
|
|
89268
89328
|
.icon {
|
|
89269
89329
|
cursor: pointer;
|
|
89270
89330
|
}
|
|
89271
89331
|
.icon.copied {
|
|
89272
89332
|
cursor: initial;
|
|
89333
|
+
/* block re-clicks while the checkmark shows, so rapid clicks cannot repeat the action */
|
|
89334
|
+
pointer-events: none;
|
|
89273
89335
|
}
|
|
89274
|
-
|
|
89336
|
+
/* readonly is a host attribute, so disable pointer events from one place */
|
|
89337
|
+
:host([readonly="true"]) .icon,
|
|
89338
|
+
:host([readonly="true"]) .buttons-row {
|
|
89275
89339
|
pointer-events: none;
|
|
89276
89340
|
}
|
|
89341
|
+
.download-icon {
|
|
89342
|
+
display: none;
|
|
89343
|
+
}
|
|
89344
|
+
:host([show-download="true"]) .download-icon {
|
|
89345
|
+
display: inline-flex;
|
|
89346
|
+
}
|
|
89347
|
+
.error-message {
|
|
89348
|
+
display: none;
|
|
89349
|
+
/* width:0 + min-width:100% lets the message wrap to the component width without
|
|
89350
|
+
its text expanding the (shrink-to-fit) component; full-width still fills the parent */
|
|
89351
|
+
width: 0;
|
|
89352
|
+
min-width: 100%;
|
|
89353
|
+
box-sizing: border-box;
|
|
89354
|
+
line-height: 1.2;
|
|
89355
|
+
overflow-wrap: break-word;
|
|
89356
|
+
}
|
|
89357
|
+
:host([invalid]) .error-message {
|
|
89358
|
+
display: block;
|
|
89359
|
+
}
|
|
89360
|
+
.buttons-row {
|
|
89361
|
+
display: none;
|
|
89362
|
+
}
|
|
89363
|
+
:host([display-variant="buttons"]) .icon-wrapper {
|
|
89364
|
+
display: none;
|
|
89365
|
+
}
|
|
89366
|
+
:host([display-variant="buttons"]) .buttons-row {
|
|
89367
|
+
display: flex;
|
|
89368
|
+
flex-wrap: wrap;
|
|
89369
|
+
}
|
|
89370
|
+
/* grow to fill equally; don't shrink below content, so they wrap to a new line
|
|
89371
|
+
when they don't fit (like a container with auto-fit items) */
|
|
89372
|
+
.buttons-row > descope-button {
|
|
89373
|
+
flex: 1 0 auto;
|
|
89374
|
+
}
|
|
89277
89375
|
`,
|
|
89278
89376
|
this,
|
|
89279
89377
|
);
|
|
@@ -89287,41 +89385,190 @@ function requireIndex_cjs () {
|
|
|
89287
89385
|
return this.getAttribute('mode');
|
|
89288
89386
|
}
|
|
89289
89387
|
|
|
89388
|
+
// the form value read by the flow SDK (#getFormData reads `.value`)
|
|
89389
|
+
get value() {
|
|
89390
|
+
return this.#action;
|
|
89391
|
+
}
|
|
89392
|
+
|
|
89393
|
+
// a boolean attribute is "on" when present and not explicitly "false"
|
|
89394
|
+
#boolAttr(name) {
|
|
89395
|
+
return this.hasAttribute(name) && this.getAttribute(name) !== 'false';
|
|
89396
|
+
}
|
|
89397
|
+
|
|
89398
|
+
get isRequired() {
|
|
89399
|
+
return this.#boolAttr('required');
|
|
89400
|
+
}
|
|
89401
|
+
|
|
89402
|
+
get isReadOnly() {
|
|
89403
|
+
return this.#boolAttr('readonly');
|
|
89404
|
+
}
|
|
89405
|
+
|
|
89406
|
+
get errorMessage() {
|
|
89407
|
+
return (
|
|
89408
|
+
this.getAttribute('data-errormessage-value-missing') ||
|
|
89409
|
+
DEFAULT_ERROR_MESSAGE
|
|
89410
|
+
);
|
|
89411
|
+
}
|
|
89412
|
+
|
|
89413
|
+
get codesText() {
|
|
89414
|
+
return String((this.data || []).map((rc) => rc.value).join('\n'));
|
|
89415
|
+
}
|
|
89416
|
+
|
|
89290
89417
|
init() {
|
|
89291
89418
|
super.init();
|
|
89292
89419
|
|
|
89293
|
-
this.
|
|
89420
|
+
this.copyIcon.addEventListener('click', this.onCopy.bind(this));
|
|
89421
|
+
this.downloadIcon.addEventListener('click', this.onDownload.bind(this));
|
|
89294
89422
|
|
|
89295
89423
|
forwardAttrs(this, this.iconWrapper, { includeAttrs: ['variant', 'mode'] });
|
|
89424
|
+
|
|
89425
|
+
this.renderButtons();
|
|
89426
|
+
this.#initialized = true;
|
|
89296
89427
|
}
|
|
89297
89428
|
|
|
89298
|
-
|
|
89299
|
-
|
|
89300
|
-
|
|
89429
|
+
get isDownloadEnabled() {
|
|
89430
|
+
return this.getAttribute('show-download') === 'true';
|
|
89431
|
+
}
|
|
89432
|
+
|
|
89433
|
+
// buttons variant: copy (+ download when enabled) as descope-buttons, each independently
|
|
89434
|
+
// configurable. rendered even in the icons variant (CSS hides the row) so a variant switch is instant.
|
|
89435
|
+
renderButtons() {
|
|
89436
|
+
if (!this.buttonsRow) return;
|
|
89437
|
+
|
|
89438
|
+
const buttons = [this.buildButton('copy')];
|
|
89439
|
+
if (this.isDownloadEnabled) {
|
|
89440
|
+
buttons.push(this.buildButton('download'));
|
|
89441
|
+
}
|
|
89442
|
+
this.buttonsRow.replaceChildren(...buttons);
|
|
89443
|
+
}
|
|
89444
|
+
|
|
89445
|
+
buildButton(action) {
|
|
89446
|
+
const { defaultText } = ACTIONS[action];
|
|
89447
|
+
const attr = (name, fallback) =>
|
|
89448
|
+
this.getAttribute(`${action}-${name}`) || fallback;
|
|
89449
|
+
|
|
89450
|
+
const button = document.createElement('descope-button');
|
|
89451
|
+
button.setAttribute('data-action', action);
|
|
89452
|
+
button.setAttribute('variant', attr('variant', 'outline'));
|
|
89453
|
+
button.setAttribute('mode', attr('color', 'primary'));
|
|
89454
|
+
button.setAttribute('size', attr('size', 'md'));
|
|
89455
|
+
|
|
89456
|
+
// icon is an image src - the seeded glyph or a custom upload (light/dark),
|
|
89457
|
+
// same as the standard button's start icon. rendered via descope-icon in the
|
|
89458
|
+
// default slot (not slot="prefix") so it centers with the label when the
|
|
89459
|
+
// button grows. descope-icon inlines SVGs, so the glyph (authored with
|
|
89460
|
+
// fill="currentColor") tracks the button text color while an uploaded image
|
|
89461
|
+
// keeps its own colors.
|
|
89462
|
+
const iconSrc = this.getAttribute(`${action}-icon`);
|
|
89463
|
+
if (iconSrc) {
|
|
89464
|
+
const icon = document.createElement('descope-icon');
|
|
89465
|
+
icon.setAttribute('src', iconSrc);
|
|
89466
|
+
const iconDark = this.getAttribute(`${action}-icon-dark`);
|
|
89467
|
+
if (iconDark) icon.setAttribute('src-dark', iconDark);
|
|
89468
|
+
button.appendChild(icon);
|
|
89469
|
+
}
|
|
89470
|
+
|
|
89471
|
+
button.appendChild(document.createTextNode(attr('text', defaultText)));
|
|
89472
|
+
button.addEventListener('click', () =>
|
|
89473
|
+
action === 'copy' ? this.onCopy() : this.onDownload(),
|
|
89301
89474
|
);
|
|
89475
|
+
return button;
|
|
89476
|
+
}
|
|
89302
89477
|
|
|
89303
|
-
|
|
89304
|
-
this.
|
|
89305
|
-
|
|
89478
|
+
onCopy() {
|
|
89479
|
+
if (this.isReadOnly) return;
|
|
89480
|
+
navigator.clipboard.writeText(this.codesText);
|
|
89481
|
+
this.showActionFeedback(this.copyIcon, 'Copied');
|
|
89482
|
+
this.recordAction('copied');
|
|
89483
|
+
}
|
|
89306
89484
|
|
|
89307
|
-
|
|
89308
|
-
|
|
89309
|
-
|
|
89310
|
-
|
|
89485
|
+
onDownload() {
|
|
89486
|
+
if (this.isReadOnly) return;
|
|
89487
|
+
const blob = new Blob([this.codesText], { type: 'text/plain' });
|
|
89488
|
+
const url = URL.createObjectURL(blob);
|
|
89489
|
+
const anchor = document.createElement('a');
|
|
89490
|
+
anchor.href = url;
|
|
89491
|
+
anchor.download = 'recovery-codes.txt';
|
|
89492
|
+
anchor.click();
|
|
89493
|
+
URL.revokeObjectURL(url);
|
|
89494
|
+
|
|
89495
|
+
this.showActionFeedback(this.downloadIcon, 'Downloaded');
|
|
89496
|
+
this.recordAction('downloaded');
|
|
89497
|
+
}
|
|
89498
|
+
|
|
89499
|
+
// copy/download share this - only the visual feedback differs by variant
|
|
89500
|
+
recordAction(action) {
|
|
89501
|
+
this.#action = action;
|
|
89502
|
+
// let the flow re-evaluate real-time conditions and pick up the new value
|
|
89503
|
+
this.dispatchEvent(new Event('change', { bubbles: true }));
|
|
89504
|
+
// acting clears the mandatory error
|
|
89505
|
+
if (this.checkValidity()) {
|
|
89506
|
+
this.#showError = false;
|
|
89507
|
+
}
|
|
89508
|
+
this.syncValidityUI();
|
|
89509
|
+
}
|
|
89510
|
+
|
|
89511
|
+
// icons variant: swap the icon to a checkmark for 5s (buttons variant is static)
|
|
89512
|
+
showActionFeedback(iconEle, doneTitle) {
|
|
89513
|
+
// on a rapid re-click the checkmark is already showing, so cancel the pending restore
|
|
89514
|
+
// and keep the glyph/title we saved the first time (never capture the checkmark itself)
|
|
89515
|
+
if (iconEle.feedbackTimer) {
|
|
89516
|
+
clearTimeout(iconEle.feedbackTimer);
|
|
89517
|
+
} else {
|
|
89518
|
+
iconEle.originalIcon = iconEle.getAttribute('icon');
|
|
89519
|
+
iconEle.originalTitle = iconEle.getAttribute('title');
|
|
89520
|
+
}
|
|
89521
|
+
|
|
89522
|
+
iconEle.setAttribute('icon', 'vaadin:check-circle-o');
|
|
89523
|
+
iconEle.setAttribute('title', doneTitle);
|
|
89524
|
+
iconEle.classList.add('copied');
|
|
89525
|
+
|
|
89526
|
+
iconEle.feedbackTimer = setTimeout(() => {
|
|
89527
|
+
iconEle.setAttribute('icon', iconEle.originalIcon);
|
|
89528
|
+
iconEle.setAttribute('title', iconEle.originalTitle);
|
|
89529
|
+
iconEle.classList.remove('copied');
|
|
89530
|
+
iconEle.feedbackTimer = null;
|
|
89311
89531
|
}, 5000);
|
|
89312
89532
|
}
|
|
89313
89533
|
|
|
89314
|
-
|
|
89315
|
-
|
|
89534
|
+
// the flow SDK's #validateInputs calls checkValidity/reportValidity on every *[name]
|
|
89535
|
+
checkValidity() {
|
|
89536
|
+
return this.isReadOnly || !this.isRequired || this.value !== NO_ACTION;
|
|
89537
|
+
}
|
|
89538
|
+
|
|
89539
|
+
reportValidity() {
|
|
89540
|
+
const valid = this.checkValidity();
|
|
89541
|
+
this.#showError = !valid;
|
|
89542
|
+
this.syncValidityUI();
|
|
89543
|
+
return valid;
|
|
89544
|
+
}
|
|
89545
|
+
|
|
89546
|
+
// single source of truth for the error UI - reflects `invalid` (theme `_invalid`
|
|
89547
|
+
// draws the outline) and fills the message. never toggled anywhere else.
|
|
89548
|
+
syncValidityUI() {
|
|
89549
|
+
this.toggleAttribute('invalid', this.#showError);
|
|
89550
|
+
if (this.errorMessageEle) {
|
|
89551
|
+
this.errorMessageEle.textContent = this.#showError
|
|
89552
|
+
? this.errorMessage
|
|
89553
|
+
: '';
|
|
89554
|
+
}
|
|
89316
89555
|
}
|
|
89317
89556
|
|
|
89318
89557
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
89319
89558
|
super.attributeChangedCallback?.(attrName, oldValue, newValue);
|
|
89320
89559
|
|
|
89321
|
-
if (newValue
|
|
89322
|
-
|
|
89323
|
-
|
|
89324
|
-
|
|
89560
|
+
if (newValue === oldValue) return;
|
|
89561
|
+
|
|
89562
|
+
// if it stops being required, drop any error already shown
|
|
89563
|
+
if (attrName === 'required' && !this.isRequired) {
|
|
89564
|
+
this.#showError = false;
|
|
89565
|
+
this.syncValidityUI();
|
|
89566
|
+
}
|
|
89567
|
+
|
|
89568
|
+
// only rebuild for live edits after init (init already built once with all attrs);
|
|
89569
|
+
// avoids rebuilding once per attribute during the initial element upgrade
|
|
89570
|
+
if (this.#initialized && BUTTON_ATTRS.includes(attrName)) {
|
|
89571
|
+
this.renderButtons();
|
|
89325
89572
|
}
|
|
89326
89573
|
}
|
|
89327
89574
|
}
|
|
@@ -89341,10 +89588,66 @@ function requireIndex_cjs () {
|
|
|
89341
89588
|
textAlign: { selector: () => '.list', property: 'align-items' },
|
|
89342
89589
|
iconColor: { selector: () => 'vaadin-icon', property: 'color' },
|
|
89343
89590
|
iconSize: { selector: () => 'vaadin-icon', property: 'font-size' },
|
|
89344
|
-
iconGap: { selector: () => '.
|
|
89591
|
+
iconGap: { selector: () => '.codes-box', property: 'gap' },
|
|
89592
|
+
iconStackGap: { selector: () => '.icons', property: 'gap' },
|
|
89593
|
+
buttonsGap: { selector: () => '.buttons-row', property: 'gap' },
|
|
89594
|
+
sectionsGap: { selector: () => '.wrapper', property: 'gap' },
|
|
89345
89595
|
bulletGap: { selector: () => 'descope-text span', property: 'gap' },
|
|
89596
|
+
// top + bottom padding sit inside the border (below the codes) in both variants; in the
|
|
89597
|
+
// buttons variant the bottom padding also repeats below the buttons (the buttons-row entry
|
|
89598
|
+
// is inert in the icons variant, where the row is display:none).
|
|
89599
|
+
verticalPadding: [
|
|
89600
|
+
{ selector: () => '.codes-box', property: 'padding-top' },
|
|
89601
|
+
{ selector: () => '.codes-box', property: 'padding-bottom' },
|
|
89602
|
+
{ selector: () => '.buttons-row', property: 'padding-bottom' },
|
|
89603
|
+
],
|
|
89604
|
+
// horizontal padding insets the codes (inside the border) and the buttons, but NOT the
|
|
89605
|
+
// error message, which stays aligned to the component edge (like the input error).
|
|
89606
|
+
horizontalPadding: [
|
|
89607
|
+
{ selector: () => '.codes-box', property: 'padding-left' },
|
|
89608
|
+
{ selector: () => '.codes-box', property: 'padding-right' },
|
|
89609
|
+
{ selector: () => '.buttons-row', property: 'padding-left' },
|
|
89610
|
+
{ selector: () => '.buttons-row', property: 'padding-right' },
|
|
89611
|
+
],
|
|
89612
|
+
errorBorderColor: {
|
|
89613
|
+
selector: () => '.codes-box',
|
|
89614
|
+
property: 'border-color',
|
|
89615
|
+
},
|
|
89616
|
+
errorMessageColor: {
|
|
89617
|
+
selector: () => '.error-message',
|
|
89618
|
+
property: 'color',
|
|
89619
|
+
},
|
|
89620
|
+
errorMessageFontSize: {
|
|
89621
|
+
selector: () => '.error-message',
|
|
89622
|
+
property: 'font-size',
|
|
89623
|
+
},
|
|
89624
|
+
errorMessageFontWeight: {
|
|
89625
|
+
selector: () => '.error-message',
|
|
89626
|
+
property: 'font-weight',
|
|
89627
|
+
},
|
|
89628
|
+
errorMessageFontFamily: {
|
|
89629
|
+
selector: () => '.error-message',
|
|
89630
|
+
property: 'font-family',
|
|
89631
|
+
},
|
|
89632
|
+
boxBorderRadius: {
|
|
89633
|
+
selector: () => '.codes-box',
|
|
89634
|
+
property: 'border-radius',
|
|
89635
|
+
},
|
|
89636
|
+
errorBorderWidth: {
|
|
89637
|
+
selector: () => '.codes-box',
|
|
89638
|
+
property: 'border-width',
|
|
89639
|
+
},
|
|
89640
|
+
boxBorderStyle: {
|
|
89641
|
+
selector: () => '.codes-box',
|
|
89642
|
+
property: 'border-style',
|
|
89643
|
+
},
|
|
89346
89644
|
},
|
|
89347
89645
|
}),
|
|
89646
|
+
// also inject the shared input-wrapper theme onto our host (like the input components do),
|
|
89647
|
+
// so the error message + border track the console "customize inputs" tokens
|
|
89648
|
+
createStyleMixin$1({
|
|
89649
|
+
componentNameOverride: getComponentName('input-wrapper'),
|
|
89650
|
+
}),
|
|
89348
89651
|
createDynamicDataMixin$1({
|
|
89349
89652
|
itemRenderer: itemRenderer$5,
|
|
89350
89653
|
rerenderAttrsList: ['variant', 'mode'],
|
|
@@ -89363,9 +89666,33 @@ function requireIndex_cjs () {
|
|
|
89363
89666
|
[vars$T.hostDirection]: globalRefs$t.direction,
|
|
89364
89667
|
[vars$T.iconColor]: useVar$1(textVars$6.textColor),
|
|
89365
89668
|
[vars$T.iconSize]: useVar$1(textVars$6.fontSize),
|
|
89669
|
+
// gap between the codes and the icon column
|
|
89366
89670
|
[vars$T.iconGap]: '8px',
|
|
89671
|
+
// gap between the stacked copy and download icons
|
|
89672
|
+
[vars$T.iconStackGap]: '16px',
|
|
89673
|
+
// gap between the copy and download buttons (buttons variant)
|
|
89674
|
+
[vars$T.buttonsGap]: '8px',
|
|
89675
|
+
// gap between the codes, the error message and the buttons
|
|
89676
|
+
[vars$T.sectionsGap]: '8px',
|
|
89367
89677
|
[vars$T.bulletGap]: '0.35em',
|
|
89368
89678
|
|
|
89679
|
+
// no padding by default so the current look is unchanged; the editor overrides per instance
|
|
89680
|
+
[vars$T.verticalPadding]: '0',
|
|
89681
|
+
[vars$T.horizontalPadding]: '0',
|
|
89682
|
+
|
|
89683
|
+
// error ring is transparent until the component is marked invalid (see _invalid below).
|
|
89684
|
+
// message color/font + border come from the shared input-wrapper tokens, so customizing
|
|
89685
|
+
// inputs in the console updates the recovery-codes error styling from the same place.
|
|
89686
|
+
[vars$T.errorBorderColor]: 'transparent',
|
|
89687
|
+
[vars$T.errorBorderWidth]: refs$1.borderWidth,
|
|
89688
|
+
[vars$T.boxBorderRadius]: refs$1.borderRadius,
|
|
89689
|
+
// local default; can later map to the input-wrapper border style if it exposes one
|
|
89690
|
+
[vars$T.boxBorderStyle]: 'solid',
|
|
89691
|
+
[vars$T.errorMessageColor]: refs$1.errorMessageTextColor,
|
|
89692
|
+
[vars$T.errorMessageFontSize]: refs$1.errorMessageFontSize,
|
|
89693
|
+
[vars$T.errorMessageFontWeight]: refs$1.errorMessageFontWeight,
|
|
89694
|
+
[vars$T.errorMessageFontFamily]: refs$1.fontFamily,
|
|
89695
|
+
|
|
89369
89696
|
textAlign: {
|
|
89370
89697
|
right: { [vars$T.textAlign]: 'flex-end' },
|
|
89371
89698
|
left: { [vars$T.textAlign]: 'flex-start' },
|
|
@@ -89375,6 +89702,11 @@ function requireIndex_cjs () {
|
|
|
89375
89702
|
_fullWidth: {
|
|
89376
89703
|
[vars$T.hostWidth]: '100%',
|
|
89377
89704
|
},
|
|
89705
|
+
|
|
89706
|
+
// reflected `invalid` attribute (set by the component on a failed submit)
|
|
89707
|
+
_invalid: {
|
|
89708
|
+
[vars$T.errorBorderColor]: refs$1.errorMessageTextColor,
|
|
89709
|
+
},
|
|
89378
89710
|
};
|
|
89379
89711
|
|
|
89380
89712
|
var recoveryCodes$1 = /*#__PURE__*/Object.freeze({
|
package/dist/index.d.ts
CHANGED
|
@@ -1298,6 +1298,25 @@ type Props$5 = {
|
|
|
1298
1298
|
'text-align': TextAlign;
|
|
1299
1299
|
'full-width': boolean;
|
|
1300
1300
|
data?: Item[];
|
|
1301
|
+
name?: string;
|
|
1302
|
+
required?: boolean;
|
|
1303
|
+
'data-errormessage-value-missing'?: string;
|
|
1304
|
+
'display-variant'?: 'icons' | 'buttons';
|
|
1305
|
+
'show-download'?: boolean;
|
|
1306
|
+
'st-horizontal-padding'?: string;
|
|
1307
|
+
'st-vertical-padding'?: string;
|
|
1308
|
+
'copy-text'?: string;
|
|
1309
|
+
'copy-variant'?: string;
|
|
1310
|
+
'copy-color'?: string;
|
|
1311
|
+
'copy-size'?: string;
|
|
1312
|
+
'copy-icon'?: string;
|
|
1313
|
+
'copy-icon-dark'?: string;
|
|
1314
|
+
'download-text'?: string;
|
|
1315
|
+
'download-variant'?: string;
|
|
1316
|
+
'download-color'?: string;
|
|
1317
|
+
'download-size'?: string;
|
|
1318
|
+
'download-icon'?: string;
|
|
1319
|
+
'download-icon-dark'?: string;
|
|
1301
1320
|
};
|
|
1302
1321
|
declare global {
|
|
1303
1322
|
namespace React.JSX {
|
|
@@ -9,6 +9,25 @@ type Props = {
|
|
|
9
9
|
'text-align': TextAlign;
|
|
10
10
|
'full-width': boolean;
|
|
11
11
|
data?: Item[];
|
|
12
|
+
name?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
'data-errormessage-value-missing'?: string;
|
|
15
|
+
'display-variant'?: 'icons' | 'buttons';
|
|
16
|
+
'show-download'?: boolean;
|
|
17
|
+
'st-horizontal-padding'?: string;
|
|
18
|
+
'st-vertical-padding'?: string;
|
|
19
|
+
'copy-text'?: string;
|
|
20
|
+
'copy-variant'?: string;
|
|
21
|
+
'copy-color'?: string;
|
|
22
|
+
'copy-size'?: string;
|
|
23
|
+
'copy-icon'?: string;
|
|
24
|
+
'copy-icon-dark'?: string;
|
|
25
|
+
'download-text'?: string;
|
|
26
|
+
'download-variant'?: string;
|
|
27
|
+
'download-color'?: string;
|
|
28
|
+
'download-size'?: string;
|
|
29
|
+
'download-icon'?: string;
|
|
30
|
+
'download-icon-dark'?: string;
|
|
12
31
|
};
|
|
13
32
|
declare global {
|
|
14
33
|
namespace React.JSX {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/flow-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"webpack-subresource-integrity": "5.2.0-rc.1"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@descope/web-components-ui": "3.
|
|
101
|
+
"@descope/web-components-ui": "3.21.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"react": ">= 18"
|