@thunderid/vue 1.3.2 → 1.4.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.
Files changed (53) hide show
  1. package/dist/__tests__/helpers/selectControl.d.ts +12 -0
  2. package/dist/__tests__/helpers/selectControl.d.ts.map +1 -0
  3. package/dist/api/getUsers.d.ts +33 -0
  4. package/dist/api/getUsers.d.ts.map +1 -0
  5. package/dist/cjs/index.cjs +912 -39
  6. package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts +9 -0
  7. package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts.map +1 -1
  8. package/dist/components/presentation/accept-invite/BaseAcceptInvite.d.ts.map +1 -1
  9. package/dist/components/presentation/invite-user/BaseInviteUser.d.ts.map +1 -1
  10. package/dist/components/presentation/invite-user/InviteUser.d.ts.map +1 -1
  11. package/dist/components/primitives/AuthFlowSelect/AuthFlowSelect.d.ts +12 -0
  12. package/dist/components/primitives/AuthFlowSelect/AuthFlowSelect.d.ts.map +1 -0
  13. package/dist/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.d.ts +15 -0
  14. package/dist/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.d.ts.map +1 -0
  15. package/dist/components/primitives/CopyableText/CopyableText.css.d.ts +11 -0
  16. package/dist/components/primitives/CopyableText/CopyableText.css.d.ts.map +1 -0
  17. package/dist/components/primitives/CopyableText/CopyableText.d.ts +12 -0
  18. package/dist/components/primitives/CopyableText/CopyableText.d.ts.map +1 -0
  19. package/dist/components/primitives/CopyableText/index.d.ts +2 -0
  20. package/dist/components/primitives/CopyableText/index.d.ts.map +1 -0
  21. package/dist/components/primitives/Icons.d.ts +1 -0
  22. package/dist/components/primitives/Icons.d.ts.map +1 -1
  23. package/dist/components/primitives/PasswordField/PasswordField.d.ts +4 -0
  24. package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
  25. package/dist/components/primitives/Select/ResourceSelect.d.ts +91 -0
  26. package/dist/components/primitives/Select/ResourceSelect.d.ts.map +1 -0
  27. package/dist/components/primitives/Select/Select.css.d.ts +2 -2
  28. package/dist/components/primitives/Select/Select.css.d.ts.map +1 -1
  29. package/dist/components/primitives/Select/Select.d.ts +2 -5
  30. package/dist/components/primitives/Select/Select.d.ts.map +1 -1
  31. package/dist/components/primitives/Select/useSelectMessages.d.ts +9 -0
  32. package/dist/components/primitives/Select/useSelectMessages.d.ts.map +1 -0
  33. package/dist/components/primitives/UserSelect/BaseUserSelect.d.ts +16 -0
  34. package/dist/components/primitives/UserSelect/BaseUserSelect.d.ts.map +1 -0
  35. package/dist/components/primitives/UserSelect/UserSelect.d.ts +15 -0
  36. package/dist/components/primitives/UserSelect/UserSelect.d.ts.map +1 -0
  37. package/dist/components/primitives/UserTypeSelect/BaseUserTypeSelect.d.ts +15 -0
  38. package/dist/components/primitives/UserTypeSelect/BaseUserTypeSelect.d.ts.map +1 -0
  39. package/dist/components/primitives/UserTypeSelect/UserTypeSelect.d.ts +12 -0
  40. package/dist/components/primitives/UserTypeSelect/UserTypeSelect.d.ts.map +1 -0
  41. package/dist/composables/useFetchAuthFlows.d.ts +8 -0
  42. package/dist/composables/useFetchAuthFlows.d.ts.map +1 -0
  43. package/dist/composables/useFetchUserTypes.d.ts +5 -0
  44. package/dist/composables/useFetchUserTypes.d.ts.map +1 -0
  45. package/dist/composables/useFetchUsers.d.ts +5 -0
  46. package/dist/composables/useFetchUsers.d.ts.map +1 -0
  47. package/dist/composables/useInfiniteOptions.d.ts +32 -0
  48. package/dist/composables/useInfiniteOptions.d.ts.map +1 -0
  49. package/dist/index.d.ts +18 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +904 -42
  52. package/dist/styles/injectStyles.d.ts.map +1 -1
  53. package/package.json +2 -2
@@ -306,7 +306,7 @@ const PACKAGE_NAME = "@thunderid/vue";
306
306
  * Package-level logger for `@thunderid/vue`.
307
307
  * Use this when logging is not tied to a specific component.
308
308
  */
309
- const logger$5 = (0, __thunderid_browser.createPackageLogger)(PACKAGE_NAME);
309
+ const logger$6 = (0, __thunderid_browser.createPackageLogger)(PACKAGE_NAME);
310
310
  /**
311
311
  * Creates a component-scoped logger prefixed with `@thunderid/vue - <component>`.
312
312
  *
@@ -316,7 +316,7 @@ const createVueLogger = (component) => (0, __thunderid_browser.createPackageComp
316
316
 
317
317
  //#endregion
318
318
  //#region src/providers/I18nProvider.ts
319
- const logger$4 = createVueLogger("I18nProvider");
319
+ const logger$5 = createVueLogger("I18nProvider");
320
320
  const DEFAULT_URL_PARAM = "lang";
321
321
  const deriveRootDomain = (hostname) => {
322
322
  const parts = hostname.split(".");
@@ -356,7 +356,7 @@ const createStorageAdapter = (strategy, key, cookieDomain) => {
356
356
  try {
357
357
  window.localStorage.setItem(key, language);
358
358
  } catch {
359
- logger$4.warn("Failed to persist language preference to localStorage.");
359
+ logger$5.warn("Failed to persist language preference to localStorage.");
360
360
  }
361
361
  }
362
362
  };
@@ -483,7 +483,7 @@ const I18nProvider = (0, vue.defineComponent)({
483
483
  };
484
484
  const setLanguage = (language) => {
485
485
  if (mergedBundlesComputed.value[language]) currentLanguage.value = language;
486
- else logger$4.warn(`Language '${language}' is not available. Available languages: ${Object.keys(mergedBundlesComputed.value).join(", ")}`);
486
+ else logger$5.warn(`Language '${language}' is not available. Available languages: ${Object.keys(mergedBundlesComputed.value).join(", ")}`);
487
487
  };
488
488
  (0, vue.provide)(I18N_KEY, {
489
489
  bundles: (0, vue.readonly)(mergedBundlesComputed),
@@ -2831,6 +2831,68 @@ const CHECKBOX_CSS = `
2831
2831
  `;
2832
2832
  var Checkbox_css_default = CHECKBOX_CSS;
2833
2833
 
2834
+ //#endregion
2835
+ //#region src/components/primitives/CopyableText/CopyableText.css.ts
2836
+ /**
2837
+ * Styles for the CopyableText primitive component.
2838
+ *
2839
+ * BEM block: `.thunderid-copyable-text`
2840
+ *
2841
+ * Elements:
2842
+ * __label | __box | __value | __copy
2843
+ */
2844
+ const COPYABLE_TEXT_CSS = `
2845
+ /* ============================================================
2846
+ CopyableText
2847
+ ============================================================ */
2848
+
2849
+ .thunderid-copyable-text {
2850
+ display: flex;
2851
+ flex-direction: column;
2852
+ gap: calc(var(--thunderid-spacing-unit) * 0.5);
2853
+ width: 100%;
2854
+ }
2855
+
2856
+ .thunderid-copyable-text__label {
2857
+ color: var(--thunderid-color-text-secondary);
2858
+ font-size: 0.875rem;
2859
+ font-weight: 500;
2860
+ }
2861
+
2862
+ .thunderid-copyable-text__box {
2863
+ display: flex;
2864
+ align-items: center;
2865
+ gap: calc(var(--thunderid-spacing-unit) * 1);
2866
+ padding: calc(var(--thunderid-spacing-unit) * 0.75) calc(var(--thunderid-spacing-unit) * 1);
2867
+ background-color: var(--thunderid-color-background-surface);
2868
+ border: 1px solid var(--thunderid-input-borderColor);
2869
+ border-radius: var(--thunderid-border-radius-small);
2870
+ }
2871
+
2872
+ .thunderid-copyable-text__value {
2873
+ flex: 1;
2874
+ min-width: 0;
2875
+ overflow: hidden;
2876
+ text-overflow: ellipsis;
2877
+ white-space: nowrap;
2878
+ word-break: break-all;
2879
+ font-family: monospace;
2880
+ font-size: 0.85rem;
2881
+ color: var(--thunderid-color-text-primary);
2882
+ }
2883
+
2884
+ .thunderid-copyable-text .thunderid-copyable-text__copy {
2885
+ flex-shrink: 0;
2886
+ padding: 0;
2887
+ width: var(--thunderid-button-sm-height);
2888
+ color: var(--thunderid-color-text-secondary);
2889
+ }
2890
+ .thunderid-copyable-text .thunderid-copyable-text__copy:hover {
2891
+ color: var(--thunderid-color-text-primary);
2892
+ }
2893
+ `;
2894
+ var CopyableText_css_default = COPYABLE_TEXT_CSS;
2895
+
2834
2896
  //#endregion
2835
2897
  //#region src/components/primitives/DatePicker/DatePicker.css.ts
2836
2898
  /**
@@ -3288,7 +3350,7 @@ var PasswordField_css_default = PASSWORD_FIELD_CSS;
3288
3350
  * --error – shows validation error state
3289
3351
  *
3290
3352
  * Elements:
3291
- * __label | __required | __input | __error | __helper
3353
+ * __label | __required | __input | __error | __helper | __status | __load-more
3292
3354
  */
3293
3355
  const SELECT_CSS = `
3294
3356
  /* ============================================================
@@ -3368,6 +3430,20 @@ const SELECT_CSS = `
3368
3430
  color: var(--thunderid-color-text-secondary);
3369
3431
  line-height: var(--thunderid-typography-lineHeight-normal);
3370
3432
  }
3433
+
3434
+ .thunderid-select__status {
3435
+ font-size: var(--thunderid-typography-fontSize-xs);
3436
+ color: var(--thunderid-color-text-secondary);
3437
+ line-height: var(--thunderid-typography-lineHeight-normal);
3438
+ }
3439
+ .thunderid-select__status:empty {
3440
+ display: none;
3441
+ }
3442
+
3443
+ .thunderid-select__load-more {
3444
+ color: var(--thunderid-color-primary-main);
3445
+ font-weight: var(--thunderid-typography-fontWeight-medium);
3446
+ }
3371
3447
  `;
3372
3448
  var Select_css_default = SELECT_CSS;
3373
3449
 
@@ -3647,6 +3723,7 @@ const STYLES = [
3647
3723
  Divider_css_default,
3648
3724
  KeyValueList_css_default,
3649
3725
  Logo_css_default,
3726
+ CopyableText_css_default,
3650
3727
  Spinner_css_default,
3651
3728
  BaseSignIn_css_default,
3652
3729
  ChangeCredential_css_default,
@@ -3997,6 +4074,189 @@ function useOAuthCallback({ currentFlowId, flowIdStorageKey = "thunderid_flow_id
3997
4074
  }, { immediate: true });
3998
4075
  }
3999
4076
 
4077
+ //#endregion
4078
+ //#region src/composables/useInfiniteOptions.ts
4079
+ const logger$4 = (0, __thunderid_browser.createPackageComponentLogger)("@thunderid/vue", "useInfiniteOptions");
4080
+ /**
4081
+ * Keeps the option list of a `Select` that loads more options when the user asks for them. It owns the cursor,
4082
+ * appends each batch without duplicates, and stops at the end of the data. Vue counterpart of the React
4083
+ * `useInfiniteOptions`.
4084
+ *
4085
+ * `args` is read live, so a changing `load` or `onError` is picked up without passing refs.
4086
+ */
4087
+ const useInfiniteOptions = (args) => {
4088
+ const options = (0, vue.shallowRef)((0, __thunderid_browser.normalizeSelectOptions)(args.initialOptions));
4089
+ const loading = (0, vue.ref)(false);
4090
+ const error = (0, vue.shallowRef)(null);
4091
+ const hasMore = (0, vue.ref)(true);
4092
+ let cursor;
4093
+ let finished = false;
4094
+ let inFlight = false;
4095
+ let requested = false;
4096
+ let generation = 0;
4097
+ let controller = null;
4098
+ let nonListLogged = false;
4099
+ const applyBatch = (batch) => {
4100
+ const merged = (0, __thunderid_browser.mergeOptionsBatch)({
4101
+ cursor,
4102
+ options: options.value
4103
+ }, batch);
4104
+ if (merged.issue === "cursor-stuck") logger$4.warn("A load returned no new options and the same cursor; the list was treated as finished.");
4105
+ else if (merged.issue === "not-a-list" && !nonListLogged) {
4106
+ nonListLogged = true;
4107
+ logger$4.warn("A load returned something other than a list of options; it was treated as an empty batch.");
4108
+ }
4109
+ const addedNothing = merged.options.length === options.value.length;
4110
+ cursor = merged.cursor;
4111
+ finished = merged.finished;
4112
+ options.value = merged.options;
4113
+ hasMore.value = !merged.finished;
4114
+ error.value = null;
4115
+ return addedNothing && !merged.finished;
4116
+ };
4117
+ const startLoad = async () => {
4118
+ const startedGeneration = generation;
4119
+ const startedController = new AbortController();
4120
+ controller = startedController;
4121
+ inFlight = true;
4122
+ loading.value = true;
4123
+ try {
4124
+ await (0, __thunderid_browser.loadUntilOptionsGrow)(() => args.load({
4125
+ cursor,
4126
+ options: options.value,
4127
+ signal: startedController.signal
4128
+ }), applyBatch, () => startedGeneration === generation);
4129
+ } catch (failure) {
4130
+ if (startedGeneration === generation && !startedController.signal.aborted) {
4131
+ const failureError = (0, __thunderid_browser.toError)(failure);
4132
+ error.value = failureError;
4133
+ try {
4134
+ args.onError?.(failureError);
4135
+ } catch (callbackFailure) {
4136
+ logger$4.error("The onError callback threw.", callbackFailure);
4137
+ }
4138
+ }
4139
+ } finally {
4140
+ if (startedGeneration === generation) {
4141
+ controller = null;
4142
+ inFlight = false;
4143
+ loading.value = false;
4144
+ }
4145
+ }
4146
+ };
4147
+ const onLoadMore = () => {
4148
+ if (inFlight || finished) return;
4149
+ requested = true;
4150
+ startLoad();
4151
+ };
4152
+ const reset = () => {
4153
+ const shouldReload = requested;
4154
+ generation += 1;
4155
+ controller?.abort();
4156
+ controller = null;
4157
+ cursor = void 0;
4158
+ finished = false;
4159
+ inFlight = false;
4160
+ options.value = (0, __thunderid_browser.normalizeSelectOptions)(args.initialOptions);
4161
+ hasMore.value = true;
4162
+ error.value = null;
4163
+ loading.value = false;
4164
+ if (shouldReload) startLoad();
4165
+ };
4166
+ (0, vue.onScopeDispose)(() => {
4167
+ generation += 1;
4168
+ controller?.abort();
4169
+ });
4170
+ return {
4171
+ error,
4172
+ hasMore,
4173
+ loading,
4174
+ onLoadMore,
4175
+ options,
4176
+ reset
4177
+ };
4178
+ };
4179
+ var useInfiniteOptions_default = useInfiniteOptions;
4180
+
4181
+ //#endregion
4182
+ //#region src/api/getUsers.ts
4183
+ /**
4184
+ * Retrieves one page of the user directory. Uses the ThunderID SPA client's httpClient by default,
4185
+ * which attaches the access token, but allows a custom fetcher.
4186
+ *
4187
+ * @param config - Configuration object with URL, paging options and optional request config.
4188
+ * @returns A promise that resolves with one page of the user directory.
4189
+ * @example
4190
+ * ```typescript
4191
+ * const page = await getUsers({
4192
+ * baseUrl: "https://localhost:8090",
4193
+ * limit: 30,
4194
+ * offset: 0,
4195
+ * });
4196
+ * ```
4197
+ */
4198
+ const getUsers = async ({ fetcher, instanceId = 0,...requestConfig }) => (0, __thunderid_browser.getUsers)({
4199
+ ...requestConfig,
4200
+ fetcher: fetcher ?? (0, __thunderid_browser.createHttpClientFetcher)(instanceId)
4201
+ });
4202
+ var getUsers_default = getUsers;
4203
+
4204
+ //#endregion
4205
+ //#region src/composables/useFetchUsers.ts
4206
+ /** A `FetchUsers` backed by the user directory, authenticated with the signed-in user's access token. */
4207
+ const useFetchUsers = () => {
4208
+ const { baseUrl, endpoints, instanceId } = useThunderID_default();
4209
+ const usersUrl = (0, __thunderid_browser.resolveResourceEndpoint)("users", { endpoints });
4210
+ return async ({ filter, limit, offset, signal }) => (0, __thunderid_browser.toUserSelectPage)(await getUsers_default({
4211
+ baseUrl,
4212
+ filter,
4213
+ instanceId,
4214
+ limit,
4215
+ offset,
4216
+ signal,
4217
+ url: usersUrl
4218
+ }), offset);
4219
+ };
4220
+ var useFetchUsers_default = useFetchUsers;
4221
+
4222
+ //#endregion
4223
+ //#region src/composables/useFetchAuthFlows.ts
4224
+ /**
4225
+ * A `FetchAuthFlows` backed by the flow list, restricted to authentication flows and authenticated with
4226
+ * the signed-in user's access token.
4227
+ */
4228
+ const useFetchAuthFlows = () => {
4229
+ const { baseUrl, endpoints, instanceId } = useThunderID_default();
4230
+ const flowsUrl = (0, __thunderid_browser.resolveResourceEndpoint)("flows", { endpoints });
4231
+ return async ({ limit, offset, signal }) => (0, __thunderid_browser.toAuthFlowSelectPage)(await (0, __thunderid_browser.getFlows)({
4232
+ baseUrl,
4233
+ fetcher: (0, __thunderid_browser.createHttpClientFetcher)(instanceId),
4234
+ flowType: __thunderid_browser.AuthFlowSelectConstants.FLOW_TYPE,
4235
+ limit: Math.min(limit, __thunderid_browser.SelectConstants.MAX_PAGE_SIZE),
4236
+ offset,
4237
+ signal,
4238
+ url: flowsUrl
4239
+ }), offset);
4240
+ };
4241
+ var useFetchAuthFlows_default = useFetchAuthFlows;
4242
+
4243
+ //#endregion
4244
+ //#region src/composables/useFetchUserTypes.ts
4245
+ /** A `FetchUserTypes` backed by the user type list, authenticated with the signed-in user's access token. */
4246
+ const useFetchUserTypes = () => {
4247
+ const { baseUrl, endpoints, instanceId } = useThunderID_default();
4248
+ const userTypesUrl = (0, __thunderid_browser.resolveResourceEndpoint)("userTypes", { endpoints });
4249
+ return async ({ limit, offset, signal }) => (0, __thunderid_browser.toUserTypeSelectPage)(await (0, __thunderid_browser.getUserTypes)({
4250
+ baseUrl,
4251
+ fetcher: (0, __thunderid_browser.createHttpClientFetcher)(instanceId),
4252
+ limit: Math.min(limit, __thunderid_browser.SelectConstants.MAX_PAGE_SIZE),
4253
+ offset,
4254
+ signal,
4255
+ url: userTypesUrl
4256
+ }), offset);
4257
+ };
4258
+ var useFetchUserTypes_default = useFetchUserTypes;
4259
+
4000
4260
  //#endregion
4001
4261
  //#region src/components/primitives/Button/Button.ts
4002
4262
  const Button = (0, vue.defineComponent)({
@@ -4233,6 +4493,14 @@ const defaultProps = {
4233
4493
  };
4234
4494
  const icon = (paths) => (0, vue.h)("svg", { ...defaultProps }, paths);
4235
4495
  const CheckIcon = () => icon([(0, vue.h)("polyline", { points: "20 6 9 17 4 12" })]);
4496
+ const CopyIcon = () => icon([(0, vue.h)("rect", {
4497
+ height: "14",
4498
+ rx: "2",
4499
+ ry: "2",
4500
+ width: "14",
4501
+ x: "8",
4502
+ y: "8"
4503
+ }), (0, vue.h)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]);
4236
4504
  const XIcon = () => icon([(0, vue.h)("line", {
4237
4505
  x1: "18",
4238
4506
  x2: "6",
@@ -4420,9 +4688,17 @@ const PencilIcon = () => icon([(0, vue.h)("path", { d: "M17 3a2.828 2.828 0 1 1
4420
4688
 
4421
4689
  //#endregion
4422
4690
  //#region src/components/primitives/PasswordField/PasswordField.ts
4691
+ /**
4692
+ * A password input with a show and hide button. The `append` slot holds extra content inside the field, after the
4693
+ * button, such as an action button.
4694
+ */
4423
4695
  const PasswordField = (0, vue.defineComponent)({
4424
4696
  name: "PasswordField",
4425
4697
  props: {
4698
+ ariaLabel: {
4699
+ default: void 0,
4700
+ type: String
4701
+ },
4426
4702
  autocomplete: {
4427
4703
  default: "current-password",
4428
4704
  type: String
@@ -4435,6 +4711,10 @@ const PasswordField = (0, vue.defineComponent)({
4435
4711
  default: void 0,
4436
4712
  type: String
4437
4713
  },
4714
+ hideLabel: {
4715
+ default: "Hide password",
4716
+ type: String
4717
+ },
4438
4718
  label: {
4439
4719
  default: void 0,
4440
4720
  type: String
@@ -4451,13 +4731,21 @@ const PasswordField = (0, vue.defineComponent)({
4451
4731
  default: void 0,
4452
4732
  type: String
4453
4733
  },
4734
+ readonly: {
4735
+ default: false,
4736
+ type: Boolean
4737
+ },
4454
4738
  required: {
4455
4739
  default: false,
4456
4740
  type: Boolean
4741
+ },
4742
+ showLabel: {
4743
+ default: "Show password",
4744
+ type: String
4457
4745
  }
4458
4746
  },
4459
4747
  emits: ["update:modelValue", "blur"],
4460
- setup(props, { emit, attrs }) {
4748
+ setup(props, { emit, attrs, slots }) {
4461
4749
  const visible = (0, vue.ref)(false);
4462
4750
  return () => {
4463
4751
  const hasError = !!props.error;
@@ -4473,28 +4761,34 @@ const PasswordField = (0, vue.defineComponent)({
4473
4761
  class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__label"),
4474
4762
  for: props.name
4475
4763
  }, [props.label, props.required ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__required") }, " *") : null]) : null,
4476
- (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__wrapper") }, [(0, vue.h)("input", {
4477
- autocomplete: props.autocomplete,
4478
- class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__input"),
4479
- "data-testid": attrs["data-testid"],
4480
- disabled: props.disabled,
4481
- id: props.name,
4482
- name: props.name,
4483
- onBlur: () => emit("blur"),
4484
- onInput: (e) => emit("update:modelValue", e.target.value),
4485
- placeholder: props.placeholder,
4486
- required: props.required,
4487
- type: visible.value ? "text" : "password",
4488
- value: props.modelValue
4489
- }), (0, vue.h)("button", {
4490
- "aria-label": visible.value ? "Hide password" : "Show password",
4491
- class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__toggle"),
4492
- onClick: () => {
4493
- visible.value = !visible.value;
4494
- },
4495
- tabindex: -1,
4496
- type: "button"
4497
- }, visible.value ? EyeOffIcon() : EyeIcon())]),
4764
+ (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__wrapper") }, [
4765
+ (0, vue.h)("input", {
4766
+ "aria-label": props.ariaLabel,
4767
+ autocomplete: props.autocomplete,
4768
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__input"),
4769
+ "data-testid": attrs["data-testid"],
4770
+ disabled: props.disabled,
4771
+ id: props.name,
4772
+ name: props.name,
4773
+ onBlur: () => emit("blur"),
4774
+ onInput: (e) => emit("update:modelValue", e.target.value),
4775
+ placeholder: props.placeholder,
4776
+ readonly: props.readonly,
4777
+ required: props.required,
4778
+ type: visible.value ? "text" : "password",
4779
+ value: props.modelValue
4780
+ }),
4781
+ (0, vue.h)("button", {
4782
+ "aria-label": visible.value ? props.hideLabel : props.showLabel,
4783
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__toggle"),
4784
+ onClick: () => {
4785
+ visible.value = !visible.value;
4786
+ },
4787
+ tabindex: props.readonly ? 0 : -1,
4788
+ type: "button"
4789
+ }, visible.value ? EyeOffIcon() : EyeIcon()),
4790
+ slots["append"]?.()
4791
+ ]),
4498
4792
  hasError ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__error") }, props.error) : null
4499
4793
  ]);
4500
4794
  };
@@ -4502,15 +4796,35 @@ const PasswordField = (0, vue.defineComponent)({
4502
4796
  });
4503
4797
  var PasswordField_default = PasswordField;
4504
4798
 
4799
+ //#endregion
4800
+ //#region src/components/primitives/Select/useSelectMessages.ts
4801
+ /**
4802
+ * The wording of `Select`: the active translations when there is an I18n provider, English otherwise, so `Select`
4803
+ * works without a provider. Call the result in a render function so a change of language is picked up.
4804
+ */
4805
+ const useSelectMessages = () => {
4806
+ const i18n = (0, vue.inject)(I18N_KEY, null);
4807
+ return () => (0, __thunderid_browser.getSelectMessages)(i18n ? (key) => i18n.t(key) : void 0);
4808
+ };
4809
+ var useSelectMessages_default = useSelectMessages;
4810
+
4505
4811
  //#endregion
4506
4812
  //#region src/components/primitives/Select/Select.ts
4507
4813
  const Select = (0, vue.defineComponent)({
4508
4814
  name: "Select",
4509
4815
  props: {
4816
+ ariaLabel: {
4817
+ default: void 0,
4818
+ type: String
4819
+ },
4510
4820
  disabled: {
4511
4821
  default: false,
4512
4822
  type: Boolean
4513
4823
  },
4824
+ emptyText: {
4825
+ default: void 0,
4826
+ type: String
4827
+ },
4514
4828
  error: {
4515
4829
  default: void 0,
4516
4830
  type: String
@@ -4523,6 +4837,10 @@ const Select = (0, vue.defineComponent)({
4523
4837
  default: void 0,
4524
4838
  type: String
4525
4839
  },
4840
+ loading: {
4841
+ default: false,
4842
+ type: Boolean
4843
+ },
4526
4844
  modelValue: {
4527
4845
  default: "",
4528
4846
  type: String
@@ -4531,6 +4849,10 @@ const Select = (0, vue.defineComponent)({
4531
4849
  default: void 0,
4532
4850
  type: String
4533
4851
  },
4852
+ onLoadMore: {
4853
+ default: void 0,
4854
+ type: Function
4855
+ },
4534
4856
  options: {
4535
4857
  default: () => [],
4536
4858
  type: Array
@@ -4542,12 +4864,19 @@ const Select = (0, vue.defineComponent)({
4542
4864
  required: {
4543
4865
  default: false,
4544
4866
  type: Boolean
4867
+ },
4868
+ selectedOption: {
4869
+ default: void 0,
4870
+ type: Object
4545
4871
  }
4546
4872
  },
4547
- emits: ["update:modelValue"],
4873
+ emits: ["blur", "update:modelValue"],
4548
4874
  setup(props, { emit, attrs }) {
4875
+ const messages = useSelectMessages_default();
4549
4876
  return () => {
4550
4877
  const hasError = !!props.error;
4878
+ const items = (0, __thunderid_browser.normalizeSelectOptions)(props.options);
4879
+ const text = messages();
4551
4880
  const wrapperClass = [
4552
4881
  (0, __thunderid_browser.withVendorCSSClassPrefix)("select"),
4553
4882
  hasError ? (0, __thunderid_browser.withVendorCSSClassPrefix)("select--error") : "",
@@ -4557,6 +4886,13 @@ const Select = (0, vue.defineComponent)({
4557
4886
  if (hasError) helperContent = (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__error") }, props.error);
4558
4887
  else if (props.helperText) helperContent = (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__helper") }, props.helperText);
4559
4888
  else helperContent = null;
4889
+ const { selectedOption } = props;
4890
+ const showsSelectedOption = selectedOption?.value === props.modelValue && !items.some((item) => item.value === props.modelValue);
4891
+ let statusText;
4892
+ if (props.loading) statusText = items.length === 0 ? text.loading : text.loadingMore;
4893
+ else if (items.length === 0 && !props.onLoadMore) statusText = props.emptyText;
4894
+ const hasStatus = props.onLoadMore !== void 0 || props.emptyText !== void 0 || props.loading;
4895
+ const showsLoadMore = props.onLoadMore !== void 0 && (items.length > 0 || !props.loading);
4560
4896
  return (0, vue.h)("div", {
4561
4897
  class: wrapperClass,
4562
4898
  style: attrs.style
@@ -4566,21 +4902,46 @@ const Select = (0, vue.defineComponent)({
4566
4902
  for: props.name
4567
4903
  }, [props.label, props.required ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__required") }, " *") : null]) : null,
4568
4904
  (0, vue.h)("select", {
4905
+ "aria-busy": props.loading || void 0,
4906
+ "aria-label": props.ariaLabel,
4569
4907
  class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__input"),
4570
4908
  "data-testid": attrs["data-testid"],
4571
4909
  disabled: props.disabled,
4572
4910
  id: props.name,
4573
4911
  name: props.name,
4574
- onChange: (e) => emit("update:modelValue", e.target.value),
4912
+ onBlur: () => emit("blur"),
4913
+ onChange: (e) => {
4914
+ const control = e.target;
4915
+ if (control.value !== __thunderid_browser.SelectConstants.LOAD_MORE_OPTION_VALUE) {
4916
+ emit("update:modelValue", control.value);
4917
+ return;
4918
+ }
4919
+ control.value = props.modelValue;
4920
+ props.onLoadMore?.();
4921
+ },
4575
4922
  required: props.required,
4576
4923
  value: props.modelValue
4577
- }, [props.placeholder ? (0, vue.h)("option", {
4578
- disabled: true,
4579
- value: ""
4580
- }, props.placeholder) : null, ...props.options.map((opt) => (0, vue.h)("option", {
4581
- key: opt.value,
4582
- value: opt.value
4583
- }, opt.label))]),
4924
+ }, [
4925
+ props.placeholder ? (0, vue.h)("option", {
4926
+ disabled: props.required,
4927
+ value: ""
4928
+ }, props.placeholder) : null,
4929
+ showsSelectedOption && selectedOption ? (0, vue.h)("option", { value: selectedOption.value }, selectedOption.label) : null,
4930
+ ...items.map((opt) => (0, vue.h)("option", {
4931
+ disabled: opt.disabled,
4932
+ key: opt.value,
4933
+ value: opt.value
4934
+ }, opt.label)),
4935
+ showsLoadMore ? (0, vue.h)("option", {
4936
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__load-more"),
4937
+ disabled: props.loading,
4938
+ value: __thunderid_browser.SelectConstants.LOAD_MORE_OPTION_VALUE
4939
+ }, props.loading ? text.loadingMore : text.loadMore) : null
4940
+ ]),
4941
+ hasStatus ? (0, vue.h)("span", {
4942
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("select__status"),
4943
+ role: "status"
4944
+ }, statusText) : null,
4584
4945
  helperContent
4585
4946
  ]);
4586
4947
  };
@@ -4588,6 +4949,374 @@ const Select = (0, vue.defineComponent)({
4588
4949
  });
4589
4950
  var Select_default = Select;
4590
4951
 
4952
+ //#endregion
4953
+ //#region src/components/primitives/Select/ResourceSelect.ts
4954
+ const NO_PAGES = () => Promise.resolve({
4955
+ nextOffset: null,
4956
+ options: []
4957
+ });
4958
+ /** The props every resource picker (users, authentication flows, user types) passes straight through. */
4959
+ const commonSelectProps = {
4960
+ component: {
4961
+ default: void 0,
4962
+ type: Object
4963
+ },
4964
+ disabled: {
4965
+ default: false,
4966
+ type: Boolean
4967
+ },
4968
+ emptyText: {
4969
+ default: void 0,
4970
+ type: String
4971
+ },
4972
+ error: {
4973
+ default: void 0,
4974
+ type: String
4975
+ },
4976
+ filter: {
4977
+ default: void 0,
4978
+ type: String
4979
+ },
4980
+ helperText: {
4981
+ default: void 0,
4982
+ type: String
4983
+ },
4984
+ id: {
4985
+ default: void 0,
4986
+ type: String
4987
+ },
4988
+ label: {
4989
+ default: void 0,
4990
+ type: String
4991
+ },
4992
+ modelValue: {
4993
+ default: "",
4994
+ type: String
4995
+ },
4996
+ name: {
4997
+ default: void 0,
4998
+ type: String
4999
+ },
5000
+ onError: {
5001
+ default: void 0,
5002
+ type: Function
5003
+ },
5004
+ pageSize: {
5005
+ default: void 0,
5006
+ type: Number
5007
+ },
5008
+ placeholder: {
5009
+ default: void 0,
5010
+ type: String
5011
+ },
5012
+ required: {
5013
+ default: false,
5014
+ type: Boolean
5015
+ },
5016
+ selectedOption: {
5017
+ default: void 0,
5018
+ type: Object
5019
+ }
5020
+ };
5021
+ /**
5022
+ * The part the `USER_SELECT`, `AUTH_FLOW_SELECT` and `USER_TYPE_SELECT` pickers share: a {@link Select} that loads
5023
+ * one resource page by page. The list restarts when the page function, filter or page size changes.
5024
+ */
5025
+ const ResourceSelect = (0, vue.defineComponent)({
5026
+ name: "ResourceSelect",
5027
+ props: {
5028
+ ...commonSelectProps,
5029
+ bemBlock: {
5030
+ required: true,
5031
+ type: String
5032
+ },
5033
+ defaults: {
5034
+ default: void 0,
5035
+ type: Object
5036
+ },
5037
+ fallbackMessages: {
5038
+ required: true,
5039
+ type: Object
5040
+ },
5041
+ fetchPage: {
5042
+ default: void 0,
5043
+ type: Function
5044
+ },
5045
+ mapping: {
5046
+ default: void 0,
5047
+ type: Object
5048
+ },
5049
+ messageKey: {
5050
+ required: true,
5051
+ type: String
5052
+ },
5053
+ resource: {
5054
+ required: true,
5055
+ type: String
5056
+ },
5057
+ type: {
5058
+ required: true,
5059
+ type: String
5060
+ }
5061
+ },
5062
+ emits: ["blur", "update:modelValue"],
5063
+ setup(props, { emit }) {
5064
+ const { t } = useI18n_default();
5065
+ const loader = (0, vue.computed)(() => (0, __thunderid_browser.createResourceOptionsLoader)({
5066
+ get component() {
5067
+ return props.component ?? {
5068
+ id: props.id ?? props.name ?? props.bemBlock,
5069
+ type: props.type
5070
+ };
5071
+ },
5072
+ get defaults() {
5073
+ return props.defaults;
5074
+ },
5075
+ fetchPage: props.fetchPage ?? NO_PAGES,
5076
+ filter: props.filter,
5077
+ get mapping() {
5078
+ return props.mapping;
5079
+ },
5080
+ pageSize: (0, __thunderid_browser.resolvePageSize)(props.pageSize),
5081
+ resource: props.resource
5082
+ }));
5083
+ const { hasMore, loading, onLoadMore, options, reset } = useInfiniteOptions_default({
5084
+ load: (context) => loader.value(context),
5085
+ onError: (error) => props.onError?.(error)
5086
+ });
5087
+ (0, vue.onMounted)(() => {
5088
+ if (props.fetchPage) onLoadMore();
5089
+ });
5090
+ (0, vue.watch)(loader, () => {
5091
+ reset();
5092
+ if (props.fetchPage) onLoadMore();
5093
+ });
5094
+ return () => {
5095
+ return (0, vue.h)(Select_default, {
5096
+ "aria-label": [
5097
+ props.label,
5098
+ props.placeholder,
5099
+ t(`elements.fields.${props.messageKey}.aria_label`)
5100
+ ].find((text) => Boolean(text)) ?? props.fallbackMessages.ariaLabel,
5101
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)(props.bemBlock)),
5102
+ disabled: props.disabled,
5103
+ emptyText: props.emptyText ?? (t(`elements.fields.${props.messageKey}.empty`) || props.fallbackMessages.empty),
5104
+ error: props.error,
5105
+ helperText: props.helperText,
5106
+ id: props.id,
5107
+ label: props.label,
5108
+ loading: loading.value,
5109
+ modelValue: props.modelValue,
5110
+ name: props.name,
5111
+ onBlur: () => emit("blur"),
5112
+ onLoadMore: props.fetchPage && hasMore.value ? onLoadMore : void 0,
5113
+ options: options.value,
5114
+ placeholder: props.placeholder,
5115
+ required: props.required,
5116
+ selectedOption: props.selectedOption,
5117
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value)
5118
+ });
5119
+ };
5120
+ }
5121
+ });
5122
+ var ResourceSelect_default = ResourceSelect;
5123
+
5124
+ //#endregion
5125
+ //#region src/components/primitives/UserSelect/BaseUserSelect.ts
5126
+ const USER_DEFAULTS = { labelAttributes: __thunderid_browser.UserSelectConstants.LABEL_ATTRIBUTES };
5127
+ /**
5128
+ * Single-user picker: a `Select` that loads from the given `fetchUsers` and submits the user's ID.
5129
+ * Labels come from `display`, `username`, or `email` unless `mapping` says otherwise.
5130
+ * Building block for `UserSelect`; for a custom data source use `Select` with `useInfiniteOptions`.
5131
+ */
5132
+ const BaseUserSelect = (0, vue.defineComponent)({
5133
+ name: "BaseUserSelect",
5134
+ props: {
5135
+ ...commonSelectProps,
5136
+ fetchUsers: {
5137
+ default: void 0,
5138
+ type: Function
5139
+ },
5140
+ mapping: {
5141
+ default: void 0,
5142
+ type: Object
5143
+ }
5144
+ },
5145
+ emits: ["update:modelValue"],
5146
+ setup(props, { emit }) {
5147
+ return () => {
5148
+ const { fetchUsers, mapping,...common } = props;
5149
+ return (0, vue.h)(ResourceSelect_default, {
5150
+ ...common,
5151
+ bemBlock: "user-select",
5152
+ defaults: USER_DEFAULTS,
5153
+ fallbackMessages: {
5154
+ ariaLabel: "Select a user",
5155
+ empty: "No users found."
5156
+ },
5157
+ fetchPage: fetchUsers,
5158
+ mapping,
5159
+ messageKey: "user_select",
5160
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value),
5161
+ resource: "users",
5162
+ type: __thunderid_browser.EmbeddedFlowComponentType.UserSelect
5163
+ });
5164
+ };
5165
+ }
5166
+ });
5167
+ var BaseUserSelect_default = BaseUserSelect;
5168
+
5169
+ //#endregion
5170
+ //#region src/components/primitives/UserSelect/UserSelect.ts
5171
+ /**
5172
+ * Single-user picker for signed-in screens. It loads the user directory itself with the signed-in
5173
+ * user's access token and submits the chosen user's ID, so it takes no data source. For any other
5174
+ * data source use {@link Select} with {@link useInfiniteOptions}.
5175
+ */
5176
+ const UserSelect = (0, vue.defineComponent)({
5177
+ name: "UserSelect",
5178
+ props: {
5179
+ ...commonSelectProps,
5180
+ mapping: {
5181
+ default: void 0,
5182
+ type: Object
5183
+ }
5184
+ },
5185
+ emits: ["update:modelValue"],
5186
+ setup(props, { emit }) {
5187
+ const fetchUsers = useFetchUsers_default();
5188
+ return () => (0, vue.h)(BaseUserSelect_default, {
5189
+ ...props,
5190
+ fetchUsers,
5191
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value)
5192
+ });
5193
+ }
5194
+ });
5195
+ var UserSelect_default = UserSelect;
5196
+
5197
+ //#endregion
5198
+ //#region src/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.ts
5199
+ const AUTH_FLOW_DEFAULTS = { labelAttributes: __thunderid_browser.AuthFlowSelectConstants.LABEL_ATTRIBUTES };
5200
+ /**
5201
+ * Authentication-flow picker: a `Select` that loads from the given `fetchAuthFlows`, showing each flow by
5202
+ * its name and submitting its ID. Building block for `AuthFlowSelect`; for a custom data source use
5203
+ * `Select` with `useInfiniteOptions`.
5204
+ */
5205
+ const BaseAuthFlowSelect = (0, vue.defineComponent)({
5206
+ name: "BaseAuthFlowSelect",
5207
+ props: {
5208
+ ...commonSelectProps,
5209
+ fetchAuthFlows: {
5210
+ default: void 0,
5211
+ type: Function
5212
+ }
5213
+ },
5214
+ emits: ["update:modelValue"],
5215
+ setup(props, { emit }) {
5216
+ return () => {
5217
+ const { fetchAuthFlows,...common } = props;
5218
+ return (0, vue.h)(ResourceSelect_default, {
5219
+ ...common,
5220
+ bemBlock: "auth-flow-select",
5221
+ defaults: AUTH_FLOW_DEFAULTS,
5222
+ fallbackMessages: {
5223
+ ariaLabel: "Select a login flow",
5224
+ empty: "No login flows found."
5225
+ },
5226
+ fetchPage: fetchAuthFlows,
5227
+ messageKey: "auth_flow_select",
5228
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value),
5229
+ resource: "auth flows",
5230
+ type: __thunderid_browser.EmbeddedFlowComponentType.AuthFlowSelect
5231
+ });
5232
+ };
5233
+ }
5234
+ });
5235
+ var BaseAuthFlowSelect_default = BaseAuthFlowSelect;
5236
+
5237
+ //#endregion
5238
+ //#region src/components/primitives/AuthFlowSelect/AuthFlowSelect.ts
5239
+ /**
5240
+ * Authentication-flow picker for signed-in screens. It loads the authentication flows itself with the
5241
+ * signed-in user's access token and submits the chosen flow's ID, so it takes no data source. For any
5242
+ * other data source use `Select` with `useInfiniteOptions`.
5243
+ */
5244
+ const AuthFlowSelect = (0, vue.defineComponent)({
5245
+ name: "AuthFlowSelect",
5246
+ props: { ...commonSelectProps },
5247
+ emits: ["update:modelValue"],
5248
+ setup(props, { emit }) {
5249
+ const fetchAuthFlows = useFetchAuthFlows_default();
5250
+ return () => (0, vue.h)(BaseAuthFlowSelect_default, {
5251
+ ...props,
5252
+ fetchAuthFlows,
5253
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value)
5254
+ });
5255
+ }
5256
+ });
5257
+ var AuthFlowSelect_default = AuthFlowSelect;
5258
+
5259
+ //#endregion
5260
+ //#region src/components/primitives/UserTypeSelect/BaseUserTypeSelect.ts
5261
+ /**
5262
+ * User-type picker: a `Select` that loads from the given `fetchUserTypes`, showing and submitting each
5263
+ * user type's handle. Building block for `UserTypeSelect`; for a custom data source use `Select` with
5264
+ * `useInfiniteOptions`.
5265
+ */
5266
+ const BaseUserTypeSelect = (0, vue.defineComponent)({
5267
+ name: "BaseUserTypeSelect",
5268
+ props: {
5269
+ ...commonSelectProps,
5270
+ fetchUserTypes: {
5271
+ default: void 0,
5272
+ type: Function
5273
+ }
5274
+ },
5275
+ emits: ["update:modelValue"],
5276
+ setup(props, { emit }) {
5277
+ return () => {
5278
+ const { fetchUserTypes,...common } = props;
5279
+ return (0, vue.h)(ResourceSelect_default, {
5280
+ ...common,
5281
+ bemBlock: "user-type-select",
5282
+ fallbackMessages: {
5283
+ ariaLabel: "Select a user type",
5284
+ empty: "No user types found."
5285
+ },
5286
+ fetchPage: fetchUserTypes,
5287
+ mapping: __thunderid_browser.UserTypeSelectConstants.MAPPING,
5288
+ messageKey: "user_type_select",
5289
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value),
5290
+ resource: "user types",
5291
+ type: __thunderid_browser.EmbeddedFlowComponentType.UserTypeSelect
5292
+ });
5293
+ };
5294
+ }
5295
+ });
5296
+ var BaseUserTypeSelect_default = BaseUserTypeSelect;
5297
+
5298
+ //#endregion
5299
+ //#region src/components/primitives/UserTypeSelect/UserTypeSelect.ts
5300
+ /**
5301
+ * User-type picker for signed-in screens. It loads the user types itself with the signed-in user's
5302
+ * access token and submits the chosen type's handle, so it takes no data source. For any other data
5303
+ * source use `Select` with `useInfiniteOptions`.
5304
+ */
5305
+ const UserTypeSelect = (0, vue.defineComponent)({
5306
+ name: "UserTypeSelect",
5307
+ props: { ...commonSelectProps },
5308
+ emits: ["update:modelValue"],
5309
+ setup(props, { emit }) {
5310
+ const fetchUserTypes = useFetchUserTypes_default();
5311
+ return () => (0, vue.h)(BaseUserTypeSelect_default, {
5312
+ ...props,
5313
+ fetchUserTypes,
5314
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value)
5315
+ });
5316
+ }
5317
+ });
5318
+ var UserTypeSelect_default = UserTypeSelect;
5319
+
4591
5320
  //#endregion
4592
5321
  //#region src/components/primitives/Checkbox/Checkbox.ts
4593
5322
  const Checkbox = (0, vue.defineComponent)({
@@ -4896,6 +5625,71 @@ const Divider = (0, vue.defineComponent)({
4896
5625
  });
4897
5626
  var Divider_default = Divider;
4898
5627
 
5628
+ //#endregion
5629
+ //#region src/components/primitives/CopyableText/CopyableText.ts
5630
+ /**
5631
+ * Shows a text value with an optional label and a button that copies it to the clipboard. It uses the Clipboard
5632
+ * API and falls back to a textarea when that is not available, then shows "Copied!" for 3 seconds. With `masked`
5633
+ * the value sits in a read-only password field with the same show and hide control as `PasswordField`, and copying
5634
+ * always copies the real value. The copy control is an icon button inside the box in both layouts. A browser does
5635
+ * not copy out of a password field, which is why copying is a button of its own. Vue counterpart of the React
5636
+ * `CopyableText`.
5637
+ */
5638
+ const CopyableText = (0, vue.defineComponent)({
5639
+ name: "CopyableText",
5640
+ props: {
5641
+ label: {
5642
+ default: "",
5643
+ type: String
5644
+ },
5645
+ masked: {
5646
+ default: false,
5647
+ type: Boolean
5648
+ },
5649
+ value: {
5650
+ required: true,
5651
+ type: String
5652
+ }
5653
+ },
5654
+ setup(props, { attrs }) {
5655
+ const { t } = useI18n_default();
5656
+ const copied = (0, vue.ref)(false);
5657
+ const handleCopy = async () => {
5658
+ await (0, __thunderid_browser.copyTextToClipboard)(props.value);
5659
+ copied.value = true;
5660
+ setTimeout(() => {
5661
+ copied.value = false;
5662
+ }, 3e3);
5663
+ };
5664
+ return () => {
5665
+ const rootClass = [(0, __thunderid_browser.withVendorCSSClassPrefix)("copyable-text"), attrs.class || ""].filter(Boolean).join(" ");
5666
+ const copyLabel = copied.value ? t("elements.display.copyable_text.copied") : t("elements.display.copyable_text.copy");
5667
+ const copyButton = (0, vue.h)(Button_default, {
5668
+ "aria-label": copyLabel,
5669
+ class: (0, __thunderid_browser.withVendorCSSClassPrefix)("copyable-text__copy"),
5670
+ onClick: () => {
5671
+ handleCopy().catch(() => void 0);
5672
+ },
5673
+ size: "small",
5674
+ title: copyLabel,
5675
+ variant: "ghost"
5676
+ }, () => copied.value ? CheckIcon() : CopyIcon());
5677
+ return (0, vue.h)("div", {
5678
+ class: rootClass,
5679
+ style: attrs.style
5680
+ }, [props.label ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("copyable-text__label") }, props.label) : null, props.masked ? (0, vue.h)(PasswordField_default, {
5681
+ ariaLabel: props.label || void 0,
5682
+ autocomplete: "off",
5683
+ hideLabel: t("elements.display.copyable_text.hide"),
5684
+ modelValue: props.value,
5685
+ readonly: true,
5686
+ showLabel: t("elements.display.copyable_text.show")
5687
+ }, { append: () => copyButton }) : (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("copyable-text__box") }, [(0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("copyable-text__value") }, props.value), copyButton])]);
5688
+ };
5689
+ }
5690
+ });
5691
+ var CopyableText_default = CopyableText;
5692
+
4899
5693
  //#endregion
4900
5694
  //#region src/components/primitives/Logo/Logo.ts
4901
5695
  const Logo = (0, vue.defineComponent)({
@@ -6290,6 +7084,28 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
6290
7084
  t: options.t || ((k) => k)
6291
7085
  });
6292
7086
  };
7087
+ const resourceSelectProps = () => {
7088
+ const identifier = component.ref ?? "";
7089
+ const isTouched = touchedFields[identifier] || false;
7090
+ return {
7091
+ class: options.inputClassName,
7092
+ component,
7093
+ error: isTouched ? formErrors[identifier] : void 0,
7094
+ key,
7095
+ label: resolve(component.label) || "",
7096
+ modelValue: formValues[identifier] || "",
7097
+ name: identifier,
7098
+ onBlur: () => options.onInputBlur?.(identifier),
7099
+ onError: options.onPickerError,
7100
+ "onUpdate:modelValue": (val) => onInputChange(identifier, val),
7101
+ placeholder: resolve(component.placeholder),
7102
+ required: component.required
7103
+ };
7104
+ };
7105
+ const skipUnsupported = (typeName) => {
7106
+ logger$2.warn(`Unsupported component type: ${typeName}. Skipping render.`);
7107
+ return null;
7108
+ };
6293
7109
  switch (component.type) {
6294
7110
  case __thunderid_browser.EmbeddedFlowComponentType.TextInput:
6295
7111
  case __thunderid_browser.EmbeddedFlowComponentType.PasswordInput:
@@ -6471,6 +7287,18 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
6471
7287
  required: component.required
6472
7288
  });
6473
7289
  }
7290
+ case __thunderid_browser.EmbeddedFlowComponentType.UserSelect: return options.fetchUsers ? (0, vue.h)(BaseUserSelect_default, {
7291
+ ...resourceSelectProps(),
7292
+ fetchUsers: options.fetchUsers
7293
+ }) : skipUnsupported("USER_SELECT");
7294
+ case __thunderid_browser.EmbeddedFlowComponentType.AuthFlowSelect: return options.fetchAuthFlows ? (0, vue.h)(BaseAuthFlowSelect_default, {
7295
+ ...resourceSelectProps(),
7296
+ fetchAuthFlows: options.fetchAuthFlows
7297
+ }) : skipUnsupported("AUTH_FLOW_SELECT");
7298
+ case __thunderid_browser.EmbeddedFlowComponentType.UserTypeSelect: return options.fetchUserTypes ? (0, vue.h)(BaseUserTypeSelect_default, {
7299
+ ...resourceSelectProps(),
7300
+ fetchUserTypes: options.fetchUserTypes
7301
+ }) : skipUnsupported("USER_TYPE_SELECT");
6474
7302
  case __thunderid_browser.EmbeddedFlowComponentType.Block:
6475
7303
  if (component.components && component.components.length > 0) {
6476
7304
  const blockChildren = component.components.map((childComponent, index) => createAuthComponentFromFlow(childComponent, formValues, touchedFields, formErrors, isLoading, isFormValid, resetForm, onInputChange, {
@@ -6577,6 +7405,16 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
6577
7405
  pairs
6578
7406
  });
6579
7407
  }
7408
+ case __thunderid_browser.EmbeddedFlowComponentType.CopyableText: {
7409
+ const sourceKey = component.source;
7410
+ const value = sourceKey && options.additionalData ? String(options.additionalData[sourceKey] ?? "") : "";
7411
+ return (0, vue.h)(CopyableText_default, {
7412
+ key,
7413
+ label: resolve(component.label),
7414
+ masked: Boolean(component.masked),
7415
+ value
7416
+ });
7417
+ }
6580
7418
  default:
6581
7419
  logger$2.warn(`Unsupported component type: ${component.type}. Skipping render.`);
6582
7420
  return null;
@@ -9849,7 +10687,7 @@ const BaseAcceptInvite = (0, vue.defineComponent)({
9849
10687
  const errors = {};
9850
10688
  const validateComponents = (comps) => {
9851
10689
  comps.forEach((comp) => {
9852
- if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT") && comp.required && comp.ref) {
10690
+ if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
9853
10691
  const value = formValues.value[comp.ref] || "";
9854
10692
  if (!value || value.trim() === "") errors[comp.ref] = `${comp.label || comp.ref} is required`;
9855
10693
  }
@@ -10048,6 +10886,7 @@ const BaseAcceptInvite = (0, vue.defineComponent)({
10048
10886
  }, () => "Sign In")]) : null
10049
10887
  ])]);
10050
10888
  const renderedComponents = componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
10889
+ additionalData: currentFlow.value?.data?.additionalData ?? {},
10051
10890
  meta,
10052
10891
  onInputBlur: handleInputBlur,
10053
10892
  onSubmit: handleSubmit,
@@ -10205,6 +11044,18 @@ const BaseInviteUser = (0, vue.defineComponent)({
10205
11044
  default: "",
10206
11045
  type: String
10207
11046
  },
11047
+ fetchAuthFlows: {
11048
+ default: void 0,
11049
+ type: Function
11050
+ },
11051
+ fetchUsers: {
11052
+ default: void 0,
11053
+ type: Function
11054
+ },
11055
+ fetchUserTypes: {
11056
+ default: void 0,
11057
+ type: Function
11058
+ },
10208
11059
  isInitialized: {
10209
11060
  default: true,
10210
11061
  type: Boolean
@@ -10303,7 +11154,7 @@ const BaseInviteUser = (0, vue.defineComponent)({
10303
11154
  const errors = {};
10304
11155
  const validateComponents = (comps) => {
10305
11156
  comps.forEach((comp) => {
10306
- if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
11157
+ if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "USER_SELECT" || comp.type === "AUTH_FLOW_SELECT" || comp.type === "USER_TYPE_SELECT") && comp.required && comp.ref) {
10307
11158
  const value = formValues.value[comp.ref] || "";
10308
11159
  if (!value || value.trim() === "") errors[comp.ref] = `${comp.label || comp.ref} is required`;
10309
11160
  if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) errors[comp.ref] = "Please enter a valid email address";
@@ -10531,8 +11382,13 @@ const BaseInviteUser = (0, vue.defineComponent)({
10531
11382
  }, () => "Invite Another User")])
10532
11383
  ])]);
10533
11384
  const renderedComponents = componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
11385
+ additionalData: currentFlow.value?.data?.additionalData,
11386
+ fetchAuthFlows: props.fetchAuthFlows,
11387
+ fetchUsers: props.fetchUsers,
11388
+ fetchUserTypes: props.fetchUserTypes,
10534
11389
  meta,
10535
11390
  onInputBlur: handleInputBlur,
11391
+ onPickerError: props.onError,
10536
11392
  onSubmit: handleSubmit,
10537
11393
  size: props.size,
10538
11394
  t,
@@ -10603,6 +11459,9 @@ const InviteUser = (0, vue.defineComponent)({
10603
11459
  },
10604
11460
  setup(props, { slots }) {
10605
11461
  const { http: http$1, baseUrl, isInitialized } = useThunderID_default();
11462
+ const fetchAuthFlows = useFetchAuthFlows_default();
11463
+ const fetchUsers = useFetchUsers_default();
11464
+ const fetchUserTypes = useFetchUserTypes_default();
10606
11465
  const handleInitialize = async (payload) => {
10607
11466
  return (await http$1.request({
10608
11467
  data: {
@@ -10634,6 +11493,9 @@ const InviteUser = (0, vue.defineComponent)({
10634
11493
  };
10635
11494
  return () => (0, vue.h)(BaseInviteUser_default, {
10636
11495
  className: props.className,
11496
+ fetchAuthFlows,
11497
+ fetchUsers,
11498
+ fetchUserTypes,
10637
11499
  isInitialized: isInitialized?.value ?? false,
10638
11500
  onError: props.onError,
10639
11501
  onFlowChange: props.onFlowChange,
@@ -10920,7 +11782,9 @@ const createCallbackRoute = (options = {}) => {
10920
11782
  exports.AcceptInvite = AcceptInvite_default;
10921
11783
  exports.Alert = Alert_default;
10922
11784
  exports.ArrowLeftRightIcon = ArrowLeftRightIcon;
11785
+ exports.AuthFlowSelect = AuthFlowSelect_default;
10923
11786
  exports.BaseAcceptInvite = BaseAcceptInvite_default;
11787
+ exports.BaseAuthFlowSelect = BaseAuthFlowSelect_default;
10924
11788
  exports.BaseChangeCredential = BaseChangeCredential_default;
10925
11789
  exports.BaseInviteUser = BaseInviteUser_default;
10926
11790
  exports.BaseLanguageSwitcher = BaseLanguageSwitcher_default;
@@ -10931,6 +11795,8 @@ exports.BaseSignUp = BaseSignUp_default;
10931
11795
  exports.BaseSignUpButton = BaseSignUpButton_default;
10932
11796
  exports.BaseUserDropdown = BaseUserDropdown_default;
10933
11797
  exports.BaseUserProfile = BaseUserProfile_default;
11798
+ exports.BaseUserSelect = BaseUserSelect_default;
11799
+ exports.BaseUserTypeSelect = BaseUserTypeSelect_default;
10934
11800
  exports.BuildingIcon = BuildingIcon;
10935
11801
  exports.Button = Button_default;
10936
11802
  exports.Callback = Callback_default;
@@ -10941,6 +11807,7 @@ exports.Checkbox = Checkbox_default;
10941
11807
  exports.ChevronDownIcon = ChevronDownIcon;
10942
11808
  exports.CircleAlertIcon = CircleAlertIcon;
10943
11809
  exports.CircleCheckIcon = CircleCheckIcon;
11810
+ exports.CopyableText = CopyableText_default;
10944
11811
  exports.DatePicker = DatePicker_default;
10945
11812
  exports.Divider = Divider_default;
10946
11813
  Object.defineProperty(exports, 'EmbeddedFlowActionVariant', {
@@ -11052,6 +11919,8 @@ exports.UserDropdown = UserDropdown_default;
11052
11919
  exports.UserIcon = UserIcon;
11053
11920
  exports.UserProfile = UserProfile_default;
11054
11921
  exports.UserProvider = UserProvider_default;
11922
+ exports.UserSelect = UserSelect_default;
11923
+ exports.UserTypeSelect = UserTypeSelect_default;
11055
11924
  exports.XIcon = XIcon;
11056
11925
  exports.buildThemeConfigFromFlowMeta = buildThemeConfigFromFlowMeta_default;
11057
11926
  exports.createCallbackRoute = createCallbackRoute;
@@ -11118,9 +11987,13 @@ Object.defineProperty(exports, 'parseKeyValuePairs', {
11118
11987
  return __thunderid_browser.parseKeyValuePairs;
11119
11988
  }
11120
11989
  });
11990
+ exports.useFetchAuthFlows = useFetchAuthFlows_default;
11991
+ exports.useFetchUserTypes = useFetchUserTypes_default;
11992
+ exports.useFetchUsers = useFetchUsers_default;
11121
11993
  exports.useFlow = useFlow_default;
11122
11994
  exports.useFlowMeta = useFlowMeta_default;
11123
11995
  exports.useI18n = useI18n_default;
11996
+ exports.useInfiniteOptions = useInfiniteOptions_default;
11124
11997
  exports.useOAuthCallback = useOAuthCallback;
11125
11998
  exports.useTheme = useTheme_default;
11126
11999
  exports.useThunderID = useThunderID_default;