the-foxy-library 1.0.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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/dist/components/index.d.ts +33 -0
  4. package/dist/components/iv-accordion.d.ts +11 -0
  5. package/dist/components/iv-banner.d.ts +11 -0
  6. package/dist/components/iv-button.d.ts +11 -0
  7. package/dist/components/iv-card.d.ts +11 -0
  8. package/dist/components/iv-carousel.d.ts +11 -0
  9. package/dist/components/iv-dynamic-products-carousel.d.ts +11 -0
  10. package/dist/components/iv-dynamic-products.d.ts +11 -0
  11. package/dist/components/iv-filters.d.ts +11 -0
  12. package/dist/components/iv-layout.d.ts +11 -0
  13. package/dist/components/iv-link.d.ts +11 -0
  14. package/dist/components/iv-modal.d.ts +11 -0
  15. package/dist/components/iv-predictive-search.d.ts +11 -0
  16. package/dist/components/iv-recently-viewed.d.ts +11 -0
  17. package/dist/components/iv-sidebar.d.ts +11 -0
  18. package/dist/components/iv-spinner.d.ts +11 -0
  19. package/dist/components/iv-suggest.d.ts +11 -0
  20. package/dist/components/iv-tabs.d.ts +11 -0
  21. package/dist/components/iv-toast-container.d.ts +11 -0
  22. package/dist/components/iv-toast.d.ts +11 -0
  23. package/dist/components/iv-wishlist-view.d.ts +11 -0
  24. package/dist/components/iv-wishlist.d.ts +11 -0
  25. package/dist/components/sw-in-grid-content.d.ts +11 -0
  26. package/dist/components/sw-size-guide.d.ts +11 -0
  27. package/dist/intravenous/factory-1QinX-o0.js +275 -0
  28. package/dist/intravenous/factory-1QinX-o0.js.map +1 -0
  29. package/dist/intravenous/factory-JClanx-E.js +596 -0
  30. package/dist/intravenous/factory-JClanx-E.js.map +1 -0
  31. package/dist/intravenous/factory-mrqy6XUM.js +36 -0
  32. package/dist/intravenous/factory-mrqy6XUM.js.map +1 -0
  33. package/dist/intravenous/index-Py50VI8u.js +4761 -0
  34. package/dist/intravenous/index-Py50VI8u.js.map +1 -0
  35. package/dist/intravenous/index.esm.js +17 -0
  36. package/dist/intravenous/index.esm.js.map +1 -0
  37. package/dist/intravenous/intravenous.esm.js +48 -0
  38. package/dist/intravenous/intravenous.esm.js.map +1 -0
  39. package/dist/intravenous/iv-accordion.entry.esm.js.map +1 -0
  40. package/dist/intravenous/iv-accordion.entry.js +35 -0
  41. package/dist/intravenous/iv-banner.entry.esm.js.map +1 -0
  42. package/dist/intravenous/iv-banner.entry.js +28 -0
  43. package/dist/intravenous/iv-button.entry.esm.js.map +1 -0
  44. package/dist/intravenous/iv-button.entry.js +40 -0
  45. package/dist/intravenous/iv-card.entry.esm.js.map +1 -0
  46. package/dist/intravenous/iv-card.entry.js +82 -0
  47. package/dist/intravenous/iv-carousel.entry.esm.js.map +1 -0
  48. package/dist/intravenous/iv-carousel.entry.js +16 -0
  49. package/dist/intravenous/iv-dynamic-products-carousel.entry.esm.js.map +1 -0
  50. package/dist/intravenous/iv-dynamic-products-carousel.entry.js +114 -0
  51. package/dist/intravenous/iv-dynamic-products.entry.esm.js.map +1 -0
  52. package/dist/intravenous/iv-dynamic-products.entry.js +97 -0
  53. package/dist/intravenous/iv-filters.entry.esm.js.map +1 -0
  54. package/dist/intravenous/iv-filters.entry.js +19 -0
  55. package/dist/intravenous/iv-layout.entry.esm.js.map +1 -0
  56. package/dist/intravenous/iv-layout.entry.js +60 -0
  57. package/dist/intravenous/iv-link.entry.esm.js.map +1 -0
  58. package/dist/intravenous/iv-link.entry.js +25 -0
  59. package/dist/intravenous/iv-modal.entry.esm.js.map +1 -0
  60. package/dist/intravenous/iv-modal.entry.js +19 -0
  61. package/dist/intravenous/iv-predictive-search.entry.esm.js.map +1 -0
  62. package/dist/intravenous/iv-predictive-search.entry.js +311 -0
  63. package/dist/intravenous/iv-recently-viewed.entry.esm.js.map +1 -0
  64. package/dist/intravenous/iv-recently-viewed.entry.js +101 -0
  65. package/dist/intravenous/iv-sidebar.entry.esm.js.map +1 -0
  66. package/dist/intravenous/iv-sidebar.entry.js +24 -0
  67. package/dist/intravenous/iv-spinner.entry.esm.js.map +1 -0
  68. package/dist/intravenous/iv-spinner.entry.js +19 -0
  69. package/dist/intravenous/iv-suggest.entry.esm.js.map +1 -0
  70. package/dist/intravenous/iv-suggest.entry.js +72 -0
  71. package/dist/intravenous/iv-tabs.entry.esm.js.map +1 -0
  72. package/dist/intravenous/iv-tabs.entry.js +22 -0
  73. package/dist/intravenous/iv-toast-container.entry.esm.js.map +1 -0
  74. package/dist/intravenous/iv-toast-container.entry.js +44 -0
  75. package/dist/intravenous/iv-toast.entry.esm.js.map +1 -0
  76. package/dist/intravenous/iv-toast.entry.js +23 -0
  77. package/dist/intravenous/iv-wishlist-view.entry.esm.js.map +1 -0
  78. package/dist/intravenous/iv-wishlist-view.entry.js +21 -0
  79. package/dist/intravenous/iv-wishlist.entry.esm.js.map +1 -0
  80. package/dist/intravenous/iv-wishlist.entry.js +73 -0
  81. package/dist/intravenous/loader.esm.js.map +1 -0
  82. package/dist/intravenous/sw-in-grid-content.entry.esm.js.map +1 -0
  83. package/dist/intravenous/sw-in-grid-content.entry.js +18 -0
  84. package/dist/intravenous/sw-size-guide.entry.esm.js.map +1 -0
  85. package/dist/intravenous/sw-size-guide.entry.js +111 -0
  86. package/dist/types/components/iv-accordion/iv-accordion.d.ts +12 -0
  87. package/dist/types/components/iv-banner/iv-banner.d.ts +7 -0
  88. package/dist/types/components/iv-button/iv-button.d.ts +12 -0
  89. package/dist/types/components/iv-card/iv-card.d.ts +15 -0
  90. package/dist/types/components/iv-carousel/iv-carousel.d.ts +3 -0
  91. package/dist/types/components/iv-dynamic-products/iv-dynamic-products.d.ts +26 -0
  92. package/dist/types/components/iv-dynamic-products-carousel/iv-dynamic-products-carousel.d.ts +29 -0
  93. package/dist/types/components/iv-filters/iv-filters.d.ts +3 -0
  94. package/dist/types/components/iv-layout/iv-layout.d.ts +12 -0
  95. package/dist/types/components/iv-link/iv-link.d.ts +9 -0
  96. package/dist/types/components/iv-modal/iv-modal.d.ts +3 -0
  97. package/dist/types/components/iv-predictive-search/iv-predictive-search.d.ts +44 -0
  98. package/dist/types/components/iv-recently-viewed/iv-recently-viewed.d.ts +17 -0
  99. package/dist/types/components/iv-sidebar/iv-sidebar.d.ts +5 -0
  100. package/dist/types/components/iv-spinner/iv-spinner.d.ts +4 -0
  101. package/dist/types/components/iv-suggest/iv-suggest.d.ts +21 -0
  102. package/dist/types/components/iv-tabs/iv-tabs.d.ts +7 -0
  103. package/dist/types/components/iv-toast/iv-toast.d.ts +7 -0
  104. package/dist/types/components/iv-toast-container/iv-toast-container.d.ts +8 -0
  105. package/dist/types/components/iv-wishlist/iv-wishlist.d.ts +16 -0
  106. package/dist/types/components/iv-wishlist-view/iv-wishlist-view.d.ts +3 -0
  107. package/dist/types/components/sw-in-grid-content/sw-in-grid-content.d.ts +3 -0
  108. package/dist/types/components/sw-size-guide/sw-size-guide.d.ts +14 -0
  109. package/dist/types/components.d.ts +943 -0
  110. package/dist/types/global/app.d.ts +1 -0
  111. package/dist/types/index.d.ts +11 -0
  112. package/dist/types/stencil-public-runtime.d.ts +1746 -0
  113. package/dist/types/utils/caching/factory.d.ts +72 -0
  114. package/dist/types/utils/config/factory.d.ts +2 -0
  115. package/dist/types/utils/error_handling/factory.d.ts +58 -0
  116. package/dist/types/utils/helpers/factory.d.ts +6 -0
  117. package/dist/types/utils/store/store.d.ts +21 -0
  118. package/dist/types/utils/storefront_api/factory.d.ts +22 -0
  119. package/dist/types/utils/utils.d.ts +1 -0
  120. package/loader/cdn.js +1 -0
  121. package/loader/index.cjs.js +1 -0
  122. package/loader/index.d.ts +24 -0
  123. package/loader/index.es2017.js +1 -0
  124. package/loader/index.js +2 -0
  125. package/package.json +54 -0
@@ -0,0 +1,72 @@
1
+ export interface CacheStored<T = any> {
2
+ v: string;
3
+ ts: number;
4
+ ttl: number;
5
+ t: 'data' | 'markup';
6
+ data: T;
7
+ meta?: Record<string, any>;
8
+ }
9
+ export interface CacheGetResult<T = any> {
10
+ data?: T;
11
+ meta?: Record<string, any>;
12
+ isExpired: boolean;
13
+ isStale: boolean;
14
+ ageMs: number;
15
+ raw?: CacheStored<T>;
16
+ }
17
+ export interface CacheEventDetail {
18
+ action: 'hit' | 'miss' | 'stale' | 'set' | 'purge' | 'error' | 'evict';
19
+ key: string;
20
+ namespace: string;
21
+ info?: any;
22
+ }
23
+ interface CreateCacheOptions {
24
+ namespace: string;
25
+ version?: string;
26
+ storage?: 'local' | 'session' | 'memory';
27
+ prefix?: string;
28
+ defaultTTL?: number;
29
+ staleTTL?: number;
30
+ maxEntries?: number;
31
+ maxValueBytes?: number;
32
+ serialize?: (v: any) => string;
33
+ deserialize?: (s: string) => any;
34
+ dispatchEvents?: boolean;
35
+ target?: HTMLElement | Window;
36
+ }
37
+ interface GetOrSetOptions<T = any> {
38
+ ttl?: number;
39
+ meta?: Record<string, any>;
40
+ staleWhileRevalidate?: boolean;
41
+ type?: 'data' | 'markup';
42
+ transform?: (fresh: any) => T;
43
+ }
44
+ export declare function createCache(options: CreateCacheOptions): {
45
+ buildKey: (type: "data" | "markup", params: Record<string, any>) => string;
46
+ get: <T>(key: string) => CacheGetResult<T>;
47
+ set: <T>(key: string, type: "data" | "markup", data: T, cfg?: {
48
+ ttl?: number;
49
+ meta?: Record<string, any>;
50
+ }) => void;
51
+ getOrSet: <T>(key: string, type: "data" | "markup", fetcher: () => Promise<T>, opts?: GetOrSetOptions<T>) => Promise<T>;
52
+ refresh: <T>(key: string, type: "data" | "markup", fetcher: () => Promise<T>, opts?: GetOrSetOptions<T>) => Promise<T>;
53
+ purge: (key: string) => void;
54
+ purgePattern: (pattern: RegExp | ((k: string) => boolean)) => void;
55
+ clearNamespace: () => void;
56
+ inflight: Map<string, Promise<any>>;
57
+ keyForData: (params: Record<string, any>) => string;
58
+ getData: <T>(params: Record<string, any>) => CacheGetResult<T>;
59
+ setData: <T>(params: Record<string, any>, data: T, cfg?: {
60
+ ttl?: number;
61
+ meta?: Record<string, any>;
62
+ }) => void;
63
+ getOrSetData: <T>(params: Record<string, any>, fetcher: () => Promise<T>, opts?: GetOrSetOptions<T>) => Promise<T>;
64
+ keyForMarkup: (params: Record<string, any>) => string;
65
+ getMarkup: (params: Record<string, any>) => CacheGetResult<string>;
66
+ setMarkup: (params: Record<string, any>, html: string, cfg?: {
67
+ ttl?: number;
68
+ meta?: Record<string, any>;
69
+ }) => void;
70
+ getOrSetMarkup: (params: Record<string, any>, producer: () => Promise<string>, opts?: GetOrSetOptions<string>) => Promise<string>;
71
+ };
72
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function apiSetup(): void;
2
+ export declare function fetchShopifyCurrencyCode(): Promise<string>;
@@ -0,0 +1,58 @@
1
+ export type errorSeverity = 'debug' | 'info' | 'warn' | 'error' | 'critical';
2
+ export interface NormalizedError {
3
+ id: string;
4
+ ts: number;
5
+ component?: string;
6
+ scope: string;
7
+ severity: errorSeverity;
8
+ userSafe: boolean;
9
+ userMessage?: string;
10
+ devMessage?: string;
11
+ raw?: any;
12
+ meta?: Record<string, any>;
13
+ deduped?: boolean;
14
+ stack?: string;
15
+ }
16
+ interface TelemetryConfig {
17
+ record: (n: NormalizedError) => void | Promise<void>;
18
+ sampleRate?: number;
19
+ filter?: (n: NormalizedError) => boolean;
20
+ enrich?: (n: NormalizedError) => Partial<NormalizedError>;
21
+ }
22
+ interface CreateHandlerConfig {
23
+ component?: string;
24
+ toast?: (opts: {
25
+ message: string;
26
+ variant?: string;
27
+ }) => void;
28
+ toastDuration?: number;
29
+ emitEvents?: boolean;
30
+ target?: HTMLElement | Window;
31
+ classifier?: (ctx: {
32
+ error: any;
33
+ scope: string;
34
+ }) => Partial<{
35
+ userSafe: boolean;
36
+ severity: errorSeverity;
37
+ userMessage: string;
38
+ }>;
39
+ dedupeMs?: number;
40
+ defaultUserMessage?: string;
41
+ maxConsoleStack?: number;
42
+ telemetry?: TelemetryConfig;
43
+ _sharedRecent?: Map<string, number>;
44
+ }
45
+ interface HandleOptions {
46
+ error: any;
47
+ scope: string;
48
+ userMessage?: string;
49
+ devMessage?: string;
50
+ severity?: errorSeverity;
51
+ level?: errorSeverity;
52
+ emitEvent?: boolean;
53
+ meta?: Record<string, any>;
54
+ }
55
+ export declare function createErrorHandler(config?: CreateHandlerConfig): {
56
+ handle: (opts: HandleOptions) => NormalizedError;
57
+ };
58
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare function decodeJsonString(str: string): string;
2
+ export declare function requestedFields(fields: string): string[] | null;
3
+ export declare function formatMoney(amount: number, currencyCode?: string, locale?: string): string;
4
+ export declare function getCurrencySymbol(currencyCode?: string, locale?: string): string;
5
+ export declare function getProductIDFromGid(id: string): number;
6
+ export declare function getProductHandle(): string;
@@ -0,0 +1,21 @@
1
+ declare global {
2
+ interface Window {
3
+ __IV_STORE_STATE?: any;
4
+ __IV_STORE_INIT_COUNT?: number;
5
+ __IV_TOAST_ID?: number;
6
+ ivShowToast?: typeof showToast;
7
+ __IV_STORE_ONCHANGE?: any;
8
+ }
9
+ }
10
+ export interface ToastItem {
11
+ id: number;
12
+ message: string;
13
+ type: 'info' | 'success' | 'warning' | 'error';
14
+ duration: number;
15
+ }
16
+ export declare const state: any;
17
+ export declare const onStoreChange: any;
18
+ export declare function showToast(message: string, type?: 'info' | 'success' | 'warning' | 'error', duration?: number): void;
19
+ export declare function removeFromWishlist(id: number | string): void;
20
+ export declare function toggleModal(content?: string): void;
21
+ export declare function togglePullout(content?: string): void;
@@ -0,0 +1,22 @@
1
+ export declare function getIdFromHandle(handle: string): Promise<string | null>;
2
+ interface NormalizedProduct {
3
+ id: string;
4
+ handle?: string;
5
+ title?: string;
6
+ variantId?: string;
7
+ price?: string | null;
8
+ imageUrl?: string | null;
9
+ imageAlt?: string | null;
10
+ [key: string]: any;
11
+ }
12
+ export declare function fetchProducts(limit: number, collectionHandle: string, sortKey: string, fields: string[] | string, reversed?: boolean): Promise<any>;
13
+ export declare function fetchProductByID(id: string, fields: string[] | string, options?: {
14
+ variantId?: string;
15
+ }): Promise<NormalizedProduct | null>;
16
+ export declare function getVariantProduct(variantId: string, fields: string[] | string): Promise<NormalizedProduct | null>;
17
+ export declare function addToCart(options: {
18
+ id: number;
19
+ quantity?: number;
20
+ properties?: Record<string, any>;
21
+ }): Promise<any>;
22
+ export {};
@@ -0,0 +1 @@
1
+ export declare function format(first?: string, middle?: string, last?: string): string;
package/loader/cdn.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/cjs/loader.cjs.js');
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/cjs/loader.cjs.js');
@@ -0,0 +1,24 @@
1
+ export * from '../dist/types/components';
2
+ export interface CustomElementsDefineOptions {
3
+ exclude?: string[];
4
+ resourcesUrl?: string;
5
+ syncQueue?: boolean;
6
+ jmp?: (c: Function) => any;
7
+ raf?: (c: FrameRequestCallback) => number;
8
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
9
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
10
+ }
11
+ export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
12
+ /**
13
+ * @deprecated
14
+ */
15
+ export declare function applyPolyfills(): Promise<void>;
16
+
17
+ /**
18
+ * Used to specify a nonce value that corresponds with an application's CSP.
19
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
20
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
21
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
22
+ * will result in the same behavior.
23
+ */
24
+ export declare function setNonce(nonce: string): void;
@@ -0,0 +1 @@
1
+ export * from '../dist/esm/loader.js';
@@ -0,0 +1,2 @@
1
+ (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
2
+ export * from '../dist/esm/loader.js';
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "the-foxy-library",
3
+ "version": "1.0.0",
4
+ "description": "A ui library designed for Shopify themes.",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "collection": "dist/collection/collection-manifest.json",
9
+ "collection:main": "dist/collection/index.js",
10
+ "unpkg": "dist/spark-intravenous/spark-intravenous.esm.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/spark-intravenous/spark-intravenous.esm.js",
14
+ "require": "./dist/spark-intravenous/spark-intravenous.cjs.js"
15
+ },
16
+ "./my-component": {
17
+ "import": "./dist/components/my-component.js",
18
+ "types": "./dist/components/my-component.d.ts"
19
+ },
20
+ "./loader": {
21
+ "import": "./loader/index.js",
22
+ "require": "./loader/index.cjs",
23
+ "types": "./loader/index.d.ts"
24
+ }
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/stenciljs/component-starter.git"
29
+ },
30
+ "files": [
31
+ "dist/",
32
+ "loader/"
33
+ ],
34
+ "scripts": {
35
+ "build": "stencil build",
36
+ "start": "stencil build --dev --watch --serve",
37
+ "test": "stencil test --spec --e2e",
38
+ "test.watch": "stencil test --spec --e2e --watchAll",
39
+ "generate": "stencil generate"
40
+ },
41
+ "devDependencies": {
42
+ "@stencil/core": "^4.38.0",
43
+ "@stencil/sass": "^3.2.1",
44
+ "@types/jest": "^29.5.14",
45
+ "@types/node": "^22.13.5",
46
+ "jest": "^29.7.0",
47
+ "jest-cli": "^29.7.0",
48
+ "puppeteer": "^24.3.0"
49
+ },
50
+ "license": "MIT",
51
+ "dependencies": {
52
+ "@stencil/store": "^2.2.0"
53
+ }
54
+ }