From 5c1ca760e8e98aebc55b0cfcd3f12494fad65dc7 Mon Sep 17 00:00:00 2001 From: Cristen Jones Date: Fri, 27 Dec 2024 11:20:51 -0500 Subject: [PATCH] deps: update mbta_metro to minor version 1 (#2292) * deps: update mbta_metro * merge the themes * maybe fix this import * fix regression * another button! --- assets/css/app.scss | 2 + assets/package-lock.json | 7 ++ assets/tailwind.config.js | 75 +++++++------------ lib/dotcom_web/components/route_symbols.ex | 2 +- .../trip_planner/itinerary_detail.ex | 31 ++------ mix.exs | 4 +- mix.lock | 4 +- 7 files changed, 49 insertions(+), 76 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index 282239bd43..b7e142d981 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -11,6 +11,8 @@ --tw-content: '' !important; } +@import "../../deps/mbta_metro/priv/static/assets/variables.light.css" (prefers-color-scheme: light); +@import "../../deps/mbta_metro/priv/static/assets/variables.dark.css" (prefers-color-scheme: dark); @import '../../deps/mbta_metro/priv/static/assets/default.css'; //////////////////////////////////////////////////////////////////////////////////////// diff --git a/assets/package-lock.json b/assets/package-lock.json index 4d14171fdf..06f283117e 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -4998,6 +4998,12 @@ "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" }, + "node_modules/@mbta/rider-design-system": { + "name": "rider-design-system", + "version": "0.5.0", + "resolved": "git+ssh://git@github.com/mbta/rider-design-system.git#c9589af1a5c1b6734ffb786f5f8b9ba993662f9c", + "license": "ISC" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "license": "MIT", @@ -15831,6 +15837,7 @@ "resolved": "file:../deps/mbta_metro/priv", "license": "GPL-3.0-or-later", "dependencies": { + "@mbta/rider-design-system": "github:mbta/rider-design-system", "@tailwindcss/forms": "0.5.9", "camelcase-keys": "9.1.3", "date-fns": "4.1.0", diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index a2e619f98e..f49cefe512 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -2,14 +2,35 @@ // https://tailwindcss.com/docs/configuration const plugin = require("tailwindcss/plugin"); +const { content, plugins, safelist } = require("mbta_metro"); +const { theme: tailwindTheme } = require("mbta_metro/tailwindTheme"); -const { - colors, - content, - fontFamily, - plugins, - safelist -} = require("mbta_metro"); +const moreColors = { + ...tailwindTheme.colors, + gray: { + DEFAULT: "#494f5c", + dark: "#1c1e23", + light: "#788093", + lighter: "#b0b5c0", + lightest: "#e9eaed", + "bordered-background": "#f2f3f5" + }, + "brand-primary": { + DEFAULT: "#165c96", + darkest: "#0b2f4c", + lightest: "#cee0f4" + }, + "logan-express": { + BB: "#f16823", + BT: "#0066cc", + DV: "#704c9f", + FH: "#e81d2d", + WO: "#00954c" + }, + massport: "#104c8f", + subway: "#494f5c" +}; +tailwindTheme.colors = moreColors; module.exports = { corePlugins: { @@ -31,45 +52,7 @@ module.exports = { } ], theme: { - extend: { - colors: { - ...colors, - gray: { - DEFAULT: "#494f5c", - dark: "#1c1e23", - light: "#788093", - lighter: "#b0b5c0", - lightest: "#e9eaed", - "bordered-background": "#f2f3f5" - }, - "brand-primary": { - DEFAULT: "#165c96", - darkest: "#0b2f4c", - lightest: "#cee0f4" - }, - "logan-express": { - BB: "#f16823", - BT: "#0066cc", - DV: "#704c9f", - FH: "#e81d2d", - WO: "#00954c" - }, - massport: "#104c8f", - subway: "#494f5c", - // These will come from the design system someday - "blue-line": "#003da5", - "green-line": "#00843d", - "orange-line": "#ed8b00", - "red-line": "#da291c", - "silver-line": "#7c878e", - "commuter-rail": "#80276c", - bus: "#ffc72c", - ferry: "#008eaa" - } - }, - fontFamily: { - ...fontFamily - }, + extend: tailwindTheme, // match screens to Bootstrap's breakpoints for now // matched from $container-max-widths screens: { diff --git a/lib/dotcom_web/components/route_symbols.ex b/lib/dotcom_web/components/route_symbols.ex index fed21a67ed..29793d909a 100644 --- a/lib/dotcom_web/components/route_symbols.ex +++ b/lib/dotcom_web/components/route_symbols.ex @@ -55,7 +55,7 @@ defmodule DotcomWeb.Components.RouteSymbols do route_class = if(Routes.Route.silver_line?(assigns.route), do: "bg-silver-line text-white", - else: "bg-bus text-black" + else: "bg-brand-bus text-black" ) assigns = update(assigns, :class, &"#{&1} #{route_class}") diff --git a/lib/dotcom_web/components/trip_planner/itinerary_detail.ex b/lib/dotcom_web/components/trip_planner/itinerary_detail.ex index f27f1f9ec0..0b667781db 100644 --- a/lib/dotcom_web/components/trip_planner/itinerary_detail.ex +++ b/lib/dotcom_web/components/trip_planner/itinerary_detail.ex @@ -38,41 +38,22 @@ defmodule DotcomWeb.Components.TripPlanner.ItineraryDetail do
1}>

Depart at

- <.depart_at_button + <.button :for={{itinerary, index} <- Enum.with_index(@itineraries)} - active={@itinerary_selection == index} + type="button" + class={if(@itinerary_selection == index, do: "bg-brand-primary-lightest")} + size="small" + variant="secondary" phx-click="select_itinerary" phx-value-index={index} > {Timex.format!(itinerary.start, "%-I:%M%p", :strftime)} - +
""" end - attr :active, :boolean - attr :rest, :global - slot :inner_block - - defp depart_at_button(%{active: active} = assigns) do - background_class = if active, do: "bg-brand-primary-lightest", else: "bg-transparent" - assigns = assign(assigns, :background_class, background_class) - - ~H""" - - """ - end - defp specific_itinerary_detail(assigns) do assigns = assigns diff --git a/mix.exs b/mix.exs index c27badacd3..4dc704ccd5 100644 --- a/mix.exs +++ b/mix.exs @@ -78,7 +78,7 @@ defmodule DotCom.Mixfile do {:crc, "0.10.5"}, {:credo, "1.7.8", only: [:dev, :test]}, {:csv, "3.2.1"}, - {:cva, "0.2.1"}, + {:cva, "0.2.2"}, {:decorator, "1.4.0"}, {:dialyxir, "1.4.4", [only: [:dev, :test], runtime: false]}, {:diskusage_logger, "0.2.0"}, @@ -106,7 +106,7 @@ defmodule DotCom.Mixfile do {:jason, "1.4.4", override: true}, {:logster, "1.1.1"}, {:mail, "0.3.1"}, - {:mbta_metro, "0.0.65"}, + {:mbta_metro, "0.1.11"}, {:mock, "0.3.8", [only: :test]}, {:mox, "1.2.0", [only: :test]}, {:nebulex, "2.6.4"}, diff --git a/mix.lock b/mix.lock index c11e653a67..8d11718e0d 100644 --- a/mix.lock +++ b/mix.lock @@ -14,7 +14,7 @@ "crc": {:hex, :crc, "0.10.5", "ee12a7c056ac498ef2ea985ecdc9fa53c1bfb4e53a484d9f17ff94803707dfd8", [:mix, :rebar3], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "3e673b6495a9525c5c641585af1accba59a1eb33de697bedf341e247012c2c7f"}, "credo": {:hex, :credo, "1.7.8", "9722ba1681e973025908d542ec3d95db5f9c549251ba5b028e251ad8c24ab8c5", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cb9e87cc64f152f3ed1c6e325e7b894dea8f5ef2e41123bd864e3cd5ceb44968"}, "csv": {:hex, :csv, "3.2.1", "6d401f1ed33acb2627682a9ab6021e96d33ca6c1c6bccc243d8f7e2197d032f5", [:mix], [], "hexpm", "8f55a0524923ae49e97ff2642122a2ce7c61e159e7fe1184670b2ce847aee6c8"}, - "cva": {:hex, :cva, "0.2.1", "fe8acf9c6031714c9b671d80fc7728bd1cc9f5df7708669cdb9682856d352f71", [:mix], [{:phoenix_live_view, "~> 0.18", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "f913a0367e1aed19df18fbfd0672e0abf48b1ac387432b9b4c32883cd4b0341d"}, + "cva": {:hex, :cva, "0.2.2", "19ff3fe93c796250f2a3946930e5be62e73019e927aa21c70fcd3c64e9b58466", [:mix], [{:phoenix_live_view, ">= 0.18.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "cb494f3df0bf4a8c1b3652d052d0c4dc5111ef6981f542cc22210f639bfbfcda"}, "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"}, "decorator": {:hex, :decorator, "1.4.0", "a57ac32c823ea7e4e67f5af56412d12b33274661bb7640ec7fc882f8d23ac419", [:mix], [], "hexpm", "0a07cedd9083da875c7418dea95b78361197cf2bf3211d743f6f7ce39656597f"}, "dialyxir": {:hex, :dialyxir, "1.4.4", "fb3ce8741edeaea59c9ae84d5cec75da00fa89fe401c72d6e047d11a61f65f70", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "cd6111e8017ccd563e65621a4d9a4a1c5cd333df30cebc7face8029cacb4eff6"}, @@ -55,7 +55,7 @@ "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, "makeup_html": {:hex, :makeup_html, "0.1.2", "19d4050c0978a4f1618ffe43054c0049f91fe5feeb9ae8d845b5dc79c6008ae5", [:mix], [{:makeup, "~> 1.2", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "b7fb9afedd617d167e6644a0430e49c1279764bfd3153da716d4d2459b0998c5"}, - "mbta_metro": {:hex, :mbta_metro, "0.0.65", "add029569a8e386f66c08d001e7fb11a14e26c2308e3f47a14baebde4822769c", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: false]}, {:heroicons, "0.5.6", [hex: :heroicons, repo: "hexpm", optional: true]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "1.0.0-rc.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_storybook, "0.6.4", [hex: :phoenix_storybook, repo: "hexpm", optional: false]}, {:timex, "3.7.11", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "22b4488c60c48b5638a617a8375fe2c3f27dd9b37452669c00f7a0d55abe7157"}, + "mbta_metro": {:hex, :mbta_metro, "0.1.11", "1ab2cfef7e80594e9f5d3d3239b16e6061cba7b09e893a3ec49c80073422c446", [:mix], [{:cva, "0.2.2", [hex: :cva, repo: "hexpm", optional: false]}, {:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: false]}, {:heroicons, "0.5.6", [hex: :heroicons, repo: "hexpm", optional: true]}, {:jason, "1.4.4", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix, "1.7.14", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_live_view, "1.0.0-rc.6", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:phoenix_storybook, "0.6.4", [hex: :phoenix_storybook, repo: "hexpm", optional: false]}, {:timex, "3.7.11", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm", "99c31966dc0322a171e3715dcbbc41b185998dc0f1ded906b0d4680f1b9ac19b"}, "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},