@resee-movies/nuxt-ux 0.13.1 → 0.15.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 (39) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/Card.vue +23 -15
  3. package/dist/runtime/components/Card.vue.d.ts +8 -5
  4. package/dist/runtime/components/CardScroller.vue +189 -0
  5. package/dist/runtime/components/CardScroller.vue.d.ts +36 -0
  6. package/dist/runtime/components/GlobalHeader.vue +107 -0
  7. package/dist/runtime/components/GlobalHeader.vue.d.ts +15 -0
  8. package/dist/runtime/components/GlobalHeaderAnnouncement.vue +49 -0
  9. package/dist/runtime/components/GlobalHeaderAnnouncement.vue.d.ts +14 -0
  10. package/dist/runtime/components/Image.vue +70 -127
  11. package/dist/runtime/components/Image.vue.d.ts +4 -35
  12. package/dist/runtime/components/ImageBase.vue +114 -0
  13. package/dist/runtime/components/ImageBase.vue.d.ts +41 -0
  14. package/dist/runtime/components/LayoutPageRoot.vue +55 -0
  15. package/dist/runtime/components/LayoutPageRoot.vue.d.ts +21 -0
  16. package/dist/runtime/components/Message.vue +31 -11
  17. package/dist/runtime/components/Message.vue.d.ts +4 -3
  18. package/dist/runtime/components/NotificationContainer.vue +2 -2
  19. package/dist/runtime/components/ReseeWordLogo.vue +53 -0
  20. package/dist/runtime/components/ReseeWordLogo.vue.d.ts +12 -0
  21. package/dist/runtime/components/ScrollPinnedContainer.vue +33 -0
  22. package/dist/runtime/components/ScrollPinnedContainer.vue.d.ts +14 -0
  23. package/dist/runtime/components/SuccessSplash.vue +47 -0
  24. package/dist/runtime/components/SuccessSplash.vue.d.ts +6 -0
  25. package/dist/runtime/components/form/Form.vue +55 -21
  26. package/dist/runtime/components/form/Form.vue.d.ts +5 -0
  27. package/dist/runtime/composables/use-global-header-state.d.ts +10 -0
  28. package/dist/runtime/composables/use-global-header-state.js +20 -0
  29. package/dist/runtime/composables/use-load-image.d.ts +3 -0
  30. package/dist/runtime/composables/use-load-image.js +26 -44
  31. package/dist/runtime/composables/use-mutable-intersection-observer.d.ts +44 -0
  32. package/dist/runtime/composables/use-mutable-intersection-observer.js +68 -0
  33. package/dist/runtime/composables/use-resee-ux.d.ts +5 -0
  34. package/dist/runtime/composables/use-resee-ux.js +11 -1
  35. package/dist/runtime/composables/use-two-frame-ref-toggle.d.ts +25 -0
  36. package/dist/runtime/composables/use-two-frame-ref-toggle.js +24 -0
  37. package/dist/runtime/utils/validation.d.ts +2 -2
  38. package/dist/runtime/utils/validation.js +2 -2
  39. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import { type Ref } from 'vue';
2
+ /**
3
+ * Configuration for the {@link useTwoFrameRefToggle} composable.
4
+ *
5
+ * - `direction` (default: "one-way"): The order in which the refs will be updated,
6
+ * depending on whether they are being toggled true or false.
7
+ * - `"one-way"`: refA -> refB, always.
8
+ * - `"reverse"`: refA -> refB, if true. refB -> refA, if false.
9
+ * - `defaultValue` (default: false): The initial value to set the refs as.
10
+ */
11
+ type UseTwoFrameRefToggleOptions = {
12
+ direction?: 'one-way' | 'reverse';
13
+ defaultValue?: boolean;
14
+ };
15
+ /**
16
+ * Returns two boolean refs and an `update` method that accepts a boolean that the
17
+ * refs will be updated to. The setting of the ref values is staggered, with one
18
+ * happening one re-paint after the first.
19
+ *
20
+ * Why? This sort of one-two-step can be very useful in certain scenarios - like
21
+ * when CSS properties need to be applied in a specific order (e.x. initial state,
22
+ * and then some kind of transition).
23
+ */
24
+ export declare function useTwoFrameRefToggle(options?: UseTwoFrameRefToggleOptions): [refA: Ref<boolean>, refB: Ref<boolean>, updateMethod: (value: boolean) => void];
25
+ export {};
@@ -0,0 +1,24 @@
1
+ import { ref } from "vue";
2
+ export function useTwoFrameRefToggle(options) {
3
+ const refA = ref(options?.defaultValue ?? false);
4
+ const refB = ref(options?.defaultValue ?? false);
5
+ const update = (value) => {
6
+ if (refA.value === value) {
7
+ return;
8
+ }
9
+ const refOrder = !value && options?.direction === "reverse" ? [refB, refA] : [refA, refB];
10
+ refOrder[0].value = value;
11
+ let frameId;
12
+ if (frameId) {
13
+ cancelAnimationFrame(frameId);
14
+ frameId = void 0;
15
+ }
16
+ frameId = requestAnimationFrame(() => {
17
+ frameId = requestAnimationFrame(() => {
18
+ refOrder[1].value = value;
19
+ frameId = void 0;
20
+ });
21
+ });
22
+ };
23
+ return [refA, refB, update];
24
+ }
@@ -12,10 +12,10 @@ export type TextInputRequirements = {
12
12
  minLength?: string | number;
13
13
  maxLength?: string | number;
14
14
  };
15
- export declare function createTextValidator(requirements: TextInputRequirements): z.ZodMiniString<string> | z.ZodMiniUnion<readonly [z.ZodMiniNull, z.ZodMiniString<string>]>;
15
+ export declare function createTextValidator(requirements: TextInputRequirements): z.ZodMiniString<string> | z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniNull, z.ZodMiniString<string>]>;
16
16
  export type ListInputRequirements = {
17
17
  required?: boolean;
18
18
  minRequired?: string | number;
19
19
  maxRequired?: string | number;
20
20
  };
21
- export declare function createListValidator(requirements: ListInputRequirements): z.ZodMiniArray<z.ZodMiniUnknown> | z.ZodMiniUnion<readonly [z.ZodMiniNull, z.ZodMiniArray<z.ZodMiniUnknown>]>;
21
+ export declare function createListValidator(requirements: ListInputRequirements): z.ZodMiniArray<z.ZodMiniUnknown> | z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniNull, z.ZodMiniArray<z.ZodMiniUnknown>]>;
@@ -34,7 +34,7 @@ export function createTextValidator(requirements) {
34
34
  }
35
35
  }
36
36
  const stringSchema = z.string(toValidationError(locale.validation.required)).check(z.trim(), ...checkFns);
37
- return requirements.required ? stringSchema : z.union([z.null(), stringSchema]);
37
+ return requirements.required ? stringSchema : z.union([z.undefined(), z.null(), stringSchema]);
38
38
  }
39
39
  export function createListValidator(requirements) {
40
40
  const { locale } = useReseeUx();
@@ -52,5 +52,5 @@ export function createListValidator(requirements) {
52
52
  );
53
53
  }
54
54
  const arraySchema = z.array(z.unknown(), toValidationError(locale.validation.required)).check(...checkFns);
55
- return requirements.required ? arraySchema : z.union([z.null(), arraySchema]);
55
+ return requirements.required ? arraySchema : z.union([z.undefined(), z.null(), arraySchema]);
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resee-movies/nuxt-ux",
3
- "version": "0.13.1",
3
+ "version": "0.15.0",
4
4
  "description": "The next-gen user experience library for ReSee Movies - currently in development. ",
5
5
  "repository": {
6
6
  "url": "https://github.com/ReSee-Movies/nuxt-ux.git"