@inglorious/ui 9.5.1 → 9.7.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.
package/README.md CHANGED
@@ -40,8 +40,11 @@ The public CSS exports are:
40
40
  - `@inglorious/ui/base.css`
41
41
  - `@inglorious/ui/tokens.css`
42
42
  - `@inglorious/ui/themes/inglorious.css`
43
- - `@inglorious/ui/themes/material.css`
43
+ - `@inglorious/ui/themes/material-ui.css`
44
+ - `@inglorious/ui/themes/material-3.css`
44
45
  - `@inglorious/ui/themes/bootstrap.css`
46
+ - `@inglorious/ui/themes/ios-18.css`
47
+ - `@inglorious/ui/themes/ios-26.css`
45
48
  - `@inglorious/ui/all.css`
46
49
 
47
50
  ## Icons
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/ui",
3
- "version": "9.5.1",
3
+ "version": "9.7.0",
4
4
  "description": "A design system for Inglorious Web with render-function components and customizable themes",
5
5
  "author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
6
6
  "license": "MIT",
@@ -37,8 +37,11 @@
37
37
  "./tokens.css": "./src/styles/tokens.css",
38
38
  "./safe-area.css": "./src/styles/safe-area.css",
39
39
  "./themes/inglorious.css": "./src/styles/themes/inglorious.css",
40
- "./themes/material.css": "./src/styles/themes/material.css",
40
+ "./themes/material-ui.css": "./src/styles/themes/material-ui.css",
41
+ "./themes/material-3.css": "./src/styles/themes/material-3.css",
41
42
  "./themes/bootstrap.css": "./src/styles/themes/bootstrap.css",
43
+ "./themes/ios-18.css": "./src/styles/themes/ios-18.css",
44
+ "./themes/ios-26.css": "./src/styles/themes/ios-26.css",
42
45
  "./before-after": {
43
46
  "types": "./types/data-display/before-after.d.ts",
44
47
  "import": "./src/data-display/before-after/index.js"
@@ -311,21 +314,21 @@
311
314
  "**/*.css"
312
315
  ],
313
316
  "peerDependencies": {
314
- "@inglorious/store": "12.0.0",
317
+ "@inglorious/store": "12.1.0",
315
318
  "@inglorious/utils": "5.1.0",
316
- "@inglorious/web": "6.9.1"
319
+ "@inglorious/web": "6.10.0"
317
320
  },
318
321
  "devDependencies": {
319
322
  "@iconify-icons/fa7-brands": "^2.0.0",
320
323
  "@iconify-icons/fa7-regular": "^2.0.0",
321
324
  "@iconify-icons/fa7-solid": "^2.0.0",
322
325
  "@iconify-icons/material-symbols": "^2.0.6",
323
- "@inglorious/charts": "12.2.2",
326
+ "@inglorious/charts": "12.2.3",
324
327
  "@inglorious/eslint-config": "1.2.0",
325
- "@inglorious/store": "12.0.0",
328
+ "@inglorious/store": "12.1.0",
326
329
  "@inglorious/vite-plugin-jsx": "2.0.5",
327
330
  "@inglorious/vite-plugin-vue": "1.0.6",
328
- "@inglorious/web": "6.9.1",
331
+ "@inglorious/web": "6.10.0",
329
332
  "@storybook/addon-docs": "^10.6.0",
330
333
  "@storybook/web-components-vite": "^10.6.0",
331
334
  "happy-dom": "^20.14.0",
@@ -28,6 +28,7 @@
28
28
  padding: 0 var(--iw-space-3);
29
29
  border: 1px solid var(--iw-input-border);
30
30
  border-radius: var(--iw-input-radius);
31
+ background-color: var(--iw-input-bg);
31
32
  transition:
32
33
  border-color var(--iw-transition-fast),
33
34
  box-shadow var(--iw-transition-fast),
@@ -1,6 +1,9 @@
1
1
  import android from "@iconify-icons/fa7-brands/android"
2
+ import apple from "@iconify-icons/fa7-brands/apple"
2
3
  import bootstrap from "@iconify-icons/fa7-brands/bootstrap"
4
+ import react from "@iconify-icons/fa7-brands/react"
3
5
  import gamepad from "@iconify-icons/fa7-solid/gamepad"
6
+ import mobile from "@iconify-icons/fa7-solid/mobile"
4
7
  import contrastOutline from "@iconify-icons/material-symbols/contrast-outline"
5
8
  import darkModeOutline from "@iconify-icons/material-symbols/dark-mode-outline"
6
9
  import formatListBulletedOutline from "@iconify-icons/material-symbols/format-list-bulleted-outline"
@@ -18,18 +21,22 @@ import { Flex } from "../../layout/flex/index.js"
18
21
  import { Breadcrumbs } from "../../navigation/breadcrumbs/index.js"
19
22
  import { AppBar } from "../../surfaces/app-bar/index.js"
20
23
 
24
+ const THEME_ICONS = {
25
+ inglorious: gamepad,
26
+ "material-ui": react,
27
+ "material-3": android,
28
+ bootstrap,
29
+ "ios-18": mobile,
30
+ "ios-26": apple,
31
+ }
32
+
21
33
  export const AppHeader = {
22
34
  render(entity, api) {
23
35
  const themeEntity = api.getEntity("theme")
24
36
  const modeEntity = api.getEntity("mode")
25
37
  const themeMode = modeEntity?.mode ?? "auto"
26
38
  const themeName = themeEntity?.theme ?? "inglorious"
27
- const themeIcon =
28
- themeName === "bootstrap"
29
- ? bootstrap
30
- : themeName === "material"
31
- ? android
32
- : gamepad
39
+ const themeIcon = THEME_ICONS[themeName] ?? gamepad
33
40
  const modeIcon =
34
41
  themeMode === "light"
35
42
  ? lightModeOutline
@@ -79,6 +79,7 @@
79
79
 
80
80
  .iw-dashboard-stat {
81
81
  overflow: hidden;
82
+ color: white;
82
83
 
83
84
  .iw-typography,
84
85
  .iw-icon,
@@ -1,6 +1,13 @@
1
1
  const DEFAULT_THEME = "inglorious"
2
2
  const DEFAULT_MODE = "auto"
3
- const THEME_CYCLE = ["inglorious", "material", "bootstrap"]
3
+ const THEME_CYCLE = [
4
+ "inglorious",
5
+ "material-ui",
6
+ "material-3",
7
+ "bootstrap",
8
+ "ios-18",
9
+ "ios-26",
10
+ ]
4
11
  const MODE_CYCLE = ["auto", "light", "dark"]
5
12
 
6
13
  let currentTheme = DEFAULT_THEME
@@ -21,7 +28,7 @@ export function applyTheme(theme = currentTheme, mode = currentMode) {
21
28
  resolvedMode === "light" ? "iw-theme-light" : "iw-theme-dark"
22
29
 
23
30
  document.body.className = document.body.className.replace(
24
- /iw-theme-(\w+)/g,
31
+ /iw-theme-([\w-]+)/g,
25
32
  "",
26
33
  )
27
34
  document.body.classList.add(themeClass, modeClass)
@@ -2,10 +2,11 @@
2
2
  * @typedef {import("../../../types/navigation/view-transitions").TransitionsStore} Store
3
3
  * @typedef {import("../../../types/navigation/view-transitions").ViewTransitionType} ViewTransitionType
4
4
  * @typedef {import("../../../types/navigation/view-transitions").TransitionsOptions} TransitionsOptions
5
+ * @typedef {(store: Store) => Store} Middleware
5
6
  */
6
7
 
7
8
  /**
8
- * Wraps a store so that the renders which follow a navigation are run inside a
9
+ * A store middleware that runs the renders which follow a navigation inside a
9
10
  * view transition, tagged with the direction they navigated in. Pair it with
10
11
  * `style.css` from this package, which turns those tags into a slide.
11
12
  *
@@ -20,7 +21,7 @@
20
21
  * import { withTransitions } from "@inglorious/ui/view-transitions"
21
22
  * import "@inglorious/ui/view-transitions.css"
22
23
  *
23
- * mount(withTransitions(store), renderApp, document.getElementById("root"))
24
+ * const store = createStore({ types, entities, middlewares: [withTransitions()] })
24
25
  *
25
26
  * Pass `routes` to choose which navigations animate; the rest change page
26
27
  * without a transition. A list of route names animates every navigation into
@@ -30,20 +31,23 @@
30
31
  *
31
32
  * @example
32
33
  * // Slide into and out of detail pages; switch tabs instantly.
33
- * withTransitions(store, { routes: ["eventDetail", "userDetail"] })
34
+ * withTransitions({ routes: ["eventDetail", "userDetail"] })
34
35
  *
35
36
  * @example
36
37
  * // Slide only when going deeper or coming back up, never sideways.
37
- * withTransitions(store, {
38
+ * withTransitions({
38
39
  * routes: ({ from, to }) => from.path.startsWith(to.path) || to.path.startsWith(from.path),
39
40
  * })
40
41
  *
41
- * @param {Store} store - The store to wrap.
42
42
  * @param {TransitionsOptions} [options]
43
- * @returns {Store} The same store, with a wrapped `subscribe`.
44
- * @throws {Error} If the store has no `Router` type.
43
+ * @returns {Middleware} The middleware, which returns the store it is given with a
44
+ * wrapped `subscribe`, and throws if the store has no `Router` type.
45
45
  */
46
- export function withTransitions(store, { routes } = {}) {
46
+ export function withTransitions({ routes } = {}) {
47
+ return (store) => wrapStore(store, routes)
48
+ }
49
+
50
+ function wrapStore(store, routes) {
47
51
  if (!store.getType("Router")) {
48
52
  throw new Error(
49
53
  '[withTransitions] Requires the "Router" type from @inglorious/web. The ' +