@pollinations/ui 0.0.2 → 0.1.0-alpha.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 (48) hide show
  1. package/README.md +10 -6
  2. package/dist/{Button-CWUBCiIc.d.cts → Button-BvLF_Km2.d.cts} +3 -3
  3. package/dist/{Button-Bn8pGg6N.d.ts → Button-DQAZzvyQ.d.ts} +3 -3
  4. package/dist/auth/index.cjs +77 -62
  5. package/dist/auth/index.cjs.map +1 -1
  6. package/dist/auth/index.js +77 -62
  7. package/dist/auth/index.js.map +1 -1
  8. package/dist/auth/sdk.cjs +7 -6
  9. package/dist/auth/sdk.cjs.map +1 -1
  10. package/dist/auth/sdk.d.cts +1 -1
  11. package/dist/auth/sdk.d.ts +1 -1
  12. package/dist/auth/sdk.js +7 -6
  13. package/dist/auth/sdk.js.map +1 -1
  14. package/dist/compositions/app-user.cjs +497 -0
  15. package/dist/compositions/app-user.cjs.map +1 -0
  16. package/dist/compositions/app-user.d.cts +18 -0
  17. package/dist/compositions/app-user.d.ts +18 -0
  18. package/dist/compositions/app-user.js +469 -0
  19. package/dist/compositions/app-user.js.map +1 -0
  20. package/dist/index.cjs +932 -270
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +101 -6
  23. package/dist/index.d.ts +101 -6
  24. package/dist/index.js +891 -247
  25. package/dist/index.js.map +1 -1
  26. package/dist/modality/index.cjs +21 -18
  27. package/dist/modality/index.cjs.map +1 -1
  28. package/dist/modality/index.d.cts +6 -5
  29. package/dist/modality/index.d.ts +6 -5
  30. package/dist/modality/index.js +21 -18
  31. package/dist/modality/index.js.map +1 -1
  32. package/dist/models/index.cjs +508 -0
  33. package/dist/models/index.cjs.map +1 -0
  34. package/dist/models/index.d.cts +22 -0
  35. package/dist/models/index.d.ts +22 -0
  36. package/dist/models/index.js +486 -0
  37. package/dist/models/index.js.map +1 -0
  38. package/dist/styles.css +1 -1
  39. package/dist/wallet/index.cjs +13 -4
  40. package/dist/wallet/index.cjs.map +1 -1
  41. package/dist/wallet/index.js +13 -4
  42. package/dist/wallet/index.js.map +1 -1
  43. package/dist/wallet/sdk.cjs +2 -2
  44. package/dist/wallet/sdk.cjs.map +1 -1
  45. package/dist/wallet/sdk.js +2 -2
  46. package/dist/wallet/sdk.js.map +1 -1
  47. package/package.json +17 -5
  48. package/dist/wallet.css +0 -73
@@ -25,42 +25,45 @@ __export(modality_exports, {
25
25
  module.exports = __toCommonJS(modality_exports);
26
26
 
27
27
  // src/modules/modality/colors.ts
28
+ var filled = "polli:bg-theme-bg-active polli:text-theme-text-strong";
29
+ var hover = "polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong";
30
+ var text = "polli:text-theme-text-strong";
28
31
  var MODALITY_COLORS = {
29
32
  text: {
30
33
  theme: "blue",
31
- filled: "polli:bg-blue-200 polli:text-blue-900",
32
- hover: "polli:hover:bg-blue-100 polli:hover:text-blue-900",
33
- text: "polli:text-blue-800"
34
+ filled,
35
+ hover,
36
+ text
34
37
  },
35
38
  image: {
36
39
  theme: "pink",
37
- filled: "polli:bg-pink-200 polli:text-pink-900",
38
- hover: "polli:hover:bg-pink-100 polli:hover:text-pink-900",
39
- text: "polli:text-pink-800"
40
+ filled,
41
+ hover,
42
+ text
40
43
  },
41
44
  video: {
42
45
  theme: "teal",
43
- filled: "polli:bg-teal-200 polli:text-teal-900",
44
- hover: "polli:hover:bg-teal-100 polli:hover:text-teal-900",
45
- text: "polli:text-teal-800"
46
+ filled,
47
+ hover,
48
+ text
46
49
  },
47
50
  audio: {
48
51
  theme: "violet",
49
- filled: "polli:bg-violet-200 polli:text-violet-900",
50
- hover: "polli:hover:bg-violet-100 polli:hover:text-violet-900",
51
- text: "polli:text-violet-800"
52
+ filled,
53
+ hover,
54
+ text
52
55
  },
53
56
  realtime: {
54
57
  theme: "green",
55
- filled: "polli:bg-green-200 polli:text-green-900",
56
- hover: "polli:hover:bg-green-100 polli:hover:text-green-900",
57
- text: "polli:text-green-800"
58
+ filled,
59
+ hover,
60
+ text
58
61
  },
59
62
  embedding: {
60
63
  theme: "amber",
61
- filled: "polli:bg-amber-200 polli:text-amber-900",
62
- hover: "polli:hover:bg-amber-100 polli:hover:text-amber-900",
63
- text: "polli:text-amber-800"
64
+ filled,
65
+ hover,
66
+ text
64
67
  }
65
68
  };
66
69
  function normalize(category) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/modality/index.ts","../../src/modules/modality/colors.ts"],"sourcesContent":["export {\n getModalityColors,\n type Modality,\n type ModalityColorSet,\n} from \"./colors.ts\";\n","/**\n * Single source of truth for modality colors.\n *\n * Each modality (text/image/video/audio/realtime/embedding) gets one\n * page-theme hue, applied at the soft `-200/-900/-400` chip recipe.\n * Used by apps to compose model-selection buttons and static modality chips.\n * This module only owns modality color data; primitives own shape and behavior.\n */\nimport type { ThemeName } from \"../../theme.ts\";\n\nexport type Modality =\n | \"text\"\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"realtime\"\n | \"embedding\";\n\nexport type ModalityColorSet = {\n /** Matching package theme for surfaces/chips that should inherit this hue. */\n theme: ThemeName;\n /** Selected/filled state: `bg + text + border` classes. */\n filled: string;\n /** Hover hint shown on the unselected button (subtle tint). */\n hover: string;\n /** Heading text colour for the category label. */\n text: string;\n};\n\n// No borders — chips and buttons in this system are borderless.\nexport const MODALITY_COLORS: Record<Modality, ModalityColorSet> = {\n text: {\n theme: \"blue\",\n filled: \"polli:bg-blue-200 polli:text-blue-900\",\n hover: \"polli:hover:bg-blue-100 polli:hover:text-blue-900\",\n text: \"polli:text-blue-800\",\n },\n image: {\n theme: \"pink\",\n filled: \"polli:bg-pink-200 polli:text-pink-900\",\n hover: \"polli:hover:bg-pink-100 polli:hover:text-pink-900\",\n text: \"polli:text-pink-800\",\n },\n video: {\n theme: \"teal\",\n filled: \"polli:bg-teal-200 polli:text-teal-900\",\n hover: \"polli:hover:bg-teal-100 polli:hover:text-teal-900\",\n text: \"polli:text-teal-800\",\n },\n audio: {\n theme: \"violet\",\n filled: \"polli:bg-violet-200 polli:text-violet-900\",\n hover: \"polli:hover:bg-violet-100 polli:hover:text-violet-900\",\n text: \"polli:text-violet-800\",\n },\n realtime: {\n theme: \"green\",\n filled: \"polli:bg-green-200 polli:text-green-900\",\n hover: \"polli:hover:bg-green-100 polli:hover:text-green-900\",\n text: \"polli:text-green-800\",\n },\n embedding: {\n theme: \"amber\",\n filled: \"polli:bg-amber-200 polli:text-amber-900\",\n hover: \"polli:hover:bg-amber-100 polli:hover:text-amber-900\",\n text: \"polli:text-amber-800\",\n },\n};\n\n/** Map any human-typed category string to the canonical `Modality` key. */\nfunction normalize(category: string): Modality | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n if (\n lower === \"text\" ||\n lower === \"image\" ||\n lower === \"video\" ||\n lower === \"audio\" ||\n lower === \"realtime\" ||\n lower === \"embedding\"\n ) {\n return lower;\n }\n return null;\n}\n\nexport function getModalityColors(category: string): ModalityColorSet | null {\n const key = normalize(category);\n return key ? MODALITY_COLORS[key] : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC8BO,IAAM,kBAAsD;AAAA,EAC/D,MAAM;AAAA,IACF,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,WAAW;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AACJ;AAGA,SAAS,UAAU,UAAmC;AAClD,QAAM,QAAQ,SAAS,YAAY;AACnC,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,aAAc,QAAO;AACnC,MACI,UAAU,UACV,UAAU,WACV,UAAU,WACV,UAAU,WACV,UAAU,cACV,UAAU,aACZ;AACE,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,kBAAkB,UAA2C;AACzE,QAAM,MAAM,UAAU,QAAQ;AAC9B,SAAO,MAAM,gBAAgB,GAAG,IAAI;AACxC;","names":[]}
1
+ {"version":3,"sources":["../../src/modules/modality/index.ts","../../src/modules/modality/colors.ts"],"sourcesContent":["export {\n getModalityColors,\n type Modality,\n type ModalityColorSet,\n} from \"./colors.ts\";\n","/**\n * Single source of truth for modality colors.\n *\n * Each modality (text/image/video/audio/realtime/embedding) maps to one\n * package theme. Class recipes are token-based, so callers should pass the\n * returned `theme` to the primitive or set `data-theme` on an ancestor.\n * Used by apps to compose model-selection buttons and static modality chips.\n * This module only owns modality color data; primitives own shape and behavior.\n */\nimport type { ThemeName } from \"../../theme.ts\";\n\nexport type Modality =\n | \"text\"\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"realtime\"\n | \"embedding\";\n\nexport type ModalityColorSet = {\n /** Matching package theme for surfaces/chips that should inherit this hue. */\n theme: ThemeName;\n /** Selected/filled state using the active theme tokens. */\n filled: string;\n /** Hover hint shown on the unselected button using the active theme. */\n hover: string;\n /** Heading text colour using the active theme. */\n text: string;\n};\n\nconst filled = \"polli:bg-theme-bg-active polli:text-theme-text-strong\";\nconst hover =\n \"polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong\";\nconst text = \"polli:text-theme-text-strong\";\n\n// No borders — chips and buttons in this system are borderless.\nexport const MODALITY_COLORS: Record<Modality, ModalityColorSet> = {\n text: {\n theme: \"blue\",\n filled,\n hover,\n text,\n },\n image: {\n theme: \"pink\",\n filled,\n hover,\n text,\n },\n video: {\n theme: \"teal\",\n filled,\n hover,\n text,\n },\n audio: {\n theme: \"violet\",\n filled,\n hover,\n text,\n },\n realtime: {\n theme: \"green\",\n filled,\n hover,\n text,\n },\n embedding: {\n theme: \"amber\",\n filled,\n hover,\n text,\n },\n};\n\n/** Map any human-typed category string to the canonical `Modality` key. */\nfunction normalize(category: string): Modality | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n if (\n lower === \"text\" ||\n lower === \"image\" ||\n lower === \"video\" ||\n lower === \"audio\" ||\n lower === \"realtime\" ||\n lower === \"embedding\"\n ) {\n return lower;\n }\n return null;\n}\n\nexport function getModalityColors(category: string): ModalityColorSet | null {\n const key = normalize(category);\n return key ? MODALITY_COLORS[key] : null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC8BA,IAAM,SAAS;AACf,IAAM,QACF;AACJ,IAAM,OAAO;AAGN,IAAM,kBAAsD;AAAA,EAC/D,MAAM;AAAA,IACF,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,WAAW;AAAA,IACP,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;AAGA,SAAS,UAAU,UAAmC;AAClD,QAAM,QAAQ,SAAS,YAAY;AACnC,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,aAAc,QAAO;AACnC,MACI,UAAU,UACV,UAAU,WACV,UAAU,WACV,UAAU,WACV,UAAU,cACV,UAAU,aACZ;AACE,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,kBAAkB,UAA2C;AACzE,QAAM,MAAM,UAAU,QAAQ;AAC9B,SAAO,MAAM,gBAAgB,GAAG,IAAI;AACxC;","names":[]}
@@ -3,8 +3,9 @@ import { T as ThemeName } from '../theme-VMRlhqST.cjs';
3
3
  /**
4
4
  * Single source of truth for modality colors.
5
5
  *
6
- * Each modality (text/image/video/audio/realtime/embedding) gets one
7
- * page-theme hue, applied at the soft `-200/-900/-400` chip recipe.
6
+ * Each modality (text/image/video/audio/realtime/embedding) maps to one
7
+ * package theme. Class recipes are token-based, so callers should pass the
8
+ * returned `theme` to the primitive or set `data-theme` on an ancestor.
8
9
  * Used by apps to compose model-selection buttons and static modality chips.
9
10
  * This module only owns modality color data; primitives own shape and behavior.
10
11
  */
@@ -13,11 +14,11 @@ type Modality = "text" | "image" | "video" | "audio" | "realtime" | "embedding";
13
14
  type ModalityColorSet = {
14
15
  /** Matching package theme for surfaces/chips that should inherit this hue. */
15
16
  theme: ThemeName;
16
- /** Selected/filled state: `bg + text + border` classes. */
17
+ /** Selected/filled state using the active theme tokens. */
17
18
  filled: string;
18
- /** Hover hint shown on the unselected button (subtle tint). */
19
+ /** Hover hint shown on the unselected button using the active theme. */
19
20
  hover: string;
20
- /** Heading text colour for the category label. */
21
+ /** Heading text colour using the active theme. */
21
22
  text: string;
22
23
  };
23
24
  declare function getModalityColors(category: string): ModalityColorSet | null;
@@ -3,8 +3,9 @@ import { T as ThemeName } from '../theme-VMRlhqST.js';
3
3
  /**
4
4
  * Single source of truth for modality colors.
5
5
  *
6
- * Each modality (text/image/video/audio/realtime/embedding) gets one
7
- * page-theme hue, applied at the soft `-200/-900/-400` chip recipe.
6
+ * Each modality (text/image/video/audio/realtime/embedding) maps to one
7
+ * package theme. Class recipes are token-based, so callers should pass the
8
+ * returned `theme` to the primitive or set `data-theme` on an ancestor.
8
9
  * Used by apps to compose model-selection buttons and static modality chips.
9
10
  * This module only owns modality color data; primitives own shape and behavior.
10
11
  */
@@ -13,11 +14,11 @@ type Modality = "text" | "image" | "video" | "audio" | "realtime" | "embedding";
13
14
  type ModalityColorSet = {
14
15
  /** Matching package theme for surfaces/chips that should inherit this hue. */
15
16
  theme: ThemeName;
16
- /** Selected/filled state: `bg + text + border` classes. */
17
+ /** Selected/filled state using the active theme tokens. */
17
18
  filled: string;
18
- /** Hover hint shown on the unselected button (subtle tint). */
19
+ /** Hover hint shown on the unselected button using the active theme. */
19
20
  hover: string;
20
- /** Heading text colour for the category label. */
21
+ /** Heading text colour using the active theme. */
21
22
  text: string;
22
23
  };
23
24
  declare function getModalityColors(category: string): ModalityColorSet | null;
@@ -1,40 +1,43 @@
1
1
  // src/modules/modality/colors.ts
2
+ var filled = "polli:bg-theme-bg-active polli:text-theme-text-strong";
3
+ var hover = "polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong";
4
+ var text = "polli:text-theme-text-strong";
2
5
  var MODALITY_COLORS = {
3
6
  text: {
4
7
  theme: "blue",
5
- filled: "polli:bg-blue-200 polli:text-blue-900",
6
- hover: "polli:hover:bg-blue-100 polli:hover:text-blue-900",
7
- text: "polli:text-blue-800"
8
+ filled,
9
+ hover,
10
+ text
8
11
  },
9
12
  image: {
10
13
  theme: "pink",
11
- filled: "polli:bg-pink-200 polli:text-pink-900",
12
- hover: "polli:hover:bg-pink-100 polli:hover:text-pink-900",
13
- text: "polli:text-pink-800"
14
+ filled,
15
+ hover,
16
+ text
14
17
  },
15
18
  video: {
16
19
  theme: "teal",
17
- filled: "polli:bg-teal-200 polli:text-teal-900",
18
- hover: "polli:hover:bg-teal-100 polli:hover:text-teal-900",
19
- text: "polli:text-teal-800"
20
+ filled,
21
+ hover,
22
+ text
20
23
  },
21
24
  audio: {
22
25
  theme: "violet",
23
- filled: "polli:bg-violet-200 polli:text-violet-900",
24
- hover: "polli:hover:bg-violet-100 polli:hover:text-violet-900",
25
- text: "polli:text-violet-800"
26
+ filled,
27
+ hover,
28
+ text
26
29
  },
27
30
  realtime: {
28
31
  theme: "green",
29
- filled: "polli:bg-green-200 polli:text-green-900",
30
- hover: "polli:hover:bg-green-100 polli:hover:text-green-900",
31
- text: "polli:text-green-800"
32
+ filled,
33
+ hover,
34
+ text
32
35
  },
33
36
  embedding: {
34
37
  theme: "amber",
35
- filled: "polli:bg-amber-200 polli:text-amber-900",
36
- hover: "polli:hover:bg-amber-100 polli:hover:text-amber-900",
37
- text: "polli:text-amber-800"
38
+ filled,
39
+ hover,
40
+ text
38
41
  }
39
42
  };
40
43
  function normalize(category) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/modality/colors.ts"],"sourcesContent":["/**\n * Single source of truth for modality colors.\n *\n * Each modality (text/image/video/audio/realtime/embedding) gets one\n * page-theme hue, applied at the soft `-200/-900/-400` chip recipe.\n * Used by apps to compose model-selection buttons and static modality chips.\n * This module only owns modality color data; primitives own shape and behavior.\n */\nimport type { ThemeName } from \"../../theme.ts\";\n\nexport type Modality =\n | \"text\"\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"realtime\"\n | \"embedding\";\n\nexport type ModalityColorSet = {\n /** Matching package theme for surfaces/chips that should inherit this hue. */\n theme: ThemeName;\n /** Selected/filled state: `bg + text + border` classes. */\n filled: string;\n /** Hover hint shown on the unselected button (subtle tint). */\n hover: string;\n /** Heading text colour for the category label. */\n text: string;\n};\n\n// No borders — chips and buttons in this system are borderless.\nexport const MODALITY_COLORS: Record<Modality, ModalityColorSet> = {\n text: {\n theme: \"blue\",\n filled: \"polli:bg-blue-200 polli:text-blue-900\",\n hover: \"polli:hover:bg-blue-100 polli:hover:text-blue-900\",\n text: \"polli:text-blue-800\",\n },\n image: {\n theme: \"pink\",\n filled: \"polli:bg-pink-200 polli:text-pink-900\",\n hover: \"polli:hover:bg-pink-100 polli:hover:text-pink-900\",\n text: \"polli:text-pink-800\",\n },\n video: {\n theme: \"teal\",\n filled: \"polli:bg-teal-200 polli:text-teal-900\",\n hover: \"polli:hover:bg-teal-100 polli:hover:text-teal-900\",\n text: \"polli:text-teal-800\",\n },\n audio: {\n theme: \"violet\",\n filled: \"polli:bg-violet-200 polli:text-violet-900\",\n hover: \"polli:hover:bg-violet-100 polli:hover:text-violet-900\",\n text: \"polli:text-violet-800\",\n },\n realtime: {\n theme: \"green\",\n filled: \"polli:bg-green-200 polli:text-green-900\",\n hover: \"polli:hover:bg-green-100 polli:hover:text-green-900\",\n text: \"polli:text-green-800\",\n },\n embedding: {\n theme: \"amber\",\n filled: \"polli:bg-amber-200 polli:text-amber-900\",\n hover: \"polli:hover:bg-amber-100 polli:hover:text-amber-900\",\n text: \"polli:text-amber-800\",\n },\n};\n\n/** Map any human-typed category string to the canonical `Modality` key. */\nfunction normalize(category: string): Modality | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n if (\n lower === \"text\" ||\n lower === \"image\" ||\n lower === \"video\" ||\n lower === \"audio\" ||\n lower === \"realtime\" ||\n lower === \"embedding\"\n ) {\n return lower;\n }\n return null;\n}\n\nexport function getModalityColors(category: string): ModalityColorSet | null {\n const key = normalize(category);\n return key ? MODALITY_COLORS[key] : null;\n}\n"],"mappings":";AA8BO,IAAM,kBAAsD;AAAA,EAC/D,MAAM;AAAA,IACF,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AAAA,EACA,WAAW;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,EACV;AACJ;AAGA,SAAS,UAAU,UAAmC;AAClD,QAAM,QAAQ,SAAS,YAAY;AACnC,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,aAAc,QAAO;AACnC,MACI,UAAU,UACV,UAAU,WACV,UAAU,WACV,UAAU,WACV,UAAU,cACV,UAAU,aACZ;AACE,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,kBAAkB,UAA2C;AACzE,QAAM,MAAM,UAAU,QAAQ;AAC9B,SAAO,MAAM,gBAAgB,GAAG,IAAI;AACxC;","names":[]}
1
+ {"version":3,"sources":["../../src/modules/modality/colors.ts"],"sourcesContent":["/**\n * Single source of truth for modality colors.\n *\n * Each modality (text/image/video/audio/realtime/embedding) maps to one\n * package theme. Class recipes are token-based, so callers should pass the\n * returned `theme` to the primitive or set `data-theme` on an ancestor.\n * Used by apps to compose model-selection buttons and static modality chips.\n * This module only owns modality color data; primitives own shape and behavior.\n */\nimport type { ThemeName } from \"../../theme.ts\";\n\nexport type Modality =\n | \"text\"\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"realtime\"\n | \"embedding\";\n\nexport type ModalityColorSet = {\n /** Matching package theme for surfaces/chips that should inherit this hue. */\n theme: ThemeName;\n /** Selected/filled state using the active theme tokens. */\n filled: string;\n /** Hover hint shown on the unselected button using the active theme. */\n hover: string;\n /** Heading text colour using the active theme. */\n text: string;\n};\n\nconst filled = \"polli:bg-theme-bg-active polli:text-theme-text-strong\";\nconst hover =\n \"polli:hover:bg-theme-bg-subtle polli:hover:text-theme-text-strong\";\nconst text = \"polli:text-theme-text-strong\";\n\n// No borders — chips and buttons in this system are borderless.\nexport const MODALITY_COLORS: Record<Modality, ModalityColorSet> = {\n text: {\n theme: \"blue\",\n filled,\n hover,\n text,\n },\n image: {\n theme: \"pink\",\n filled,\n hover,\n text,\n },\n video: {\n theme: \"teal\",\n filled,\n hover,\n text,\n },\n audio: {\n theme: \"violet\",\n filled,\n hover,\n text,\n },\n realtime: {\n theme: \"green\",\n filled,\n hover,\n text,\n },\n embedding: {\n theme: \"amber\",\n filled,\n hover,\n text,\n },\n};\n\n/** Map any human-typed category string to the canonical `Modality` key. */\nfunction normalize(category: string): Modality | null {\n const lower = category.toLowerCase();\n if (lower === \"images\") return \"image\";\n if (lower === \"embeddings\") return \"embedding\";\n if (\n lower === \"text\" ||\n lower === \"image\" ||\n lower === \"video\" ||\n lower === \"audio\" ||\n lower === \"realtime\" ||\n lower === \"embedding\"\n ) {\n return lower;\n }\n return null;\n}\n\nexport function getModalityColors(category: string): ModalityColorSet | null {\n const key = normalize(category);\n return key ? MODALITY_COLORS[key] : null;\n}\n"],"mappings":";AA8BA,IAAM,SAAS;AACf,IAAM,QACF;AACJ,IAAM,OAAO;AAGN,IAAM,kBAAsD;AAAA,EAC/D,MAAM;AAAA,IACF,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,OAAO;AAAA,IACH,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,UAAU;AAAA,IACN,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,WAAW;AAAA,IACP,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;AAGA,SAAS,UAAU,UAAmC;AAClD,QAAM,QAAQ,SAAS,YAAY;AACnC,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,aAAc,QAAO;AACnC,MACI,UAAU,UACV,UAAU,WACV,UAAU,WACV,UAAU,WACV,UAAU,cACV,UAAU,aACZ;AACE,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,kBAAkB,UAA2C;AACzE,QAAM,MAAM,UAAU,QAAQ;AAC9B,SAAO,MAAM,gBAAgB,GAAG,IAAI;AACxC;","names":[]}