diff --git a/app/components/goals/status_pill_component.rb b/app/components/goals/status_pill_component.rb index a1e9e3490..3c764e97e 100644 --- a/app/components/goals/status_pill_component.rb +++ b/app/components/goals/status_pill_component.rb @@ -1,16 +1,18 @@ class Goals::StatusPillComponent < ApplicationComponent - # Text colors here intentionally use palette steps (green-700 / yellow-700 / - # gray-700) rather than `text-success` / `text-warning` / `text-secondary` - # tokens because the functional tokens drop below WCAG 1.4.3 4.5:1 on tinted - # surfaces in light mode (~2.88:1 / 3.0:1 / 4.16:1). Local override only; - # revert once we-promise/sure#1736 lands token-level fixes. + # Text colors here intentionally use palette steps (green/yellow/gray-700) + # instead of the `text-success` / `text-warning` / `text-secondary` tokens + # because the functional tokens drop below WCAG 1.4.3 4.5:1 on tinted + # surfaces in light mode (~2.88:1 / 3.0:1 / 4.16:1). Each variant carries + # a theme-dark: override so the dark-700 text doesn't disappear against + # the dark-mode tinted surface. Local override only; revert once + # we-promise/sure#1736 lands token-level fixes. VARIANTS = { - on_track: { classes: "bg-green-500/10 text-green-700", icon: "circle-check" }, - behind: { classes: "bg-yellow-500/10 text-yellow-700", icon: "triangle-alert" }, - reached: { classes: "bg-green-500/10 text-green-700", icon: "star" }, - no_target_date: { classes: "bg-surface-inset text-gray-700", icon: "infinity" }, - paused: { classes: "bg-surface-inset text-gray-700", icon: "pause" }, - archived: { classes: "bg-surface-inset text-gray-700", icon: "archive" } + on_track: { classes: "bg-green-500/10 text-green-700 theme-dark:text-green-300", icon: "circle-check" }, + behind: { classes: "bg-yellow-500/10 text-yellow-700 theme-dark:text-yellow-300", icon: "triangle-alert" }, + reached: { classes: "bg-green-500/10 text-green-700 theme-dark:text-green-300", icon: "star" }, + no_target_date: { classes: "bg-surface-inset text-gray-700 theme-dark:text-gray-200", icon: "infinity" }, + paused: { classes: "bg-surface-inset text-gray-700 theme-dark:text-gray-200", icon: "pause" }, + archived: { classes: "bg-surface-inset text-gray-700 theme-dark:text-gray-200", icon: "archive" } }.freeze def initialize(goal:) diff --git a/app/views/goals/_color_picker.html.erb b/app/views/goals/_color_picker.html.erb new file mode 100644 index 000000000..1d8fdb684 --- /dev/null +++ b/app/views/goals/_color_picker.html.erb @@ -0,0 +1,16 @@ +<%# locals: (form:, colors:) %> +
+ + + <%= t("goals.form_stepper.step1.fields.color") %> + <%= icon("chevron-down", size: "sm") %> + +
+ <% colors.each do |c| %> + + <% end %> +
+
diff --git a/app/views/goals/_form_edit.html.erb b/app/views/goals/_form_edit.html.erb index b0cf4fa26..47bc918e5 100644 --- a/app/views/goals/_form_edit.html.erb +++ b/app/views/goals/_form_edit.html.erb @@ -50,18 +50,7 @@ -
- <%= t("goals.form_stepper.step1.fields.color") %> -
- <% Goal::COLORS.each do |c| %> - - <% end %> -
-
+ <%= render "color_picker", form: f, colors: Goal::COLORS %> <%= f.text_area :notes, label: t("goals.form_stepper.step1.fields.notes"), diff --git a/app/views/goals/_form_stepper.html.erb b/app/views/goals/_form_stepper.html.erb index f1df2e6c6..7f87a5873 100644 --- a/app/views/goals/_form_stepper.html.erb +++ b/app/views/goals/_form_stepper.html.erb @@ -104,7 +104,7 @@ placeholder: t("goals.form_stepper.step1.fields.notes_placeholder") %> <% end %> - <%= f.hidden_field :color %> + <%= render "color_picker", form: f, colors: Goal::COLORS %> -
+
- <%= render DS::Button.new( - text: t("goals.form_stepper.continue"), - variant: "primary", - icon: "arrow-right", - icon_position: :right, - data: { - goal_stepper_target: "footerRightButton", - action: "click->goal-stepper#footerRight" - } - ) %> +
+ <%= render DS::Button.new( + text: t("goals.form_stepper.continue"), + variant: "primary", + icon: "arrow-right", + icon_position: :right, + data: { + goal_stepper_target: "footerRightButton", + action: "click->goal-stepper#footerRight" + } + ) %> +