@middag-io/react 0.33.0 → 0.35.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 (133) hide show
  1. package/README.md +28 -8
  2. package/dist-lib/base/shell/AuthShell.js +39 -0
  3. package/dist-lib/base/shell/BasicShell.js +207 -0
  4. package/dist-lib/base/shell/ImmersiveShell.js +55 -0
  5. package/dist-lib/base/shell/partials/InspectorContext.js +60 -0
  6. package/dist-lib/base/shell/partials/InspectorPanel.js +22 -0
  7. package/dist-lib/base/shell/partials/NavErrorBoundary.js +66 -0
  8. package/dist-lib/base/shell/partials/OverlayScreen.js +36 -0
  9. package/dist-lib/base/shell/partials/PageActionButton.js +4 -0
  10. package/dist-lib/base/theme/appearance.js +39 -0
  11. package/dist-lib/base/theme/host-layout-detector.js +39 -0
  12. package/dist-lib/base/theme/host-theme-detector.js +131 -0
  13. package/dist-lib/base/theme/sidebar-safelist.txt +20 -0
  14. package/dist-lib/base/theme/tailwind-theme.css +136 -0
  15. package/dist-lib/base/theme/theme-bridge.css +164 -0
  16. package/dist-lib/base/theme/theme-context.js +103 -0
  17. package/dist-lib/base/theme/themes/classic.css +174 -0
  18. package/dist-lib/base/theme/tokens.css +290 -0
  19. package/dist-lib/base/theme/useHostTheme.js +34 -0
  20. package/dist-lib/base/utils/clipboard.js +16 -0
  21. package/dist-lib/base/utils/conditions.js +13 -0
  22. package/dist-lib/base/utils/icon-registry.js +16 -0
  23. package/dist-lib/base/utils/icons.js +11 -0
  24. package/dist-lib/base/utils/interpolate.js +6 -0
  25. package/dist-lib/base/utils/register-default-icons.js +9 -0
  26. package/dist-lib/base/utils/storage.js +30 -0
  27. package/dist-lib/base/utils/time.js +59 -0
  28. package/dist-lib/chunks/subpath-BD_PKGUX.js +146 -0
  29. package/dist-lib/chunks/subpath-DLFO_UGQ.js +604 -0
  30. package/dist-lib/components/reui/accordion.js +43 -0
  31. package/dist-lib/components/reui/alert-dialog.js +101 -0
  32. package/dist-lib/components/reui/alert.js +55 -0
  33. package/dist-lib/components/reui/aspect-ratio.js +11 -0
  34. package/dist-lib/components/reui/autocomplete.js +170 -0
  35. package/dist-lib/components/reui/avatar.js +51 -0
  36. package/dist-lib/components/reui/badge.js +64 -0
  37. package/dist-lib/components/reui/breadcrumb.js +69 -0
  38. package/dist-lib/components/reui/button-group.js +38 -0
  39. package/dist-lib/components/reui/button.js +47 -0
  40. package/dist-lib/components/reui/calendar.js +89 -0
  41. package/dist-lib/components/reui/card.js +55 -0
  42. package/dist-lib/components/reui/carousel.js +110 -0
  43. package/dist-lib/components/reui/chart.js +130 -0
  44. package/dist-lib/components/reui/checkbox.js +20 -0
  45. package/dist-lib/components/reui/collapsible.js +23 -0
  46. package/dist-lib/components/reui/combobox.js +166 -0
  47. package/dist-lib/components/reui/command.js +85 -0
  48. package/dist-lib/components/reui/context-menu.js +121 -0
  49. package/dist-lib/components/reui/data-grid/data-grid-column-filter.js +108 -0
  50. package/dist-lib/components/reui/data-grid/data-grid-column-header.js +217 -0
  51. package/dist-lib/components/reui/data-grid/data-grid-column-visibility.js +25 -0
  52. package/dist-lib/components/reui/data-grid/data-grid-pagination.js +132 -0
  53. package/dist-lib/components/reui/data-grid/data-grid-scroll-area.js +183 -0
  54. package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.js +125 -0
  55. package/dist-lib/components/reui/data-grid/data-grid-table-dnd.js +130 -0
  56. package/dist-lib/components/reui/data-grid/data-grid-table-virtual.js +156 -0
  57. package/dist-lib/components/reui/data-grid/data-grid-table.js +546 -0
  58. package/dist-lib/components/reui/data-grid/data-grid.js +113 -0
  59. package/dist-lib/components/reui/data-grid-pagination.js +131 -0
  60. package/dist-lib/components/reui/date-selector.js +642 -0
  61. package/dist-lib/components/reui/dialog.js +94 -0
  62. package/dist-lib/components/reui/drawer.js +77 -0
  63. package/dist-lib/components/reui/dropdown-menu.js +123 -0
  64. package/dist-lib/components/reui/empty.js +59 -0
  65. package/dist-lib/components/reui/field.js +115 -0
  66. package/dist-lib/components/reui/filters.js +873 -0
  67. package/dist-lib/components/reui/frame.js +97 -0
  68. package/dist-lib/components/reui/hover-card.js +31 -0
  69. package/dist-lib/components/reui/icon-placeholder.js +14 -0
  70. package/dist-lib/components/reui/index.js +18 -0
  71. package/dist-lib/components/reui/input-group.js +78 -0
  72. package/dist-lib/components/reui/input-otp.js +44 -0
  73. package/dist-lib/components/reui/input.js +14 -0
  74. package/dist-lib/components/reui/item.js +116 -0
  75. package/dist-lib/components/reui/kanban.js +316 -0
  76. package/dist-lib/components/reui/kbd.js +19 -0
  77. package/dist-lib/components/reui/label.js +14 -0
  78. package/dist-lib/components/reui/menubar.js +132 -0
  79. package/dist-lib/components/reui/native-select.js +37 -0
  80. package/dist-lib/components/reui/navigation-menu.js +80 -0
  81. package/dist-lib/components/reui/number-field.js +126 -0
  82. package/dist-lib/components/reui/pagination.js +78 -0
  83. package/dist-lib/components/reui/phone-input.js +124 -0
  84. package/dist-lib/components/reui/popover.js +55 -0
  85. package/dist-lib/components/reui/progress.js +20 -0
  86. package/dist-lib/components/reui/radio-group.js +27 -0
  87. package/dist-lib/components/reui/rating.js +81 -0
  88. package/dist-lib/components/reui/resizable.js +31 -0
  89. package/dist-lib/components/reui/scroll-area.js +36 -0
  90. package/dist-lib/components/reui/scrollspy.js +104 -0
  91. package/dist-lib/components/reui/select.js +97 -0
  92. package/dist-lib/components/reui/separator.js +17 -0
  93. package/dist-lib/components/reui/sheet.js +81 -0
  94. package/dist-lib/components/reui/sidebar.js +350 -0
  95. package/dist-lib/components/reui/skeleton.js +12 -0
  96. package/dist-lib/components/reui/slider.js +35 -0
  97. package/dist-lib/components/reui/sonner.js +28 -0
  98. package/dist-lib/components/reui/sortable.js +172 -0
  99. package/dist-lib/components/reui/spinner.js +14 -0
  100. package/dist-lib/components/reui/stepper.js +193 -0
  101. package/dist-lib/components/reui/svgs/claudeAiIcon.js +13 -0
  102. package/dist-lib/components/reui/svgs/gemini.js +257 -0
  103. package/dist-lib/components/reui/svgs/openai.js +10 -0
  104. package/dist-lib/components/reui/svgs/openaiDark.js +13 -0
  105. package/dist-lib/components/reui/switch.js +19 -0
  106. package/dist-lib/components/reui/table.js +66 -0
  107. package/dist-lib/components/reui/tabs.js +47 -0
  108. package/dist-lib/components/reui/textarea.js +13 -0
  109. package/dist-lib/components/reui/timeline.js +84 -0
  110. package/dist-lib/components/reui/toggle-group.js +48 -0
  111. package/dist-lib/components/reui/toggle.js +36 -0
  112. package/dist-lib/components/reui/tooltip.js +35 -0
  113. package/dist-lib/components/reui/tree.js +102 -0
  114. package/dist-lib/i18n/I18nProvider.js +23 -0
  115. package/dist-lib/i18n/host-resolver.js +10 -0
  116. package/dist-lib/i18n/instance.js +2 -0
  117. package/dist-lib/i18n/locales/en/ui.json +266 -0
  118. package/dist-lib/i18n/locales/en/validators.json +13 -0
  119. package/dist-lib/i18n/locales/pt-BR/ui.json +266 -0
  120. package/dist-lib/i18n/locales/pt-BR/validators.json +13 -0
  121. package/dist-lib/i18n/register-strings.js +7 -0
  122. package/dist-lib/i18n/render-label.js +13 -0
  123. package/dist-lib/i18n/resolve-field-error.js +10 -0
  124. package/dist-lib/i18n/useHostString.js +31 -0
  125. package/dist-lib/i18n/useTranslation.js +48 -0
  126. package/dist-lib/lib/actions/resolve-action-target.js +48 -0
  127. package/dist-lib/lib/hooks/use-copy-to-clipboard.js +18 -0
  128. package/dist-lib/lib/hooks/use-file-upload.js +171 -0
  129. package/dist-lib/lib/hooks/use-mobile.js +18 -0
  130. package/dist-lib/lib/portal-container.js +7 -0
  131. package/dist-lib/lib/utils.js +8 -0
  132. package/dist-lib/middag-react.css +1 -1
  133. package/package.json +41 -8
@@ -0,0 +1,131 @@
1
+ //#region src/base/theme/host-theme-detector.ts
2
+ var e = [
3
+ "dark",
4
+ "theme-dark",
5
+ "dark-mode",
6
+ "darkmode",
7
+ "is-dark",
8
+ "night",
9
+ "bp-dark"
10
+ ], t = [
11
+ {
12
+ attr: "data-theme",
13
+ value: "dark"
14
+ },
15
+ {
16
+ attr: "data-bs-theme",
17
+ value: "dark"
18
+ },
19
+ {
20
+ attr: "data-color-scheme",
21
+ value: "dark"
22
+ },
23
+ {
24
+ attr: "data-color-mode",
25
+ value: "dark"
26
+ },
27
+ {
28
+ attr: "data-moodle-theme-mode",
29
+ value: "dark"
30
+ },
31
+ {
32
+ attr: "data-wp-dark",
33
+ value: "true"
34
+ }
35
+ ];
36
+ function n(n) {
37
+ let r = n.classList;
38
+ for (let t of e) if (r.contains(t)) return !0;
39
+ for (let { attr: e, value: r } of t) if (n.getAttribute(e) === r) return !0;
40
+ return n.style.colorScheme === "dark";
41
+ }
42
+ var r = [
43
+ {
44
+ key: "theme-dark-mode",
45
+ darkValues: [
46
+ "true",
47
+ "1",
48
+ "dark"
49
+ ]
50
+ },
51
+ {
52
+ key: "darkmode",
53
+ darkValues: [
54
+ "true",
55
+ "1",
56
+ "dark",
57
+ "enabled"
58
+ ]
59
+ },
60
+ {
61
+ key: "dark-mode",
62
+ darkValues: [
63
+ "true",
64
+ "1",
65
+ "dark"
66
+ ]
67
+ },
68
+ {
69
+ key: "moodle-theme-mode",
70
+ darkValues: ["dark"]
71
+ },
72
+ {
73
+ key: "boost-dark-mode",
74
+ darkValues: ["true", "1"]
75
+ },
76
+ {
77
+ key: "moove-dark-mode",
78
+ darkValues: ["true", "1"]
79
+ },
80
+ {
81
+ key: "wp-dark-mode",
82
+ darkValues: [
83
+ "true",
84
+ "1",
85
+ "dark"
86
+ ]
87
+ },
88
+ {
89
+ key: "flavor",
90
+ darkValues: ["dark"]
91
+ },
92
+ {
93
+ key: "theme",
94
+ darkValues: ["dark"]
95
+ },
96
+ {
97
+ key: "color-scheme",
98
+ darkValues: ["dark"]
99
+ },
100
+ {
101
+ key: "color-mode",
102
+ darkValues: ["dark"]
103
+ }
104
+ ];
105
+ function i() {
106
+ try {
107
+ for (let { key: e, darkValues: t } of r) {
108
+ let n = localStorage.getItem(e);
109
+ if (n !== null && t.includes(n.toLowerCase())) return !0;
110
+ }
111
+ } catch {}
112
+ return null;
113
+ }
114
+ function a() {
115
+ return typeof window > "u" ? "auto" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "auto";
116
+ }
117
+ function o() {
118
+ return typeof document > "u" ? "auto" : n(document.documentElement) || n(document.body) ? "dark" : document.documentElement.getAttribute("data-theme") === "light" || document.documentElement.getAttribute("data-bs-theme") === "light" || document.body.getAttribute("data-theme") === "light" ? "light" : i() === !0 ? "dark" : a();
119
+ }
120
+ var s = [
121
+ "class",
122
+ "data-theme",
123
+ "data-bs-theme",
124
+ "data-color-scheme",
125
+ "data-color-mode",
126
+ "data-moodle-theme-mode",
127
+ "data-wp-dark",
128
+ "style"
129
+ ];
130
+ //#endregion
131
+ export { s as OBSERVED_ATTRIBUTES, o as detectHostTheme };
@@ -0,0 +1,20 @@
1
+ w-(--sidebar-width)
2
+ w-(--sidebar-width-icon)
3
+ w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]
4
+ w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]
5
+ group-data-[collapsible=icon]:w-(--sidebar-width-icon)
6
+ group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]
7
+ group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]
8
+ group-data-[collapsible=icon]:hidden
9
+ group-data-[collapsible=icon]:overflow-hidden
10
+ group-data-[collapsible=icon]:p-0!
11
+ group-data-[collapsible=icon]:size-8!
12
+ group-data-[collapsible=icon]:p-2!
13
+ group-data-[collapsible=icon]:-mt-8
14
+ group-data-[collapsible=icon]:opacity-0
15
+ group-data-[collapsible=offcanvas]:w-0
16
+ group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]
17
+ group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]
18
+ group-data-[collapsible=offcanvas]:bg-sidebar
19
+ group-data-[collapsible=offcanvas]:translate-x-0
20
+ group-data-[collapsible=offcanvas]:after:left-full
@@ -0,0 +1,136 @@
1
+ /*
2
+ * Tailwind THEME CONTRACT — compile-time utility→token mapping (E1.8).
3
+ *
4
+ * Single source of truth for how Tailwind utility classes resolve to the
5
+ * MIDDAG runtime tokens (tokens.css / theme-bridge.css). Imported by TWO
6
+ * Tailwind entries:
7
+ *
8
+ * 1. src/tailwind.css — the engine's shipped stylesheet
9
+ * (@middag-io/react/style.css), which also emits the runtime tokens.
10
+ * 2. the react-pro style.css entry — the PRO utilities layer
11
+ * (@middag-io/react-pro/style.css), compiled ONLY from react-pro
12
+ * sources. It re-uses this mapping so a PRO `bg-background`/`p-4`
13
+ * compiles to the exact same declaration the engine emits — never to
14
+ * Tailwind defaults (which would win the cascade and break tokens).
15
+ *
16
+ * The engine build copies this file to dist-lib/ and exports it as
17
+ * `@middag-io/react/tailwind-theme.css` so the post-split PRO repo can
18
+ * import the contract from the published package.
19
+ *
20
+ * Runtime var definitions do NOT belong here — only @theme mappings and
21
+ * variants. The engine stylesheet is the one that ships the tokens.
22
+ */
23
+
24
+ @custom-variant dark (&:is(.dark *));
25
+
26
+ @theme {
27
+ --color-background: var(--background);
28
+ --color-foreground: var(--foreground);
29
+ --color-primary: var(--middag-brand, var(--primary));
30
+ --color-primary-foreground: var(--primary-foreground);
31
+ --color-destructive: var(--destructive);
32
+ --color-destructive-foreground: var(--destructive-foreground);
33
+ --color-success: var(--success);
34
+ --color-success-foreground: var(--success-foreground);
35
+ --color-warning: var(--warning);
36
+ --color-warning-foreground: var(--warning-foreground);
37
+ --color-info: var(--info);
38
+ --color-info-foreground: var(--info-foreground);
39
+ --color-muted: var(--muted);
40
+ --color-muted-foreground: var(--muted-foreground);
41
+ --color-accent: var(--accent);
42
+ --color-accent-foreground: var(--accent-foreground);
43
+ --color-border: var(--border);
44
+ --color-input: var(--input);
45
+ --color-ring: var(--ring);
46
+ --color-card: var(--card);
47
+ --color-card-foreground: var(--card-foreground);
48
+ --color-popover: var(--popover);
49
+ --color-popover-foreground: var(--popover-foreground);
50
+ --color-secondary: var(--secondary);
51
+ --color-secondary-foreground: var(--secondary-foreground);
52
+
53
+ /* ── Semantic color variants (subtle/muted) ── */
54
+ --color-primary-subtle: var(--primary-subtle);
55
+ --color-primary-muted: var(--primary-muted);
56
+ --color-destructive-subtle: var(--destructive-subtle);
57
+ --color-destructive-muted: var(--destructive-muted);
58
+ --color-success-subtle: var(--success-subtle);
59
+ --color-success-muted: var(--success-muted);
60
+ --color-warning-subtle: var(--warning-subtle);
61
+ --color-warning-muted: var(--warning-muted);
62
+ --color-info-subtle: var(--info-subtle);
63
+ --color-info-muted: var(--info-muted);
64
+
65
+ /* ── Chart colors ── */
66
+ --color-chart-1: var(--chart-1);
67
+ --color-chart-2: var(--chart-2);
68
+ --color-chart-3: var(--chart-3);
69
+ --color-chart-4: var(--chart-4);
70
+ --color-chart-5: var(--chart-5);
71
+
72
+ --color-sidebar: var(--sidebar);
73
+ --color-sidebar-foreground: var(--sidebar-foreground);
74
+ --color-sidebar-primary: var(--sidebar-primary);
75
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
76
+ --color-sidebar-accent: var(--sidebar-accent);
77
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
78
+ --color-sidebar-hover: var(--sidebar-hover);
79
+ --color-sidebar-border: var(--sidebar-border);
80
+ --color-sidebar-ring: var(--ring);
81
+
82
+ --color-invert: var(--invert);
83
+ --color-invert-foreground: var(--invert-foreground);
84
+
85
+ --font-sans: var(--font-sans);
86
+ --font-mono: var(--font-mono);
87
+
88
+ --radius-sm: calc(var(--radius) - 4px);
89
+ --radius-md: calc(var(--radius) - 2px);
90
+ --radius-lg: var(--radius);
91
+ --radius-xl: calc(var(--radius) + 4px);
92
+ --radius-2xl: calc(var(--radius) + 6px);
93
+
94
+ /* ── Spacing scale as Tailwind spacing ── */
95
+ --spacing-0: var(--space-0);
96
+ --spacing-0\.5: var(--space-0\.5);
97
+ --spacing-1: var(--space-1);
98
+ --spacing-1\.5: var(--space-1\.5);
99
+ --spacing-2: var(--space-2);
100
+ --spacing-3: var(--space-3);
101
+ --spacing-4: var(--space-4);
102
+ --spacing-5: var(--space-5);
103
+ --spacing-6: var(--space-6);
104
+ --spacing-8: var(--space-8);
105
+ --spacing-10: var(--space-10);
106
+ --spacing-12: var(--space-12);
107
+ --spacing-16: var(--space-16);
108
+ --spacing-20: var(--space-20);
109
+
110
+ /* ── Component sizing ── */
111
+ --size-button-sm: var(--size-button-sm);
112
+ --size-button-md: var(--size-button-md);
113
+ --size-button-lg: var(--size-button-lg);
114
+ --size-sidebar-item: var(--size-sidebar-item);
115
+ --size-table-row: var(--size-table-row);
116
+
117
+ /* ── Shadow tokens ── */
118
+ --shadow-xs: var(--shadow-xs);
119
+ --shadow-sm: var(--shadow-sm);
120
+ --shadow-md: var(--shadow-md);
121
+ --shadow-lg: var(--shadow-lg);
122
+ --shadow-xl: var(--shadow-xl);
123
+ --shadow-2xl: var(--shadow-2xl);
124
+ }
125
+
126
+ @theme inline {
127
+ --color-destructive-foreground: var(--destructive-foreground);
128
+ --color-success: var(--success);
129
+ --color-success-foreground: var(--success-foreground);
130
+ --color-info: var(--info);
131
+ --color-info-foreground: var(--info-foreground);
132
+ --color-warning: var(--warning);
133
+ --color-warning-foreground: var(--warning-foreground);
134
+ --color-invert: var(--invert);
135
+ --color-invert-foreground: var(--invert-foreground);
136
+ }
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Theme Bridge — forces re-resolution of Tailwind --color-* tokens at theme scope.
3
+ *
4
+ * Problem: Tailwind v4 @theme generates `--color-primary: var(--primary)` on :root.
5
+ * CSS resolves `var(--primary)` at :root level (computed value = classic default),
6
+ * and descendants inherit the resolved value. When .theme-enterprise sets
7
+ * `--primary: new-value`, it doesn't affect --color-primary because that was
8
+ * already computed on :root.
9
+ *
10
+ * Fix: Re-declare ALL --color-* mappings on .theme-* selectors. This forces
11
+ * the browser to re-evaluate var(--primary) at the theme class level, where
12
+ * the theme's own --primary is in scope.
13
+ *
14
+ * This file must be imported AFTER tailwind.css (so it overrides @layer theme).
15
+ * It does NOT need updating when theme files change — it just re-maps the same
16
+ * var() references. Only update when NEW --color-* tokens are added to @theme.
17
+ */
18
+
19
+ /* ── Light mode ────────────────────────────────────────────────────────────── */
20
+
21
+ .theme-classic,
22
+ .theme-enterprise,
23
+ .theme-soft,
24
+ .theme-midnight {
25
+ /* Canvas */
26
+ --color-background: var(--background);
27
+ --color-foreground: var(--foreground);
28
+
29
+ /* Primary */
30
+ --color-primary: var(--middag-brand, var(--primary));
31
+ --color-primary-foreground: var(--primary-foreground);
32
+ --color-primary-subtle: var(--primary-subtle);
33
+ --color-primary-muted: var(--primary-muted);
34
+
35
+ /* Secondary */
36
+ --color-secondary: var(--secondary);
37
+ --color-secondary-foreground: var(--secondary-foreground);
38
+
39
+ /* Destructive */
40
+ --color-destructive: var(--destructive);
41
+ --color-destructive-foreground: var(--destructive-foreground);
42
+ --color-destructive-subtle: var(--destructive-subtle);
43
+ --color-destructive-muted: var(--destructive-muted);
44
+
45
+ /* Success */
46
+ --color-success: var(--success);
47
+ --color-success-foreground: var(--success-foreground);
48
+ --color-success-subtle: var(--success-subtle);
49
+ --color-success-muted: var(--success-muted);
50
+
51
+ /* Warning */
52
+ --color-warning: var(--warning);
53
+ --color-warning-foreground: var(--warning-foreground);
54
+ --color-warning-subtle: var(--warning-subtle);
55
+ --color-warning-muted: var(--warning-muted);
56
+
57
+ /* Info */
58
+ --color-info: var(--info);
59
+ --color-info-foreground: var(--info-foreground);
60
+ --color-info-subtle: var(--info-subtle);
61
+ --color-info-muted: var(--info-muted);
62
+
63
+ /* Neutral */
64
+ --color-muted: var(--muted);
65
+ --color-muted-foreground: var(--muted-foreground);
66
+ --color-accent: var(--accent);
67
+ --color-accent-foreground: var(--accent-foreground);
68
+
69
+ /* Structure */
70
+ --color-border: var(--border);
71
+ --color-input: var(--input);
72
+ --color-ring: var(--ring);
73
+
74
+ /* Overlays */
75
+ --color-card: var(--card);
76
+ --color-card-foreground: var(--card-foreground);
77
+ --color-popover: var(--popover);
78
+ --color-popover-foreground: var(--popover-foreground);
79
+
80
+ /* Chart */
81
+ --color-chart-1: var(--chart-1);
82
+ --color-chart-2: var(--chart-2);
83
+ --color-chart-3: var(--chart-3);
84
+ --color-chart-4: var(--chart-4);
85
+ --color-chart-5: var(--chart-5);
86
+
87
+ /* Sidebar */
88
+ --color-sidebar: var(--sidebar);
89
+ --color-sidebar-foreground: var(--sidebar-foreground);
90
+ --color-sidebar-primary: var(--sidebar-primary);
91
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
92
+ --color-sidebar-accent: var(--sidebar-accent);
93
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
94
+ --color-sidebar-hover: var(--sidebar-hover);
95
+ --color-sidebar-border: var(--sidebar-border);
96
+ --color-sidebar-ring: var(--ring);
97
+
98
+ /* Invert */
99
+ --color-invert: var(--invert);
100
+ --color-invert-foreground: var(--invert-foreground);
101
+ }
102
+
103
+ /* ── Dark mode ─────────────────────────────────────────────────────────────── */
104
+
105
+ :root.dark .theme-classic,
106
+ :root.dark .theme-enterprise,
107
+ :root.dark .theme-soft,
108
+ :root.dark .theme-midnight,
109
+ [data-theme="dark"] .theme-classic,
110
+ [data-theme="dark"] .theme-enterprise,
111
+ [data-theme="dark"] .theme-soft,
112
+ [data-theme="dark"] .theme-midnight {
113
+ --color-background: var(--background);
114
+ --color-foreground: var(--foreground);
115
+ --color-primary: var(--middag-brand, var(--primary));
116
+ --color-primary-foreground: var(--primary-foreground);
117
+ --color-primary-subtle: var(--primary-subtle);
118
+ --color-primary-muted: var(--primary-muted);
119
+ --color-secondary: var(--secondary);
120
+ --color-secondary-foreground: var(--secondary-foreground);
121
+ --color-destructive: var(--destructive);
122
+ --color-destructive-foreground: var(--destructive-foreground);
123
+ --color-destructive-subtle: var(--destructive-subtle);
124
+ --color-destructive-muted: var(--destructive-muted);
125
+ --color-success: var(--success);
126
+ --color-success-foreground: var(--success-foreground);
127
+ --color-success-subtle: var(--success-subtle);
128
+ --color-success-muted: var(--success-muted);
129
+ --color-warning: var(--warning);
130
+ --color-warning-foreground: var(--warning-foreground);
131
+ --color-warning-subtle: var(--warning-subtle);
132
+ --color-warning-muted: var(--warning-muted);
133
+ --color-info: var(--info);
134
+ --color-info-foreground: var(--info-foreground);
135
+ --color-info-subtle: var(--info-subtle);
136
+ --color-info-muted: var(--info-muted);
137
+ --color-muted: var(--muted);
138
+ --color-muted-foreground: var(--muted-foreground);
139
+ --color-accent: var(--accent);
140
+ --color-accent-foreground: var(--accent-foreground);
141
+ --color-border: var(--border);
142
+ --color-input: var(--input);
143
+ --color-ring: var(--ring);
144
+ --color-card: var(--card);
145
+ --color-card-foreground: var(--card-foreground);
146
+ --color-popover: var(--popover);
147
+ --color-popover-foreground: var(--popover-foreground);
148
+ --color-chart-1: var(--chart-1);
149
+ --color-chart-2: var(--chart-2);
150
+ --color-chart-3: var(--chart-3);
151
+ --color-chart-4: var(--chart-4);
152
+ --color-chart-5: var(--chart-5);
153
+ --color-sidebar: var(--sidebar);
154
+ --color-sidebar-foreground: var(--sidebar-foreground);
155
+ --color-sidebar-primary: var(--sidebar-primary);
156
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
157
+ --color-sidebar-accent: var(--sidebar-accent);
158
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
159
+ --color-sidebar-hover: var(--sidebar-hover);
160
+ --color-sidebar-border: var(--sidebar-border);
161
+ --color-sidebar-ring: var(--ring);
162
+ --color-invert: var(--invert);
163
+ --color-invert-foreground: var(--invert-foreground);
164
+ }
@@ -0,0 +1,103 @@
1
+ import { createContext as e, useContext as t, useMemo as n } from "react";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ //#region src/base/theme/theme-context.tsx
4
+ var i = [
5
+ "classic",
6
+ "enterprise",
7
+ "soft",
8
+ "midnight"
9
+ ], a = {
10
+ classic: {
11
+ id: "classic",
12
+ badge: {
13
+ variant: "default",
14
+ rounded: !1
15
+ },
16
+ button: { size: "default" },
17
+ tabs: { variant: "default" },
18
+ table: {
19
+ density: "comfortable",
20
+ stripedRows: !1
21
+ },
22
+ card: { bordered: !1 }
23
+ },
24
+ enterprise: {
25
+ id: "enterprise",
26
+ badge: {
27
+ variant: "outline",
28
+ rounded: !1
29
+ },
30
+ button: { size: "sm" },
31
+ tabs: { variant: "line" },
32
+ table: {
33
+ density: "compact",
34
+ stripedRows: !0
35
+ },
36
+ card: { bordered: !0 }
37
+ },
38
+ soft: {
39
+ id: "soft",
40
+ badge: {
41
+ variant: "soft",
42
+ rounded: !0
43
+ },
44
+ button: { size: "default" },
45
+ tabs: { variant: "pill" },
46
+ table: {
47
+ density: "spacious",
48
+ stripedRows: !1
49
+ },
50
+ card: { bordered: !1 }
51
+ },
52
+ midnight: {
53
+ id: "midnight",
54
+ badge: {
55
+ variant: "outline",
56
+ rounded: !1
57
+ },
58
+ button: { size: "sm" },
59
+ tabs: { variant: "line" },
60
+ table: {
61
+ density: "compact",
62
+ stripedRows: !1
63
+ },
64
+ card: { bordered: !0 }
65
+ }
66
+ }, o = e(a.classic);
67
+ function s() {
68
+ return t(o);
69
+ }
70
+ function c(e) {
71
+ return a[e];
72
+ }
73
+ var l = {
74
+ classic: "theme-classic",
75
+ enterprise: "theme-enterprise",
76
+ soft: "theme-soft",
77
+ midnight: "theme-midnight"
78
+ }, u = {
79
+ classic: {
80
+ width: "260px",
81
+ icon: "60px"
82
+ },
83
+ enterprise: {
84
+ width: "248px",
85
+ icon: "56px"
86
+ },
87
+ soft: {
88
+ width: "272px",
89
+ icon: "64px"
90
+ },
91
+ midnight: {
92
+ width: "240px",
93
+ icon: "52px"
94
+ }
95
+ };
96
+ function d({ theme: e, children: t }) {
97
+ return /* @__PURE__ */ r(o, {
98
+ value: n(() => a[e], [e]),
99
+ children: t
100
+ });
101
+ }
102
+ //#endregion
103
+ export { d as MIDDAGThemeProvider, l as THEME_CLASSES, i as THEME_IDS, u as THEME_SIDEBAR_DIMS, c as getThemeOverrides, s as useThemeOverrides };