-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/all panels styling #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
213f209
Style Images panel
cavenel 3f89b90
Style Labels panel
cavenel 5c070f3
feat: Style table panel
cavenel 558c038
Merge branch 'development' into feat/all-panels-styling
cavenel b13e304
fix: Rename loader into storage
cavenel 91eb141
fix: Formatting
cavenel 7f82bd2
Update apps/tissuumaps/src/components/panels/ImagesPanel/index.tsx
cavenel 3f3f4d3
fix: Add back comment
cavenel e494cfd
Merge branch 'feat/all-panels-styling' of https://github.com/Tissuuma…
cavenel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
apps/tissuumaps/src/components/panels/ImagesPanel/ImagesLayersPanel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { type Image } from "@tissuumaps/core"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| import { Fieldset, FieldsetLegend } from "../../common/fieldset"; | ||
|
|
||
| export type ImagesLayersPanelProps = { | ||
| image: Image; | ||
| className?: string; | ||
| }; | ||
|
|
||
| export function ImagesLayersPanel({ className }: ImagesLayersPanelProps) { | ||
| return ( | ||
| <Fieldset | ||
| className={cn("flex flex-col gap-y-2 border rounded-md p-2", className)} | ||
| > | ||
| <FieldsetLegend className="font-medium text-foreground"> | ||
| Layers | ||
| </FieldsetLegend> | ||
| </Fieldset> | ||
| ); | ||
| } |
15 changes: 0 additions & 15 deletions
15
apps/tissuumaps/src/components/panels/ImagesPanel/ImagesPanelItem.tsx
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
apps/tissuumaps/src/components/panels/ImagesPanel/ImagesSettingsPanel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { type Image } from "@tissuumaps/core"; | ||
|
|
||
| import { Input } from "@/components/ui/input"; | ||
| import { Switch } from "@/components/ui/switch"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| import { useTissUUmaps } from "../../../store"; | ||
| import { Field, FieldLabel } from "../../common/field"; | ||
| import { Fieldset, FieldsetLegend } from "../../common/fieldset"; | ||
|
|
||
| export type ImagesSettingsPanelProps = { | ||
| image: Image; | ||
| className?: string; | ||
| }; | ||
|
|
||
| export function ImagesSettingsPanel({ | ||
| image, | ||
| className, | ||
| }: ImagesSettingsPanelProps) { | ||
| const updateImage = useTissUUmaps((state) => state.updateImage); | ||
|
|
||
| return ( | ||
| <Fieldset | ||
| className={cn("flex flex-col gap-y-2 border rounded-md p-2", className)} | ||
| > | ||
| <FieldsetLegend className="font-medium text-foreground"> | ||
| Settings | ||
| </FieldsetLegend> | ||
| <Field> | ||
| <FieldLabel>Name</FieldLabel> | ||
| <Input | ||
| value={image.name} | ||
| onChange={(event) => | ||
| updateImage(image.id, { name: event.target.value }) | ||
| } | ||
| /> | ||
| </Field> | ||
| <Field> | ||
| <FieldLabel>Visibility</FieldLabel> | ||
| <div className="flex flex-row items-center gap-x-2"> | ||
| <Switch | ||
| checked={image.visibility} | ||
| onCheckedChange={(checked) => | ||
| updateImage(image.id, { visibility: checked }) | ||
| } | ||
| /> | ||
| {image.visibility ? "Visible" : "Hidden"} | ||
| </div> | ||
| </Field> | ||
| <Field> | ||
| <FieldLabel>Opacity</FieldLabel> | ||
| <Input | ||
| type="number" | ||
| min={0} | ||
| max={1} | ||
| step={0.01} | ||
| value={image.opacity} | ||
| onChange={(event) => { | ||
| const opacity = event.target.valueAsNumber; | ||
| if (Number.isFinite(opacity)) { | ||
| updateImage(image.id, { | ||
| opacity: Math.min(Math.max(0, opacity), 1), | ||
| }); | ||
| } | ||
| }} | ||
| /> | ||
| </Field> | ||
| </Fieldset> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
apps/tissuumaps/src/components/panels/LabelsPanel/LabelsLayersPanel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { type Labels } from "@tissuumaps/core"; | ||
|
|
||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| import { Fieldset, FieldsetLegend } from "../../common/fieldset"; | ||
|
|
||
| export type LabelsLayersPanelProps = { | ||
| labels: Labels; | ||
| className?: string; | ||
| }; | ||
|
|
||
| export function LabelsLayersPanel({ className }: LabelsLayersPanelProps) { | ||
| return ( | ||
| <Fieldset | ||
| className={cn("flex flex-col gap-y-2 border rounded-md p-2", className)} | ||
| > | ||
| <FieldsetLegend className="font-medium text-foreground"> | ||
| Layers | ||
| </FieldsetLegend> | ||
| </Fieldset> | ||
| ); | ||
| } |
15 changes: 0 additions & 15 deletions
15
apps/tissuumaps/src/components/panels/LabelsPanel/LabelsPanelItem.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These icon-only buttons (visibility toggle, and similarly the delete icon button) should have an accessible name (e.g., aria-label and/or a visually-hidden text node). Relying on the icon alone (or on a title attribute) is not sufficient for screen readers.