@vio-live/web-sdk 0.2.0 → 0.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.
@@ -1,4 +1,4 @@
1
- export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail } from '../vio-checkout-CrC5tvmh.js';
1
+ export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CvqQYURw.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
4
 
@@ -24,86 +24,6 @@ import 'lit';
24
24
  */
25
25
  declare function registerVioElements(): void;
26
26
 
27
- /**
28
- * Vio Design Tokens — editorial commerce aesthetic.
29
- *
30
- * Extracted from the Allermedia "Mote & Livsstil" reference (the target
31
- * pilot site). Mood: Vogue-like fashion magazine — serif headlines,
32
- * sans-serif body, near-monochrome palette, terracotta accent for
33
- * editorial labels ("REDAKSJONENS FAVORITTER").
34
- *
35
- * Tokens are exposed both as a typed TS object (`VioTokens`) and as
36
- * CSS custom properties on `:root` (auto-injected when this module is
37
- * imported in a browser). Consumers can override individual variables
38
- * to re-skin without touching SDK source.
39
- */
40
- declare const VioTokens: {
41
- readonly color: {
42
- readonly text: {
43
- readonly primary: "#0a0a0a";
44
- readonly secondary: "#666666";
45
- readonly tertiary: "#999999";
46
- readonly onPrimary: "#ffffff";
47
- };
48
- readonly accent: {
49
- readonly editorial: "#c14a3b";
50
- };
51
- readonly surface: {
52
- readonly base: "#ffffff";
53
- readonly muted: "#f2f2f2";
54
- readonly hover: "#fafafa";
55
- };
56
- readonly border: {
57
- readonly subtle: "#e5e5e5";
58
- readonly default: "#cccccc";
59
- };
60
- };
61
- readonly font: {
62
- readonly serif: "\"Tinos\", \"Playfair Display\", Georgia, serif";
63
- readonly sans: "\"Inter\", -apple-system, \"Helvetica Neue\", Arial, sans-serif";
64
- };
65
- readonly size: {
66
- readonly xs: "12px";
67
- readonly sm: "14px";
68
- readonly md: "16px";
69
- readonly lg: "20px";
70
- readonly xl: "24px";
71
- readonly '2xl': "32px";
72
- readonly '3xl': "40px";
73
- };
74
- readonly weight: {
75
- readonly regular: 400;
76
- readonly medium: 500;
77
- readonly semibold: 600;
78
- readonly bold: 700;
79
- };
80
- readonly tracking: {
81
- readonly label: "0.1em";
82
- readonly title: "0";
83
- };
84
- readonly lineHeight: {
85
- readonly tight: 1.1;
86
- readonly snug: 1.3;
87
- readonly normal: 1.5;
88
- };
89
- readonly space: {
90
- readonly xs: "4px";
91
- readonly sm: "8px";
92
- readonly md: "16px";
93
- readonly lg: "24px";
94
- readonly xl: "32px";
95
- readonly '2xl': "48px";
96
- readonly '3xl': "64px";
97
- };
98
- readonly radius: {
99
- readonly none: "0";
100
- readonly sm: "2px";
101
- readonly md: "4px";
102
- readonly lg: "8px";
103
- readonly full: "9999px";
104
- };
105
- };
106
-
107
27
  /**
108
28
  * Vio UI — Web Components + design tokens.
109
29
  *
@@ -118,6 +38,6 @@ declare const VioTokens: {
118
38
  * SSR-safe: every side-effect guards on `typeof document !== 'undefined'`.
119
39
  */
120
40
 
121
- declare const VIO_UI_VERSION = "0.2.0";
41
+ declare const VIO_UI_VERSION = "0.3.0";
122
42
 
123
- export { VIO_UI_VERSION, VioTokens, registerVioElements };
43
+ export { VIO_UI_VERSION, registerVioElements };
package/dist/ui/index.js CHANGED
@@ -1,138 +1,11 @@
1
- import { registerVioElements } from '../chunk-7JSSYPRN.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, registerVioElements } from '../chunk-7JSSYPRN.js';
3
- import '../chunk-SOO2G6CF.js';
4
-
5
- // src/ui/tokens.ts
6
- var VioTokens = {
7
- color: {
8
- text: {
9
- primary: "#0a0a0a",
10
- secondary: "#666666",
11
- tertiary: "#999999",
12
- onPrimary: "#ffffff"
13
- },
14
- accent: {
15
- editorial: "#c14a3b"
16
- // "REDAKSJONENS FAVORITTER" red
17
- },
18
- surface: {
19
- base: "#ffffff",
20
- muted: "#f2f2f2",
21
- // product image background
22
- hover: "#fafafa"
23
- },
24
- border: {
25
- subtle: "#e5e5e5",
26
- default: "#cccccc"
27
- }
28
- },
29
- font: {
30
- serif: '"Tinos", "Playfair Display", Georgia, serif',
31
- sans: '"Inter", -apple-system, "Helvetica Neue", Arial, sans-serif'
32
- },
33
- size: {
34
- xs: "12px",
35
- sm: "14px",
36
- md: "16px",
37
- lg: "20px",
38
- xl: "24px",
39
- "2xl": "32px",
40
- "3xl": "40px"
41
- },
42
- weight: {
43
- regular: 400,
44
- medium: 500,
45
- semibold: 600,
46
- bold: 700
47
- },
48
- tracking: {
49
- label: "0.1em",
50
- // uppercase labels (BRAND, RETAILER, REDAKSJONENS FAVORITTER)
51
- title: "0"
52
- },
53
- lineHeight: {
54
- tight: 1.1,
55
- snug: 1.3,
56
- normal: 1.5
57
- },
58
- space: {
59
- xs: "4px",
60
- sm: "8px",
61
- md: "16px",
62
- lg: "24px",
63
- xl: "32px",
64
- "2xl": "48px",
65
- "3xl": "64px"
66
- },
67
- radius: {
68
- none: "0",
69
- sm: "2px",
70
- md: "4px",
71
- lg: "8px",
72
- full: "9999px"
73
- }
74
- };
75
- var VIO_TOKENS_CSS = `
76
- :root {
77
- /* color \u2014 text */
78
- --vio-color-text: ${VioTokens.color.text.primary};
79
- --vio-color-text-secondary: ${VioTokens.color.text.secondary};
80
- --vio-color-text-tertiary: ${VioTokens.color.text.tertiary};
81
- --vio-color-text-on-primary:${VioTokens.color.text.onPrimary};
82
-
83
- /* color \u2014 accent */
84
- --vio-color-accent: ${VioTokens.color.accent.editorial};
85
-
86
- /* color \u2014 surface */
87
- --vio-color-surface: ${VioTokens.color.surface.base};
88
- --vio-color-surface-muted: ${VioTokens.color.surface.muted};
89
- --vio-color-surface-hover: ${VioTokens.color.surface.hover};
90
-
91
- /* color \u2014 border */
92
- --vio-color-border: ${VioTokens.color.border.subtle};
93
- --vio-color-border-default: ${VioTokens.color.border.default};
94
-
95
- /* font */
96
- --vio-font-serif: ${VioTokens.font.serif};
97
- --vio-font-sans: ${VioTokens.font.sans};
98
-
99
- /* size */
100
- --vio-size-xs: ${VioTokens.size.xs};
101
- --vio-size-sm: ${VioTokens.size.sm};
102
- --vio-size-md: ${VioTokens.size.md};
103
- --vio-size-lg: ${VioTokens.size.lg};
104
- --vio-size-xl: ${VioTokens.size.xl};
105
-
106
- /* tracking (uppercase letterspacing) */
107
- --vio-tracking-label: ${VioTokens.tracking.label};
108
-
109
- /* space */
110
- --vio-space-xs: ${VioTokens.space.xs};
111
- --vio-space-sm: ${VioTokens.space.sm};
112
- --vio-space-md: ${VioTokens.space.md};
113
- --vio-space-lg: ${VioTokens.space.lg};
114
- --vio-space-xl: ${VioTokens.space.xl};
115
-
116
- /* radius */
117
- --vio-radius-sm: ${VioTokens.radius.sm};
118
- --vio-radius-md: ${VioTokens.radius.md};
119
- --vio-radius-lg: ${VioTokens.radius.lg};
120
- }
121
- `;
122
- function injectTokens() {
123
- if (typeof document === "undefined") return;
124
- if (document.querySelector('style[data-vio="tokens"]') !== null) return;
125
- const style = document.createElement("style");
126
- style.setAttribute("data-vio", "tokens");
127
- style.textContent = VIO_TOKENS_CSS;
128
- document.head.appendChild(style);
129
- }
130
- injectTokens();
1
+ import { registerVioElements } from '../chunk-V5ZQG2H5.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-V5ZQG2H5.js';
3
+ import '../chunk-NP2KCM7X.js';
131
4
 
132
5
  // src/ui/index.ts
133
6
  registerVioElements();
134
- var VIO_UI_VERSION = "0.2.0";
7
+ var VIO_UI_VERSION = "0.3.0";
135
8
 
136
- export { VIO_UI_VERSION, VioTokens };
9
+ export { VIO_UI_VERSION };
137
10
  //# sourceMappingURL=index.js.map
138
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/tokens.ts","../../src/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\"Mote & Livsstil\" reference (the target\n * pilot site). Mood: Vogue-like fashion magazine — serif headlines,\n * sans-serif body, near-monochrome palette, terracotta accent for\n * editorial labels (\"REDAKSJONENS FAVORITTER\").\n *\n * Tokens are exposed both as a typed TS object (`VioTokens`) and as\n * CSS custom properties on `:root` (auto-injected when this module is\n * imported in a browser). Consumers can override individual variables\n * to re-skin without touching SDK source.\n */\n\nexport const VioTokens = {\n color: {\n text: {\n primary: '#0a0a0a',\n secondary: '#666666',\n tertiary: '#999999',\n onPrimary: '#ffffff',\n },\n accent: {\n editorial: '#c14a3b', // \"REDAKSJONENS FAVORITTER\" red\n },\n surface: {\n base: '#ffffff',\n muted: '#f2f2f2', // product image background\n hover: '#fafafa',\n },\n border: {\n subtle: '#e5e5e5',\n default: '#cccccc',\n },\n },\n font: {\n serif: '\"Tinos\", \"Playfair Display\", Georgia, serif',\n sans: '\"Inter\", -apple-system, \"Helvetica Neue\", Arial, sans-serif',\n },\n size: {\n xs: '12px',\n sm: '14px',\n md: '16px',\n lg: '20px',\n xl: '24px',\n '2xl': '32px',\n '3xl': '40px',\n },\n weight: {\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n tracking: {\n label: '0.1em', // uppercase labels (BRAND, RETAILER, REDAKSJONENS FAVORITTER)\n title: '0',\n },\n lineHeight: {\n tight: 1.1,\n snug: 1.3,\n normal: 1.5,\n },\n space: {\n xs: '4px',\n sm: '8px',\n md: '16px',\n lg: '24px',\n xl: '32px',\n '2xl': '48px',\n '3xl': '64px',\n },\n radius: {\n none: '0',\n sm: '2px',\n md: '4px',\n lg: '8px',\n full: '9999px',\n },\n} as const\n\n/**\n * CSS Custom Properties — generated from VioTokens. Injected once into\n * the document head on first import. Consumers can override any\n * `--vio-*` var on their root or component selector to customise.\n */\nconst VIO_TOKENS_CSS = `\n :root {\n /* color — text */\n --vio-color-text: ${VioTokens.color.text.primary};\n --vio-color-text-secondary: ${VioTokens.color.text.secondary};\n --vio-color-text-tertiary: ${VioTokens.color.text.tertiary};\n --vio-color-text-on-primary:${VioTokens.color.text.onPrimary};\n\n /* color — accent */\n --vio-color-accent: ${VioTokens.color.accent.editorial};\n\n /* color — surface */\n --vio-color-surface: ${VioTokens.color.surface.base};\n --vio-color-surface-muted: ${VioTokens.color.surface.muted};\n --vio-color-surface-hover: ${VioTokens.color.surface.hover};\n\n /* color — border */\n --vio-color-border: ${VioTokens.color.border.subtle};\n --vio-color-border-default: ${VioTokens.color.border.default};\n\n /* font */\n --vio-font-serif: ${VioTokens.font.serif};\n --vio-font-sans: ${VioTokens.font.sans};\n\n /* size */\n --vio-size-xs: ${VioTokens.size.xs};\n --vio-size-sm: ${VioTokens.size.sm};\n --vio-size-md: ${VioTokens.size.md};\n --vio-size-lg: ${VioTokens.size.lg};\n --vio-size-xl: ${VioTokens.size.xl};\n\n /* tracking (uppercase letterspacing) */\n --vio-tracking-label: ${VioTokens.tracking.label};\n\n /* space */\n --vio-space-xs: ${VioTokens.space.xs};\n --vio-space-sm: ${VioTokens.space.sm};\n --vio-space-md: ${VioTokens.space.md};\n --vio-space-lg: ${VioTokens.space.lg};\n --vio-space-xl: ${VioTokens.space.xl};\n\n /* radius */\n --vio-radius-sm: ${VioTokens.radius.sm};\n --vio-radius-md: ${VioTokens.radius.md};\n --vio-radius-lg: ${VioTokens.radius.lg};\n }\n`\n\nfunction injectTokens(): void {\n if (typeof document === 'undefined') return\n if (document.querySelector('style[data-vio=\"tokens\"]') !== null) return\n const style = document.createElement('style')\n style.setAttribute('data-vio', 'tokens')\n style.textContent = VIO_TOKENS_CSS\n document.head.appendChild(style)\n}\n\ninjectTokens()\n","/**\n * Vio UI — Web Components + design tokens.\n *\n * Importing this file (directly or via the main `vio` entry) has two\n * side-effects:\n * 1. Injects design tokens as CSS custom properties on `:root`\n * 2. Registers all `<vio-*>` custom elements (via `registerVioElements()`)\n *\n * Registration goes through an explicit function call (see ./elements) so it\n * survives tree-shaking while keeping `./core` tree-shakeable.\n *\n * SSR-safe: every side-effect guards on `typeof document !== 'undefined'`.\n */\n\nimport './tokens.js'\nimport { registerVioElements } from './elements.js'\n\n// Auto-register on import, so the conventional `import '@vio-live/web-sdk/ui'`\n// keeps working. This call is what pins the registration into this entry.\nregisterVioElements()\n\nexport { VioTokens } from './tokens.js'\nexport {\n registerVioElements,\n VioProduct,\n VioProductCarousel,\n VioProductDetail,\n VioCart,\n VioCheckout,\n} from './elements.js'\n\nexport const VIO_UI_VERSION = '0.2.0'\n"]}
1
+ {"version":3,"sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;;;AAmBA,mBAAA,EAAoB;AAYb,IAAM,cAAA,GAAiB","file":"index.js","sourcesContent":["/**\n * Vio UI — Web Components + design tokens.\n *\n * Importing this file (directly or via the main `vio` entry) has two\n * side-effects:\n * 1. Injects design tokens as CSS custom properties on `:root`\n * 2. Registers all `<vio-*>` custom elements (via `registerVioElements()`)\n *\n * Registration goes through an explicit function call (see ./elements) so it\n * survives tree-shaking while keeping `./core` tree-shakeable.\n *\n * SSR-safe: every side-effect guards on `typeof document !== 'undefined'`.\n */\n\nimport './tokens.js'\nimport { registerVioElements } from './elements.js'\n\n// Auto-register on import, so the conventional `import '@vio-live/web-sdk/ui'`\n// keeps working. This call is what pins the registration into this entry.\nregisterVioElements()\n\nexport { VioTokens, applyVioTheme, type VioThemeOverrides } from './tokens.js'\nexport {\n registerVioElements,\n VioProduct,\n VioProductCarousel,\n VioProductDetail,\n VioCart,\n VioCheckout,\n} from './elements.js'\n\nexport const VIO_UI_VERSION = '0.3.0'\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vio-live/web-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",