diff --git a/.gitignore b/.gitignore index aee93bf9..a58ff790 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ venv/ pytest.log TODO **/target +**/dist +gui/ui/Cargo.lock +gui/ui/examples/design-system/Cargo.lock diff --git a/gui/ui/Cargo.toml b/gui/ui/Cargo.toml new file mode 100644 index 00000000..6cbae49b --- /dev/null +++ b/gui/ui/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "liana_ui" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +iced = "0.7" +iced_native = "0.8" +iced_lazy = { version = "0.4"} + +[workspace] +members = [ + "examples/*" +] diff --git a/gui/ui/README.md b/gui/ui/README.md new file mode 100644 index 00000000..7ce4d920 --- /dev/null +++ b/gui/ui/README.md @@ -0,0 +1,6 @@ +# `liana_ui` + +UI components used across the liana GUI iced application. + +An wasm compatible example of the design system can be found in +`./examples/design-system` diff --git a/gui/ui/examples/design-system/Cargo.toml b/gui/ui/examples/design-system/Cargo.toml new file mode 100644 index 00000000..57c6c389 --- /dev/null +++ b/gui/ui/examples/design-system/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "design-system" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +iced = "0.7" +iced_native = "0.8" +web-sys = "0.3.61" +liana_ui = { path = "../.." } diff --git a/gui/ui/examples/design-system/README.md b/gui/ui/examples/design-system/README.md new file mode 100644 index 00000000..c604a44b --- /dev/null +++ b/gui/ui/examples/design-system/README.md @@ -0,0 +1,7 @@ +## Use WASM + +`trunk serve` + +to build for a directory on a distant server + +`trunk build --public-url /design-system` diff --git a/gui/ui/examples/design-system/index.html b/gui/ui/examples/design-system/index.html new file mode 100644 index 00000000..eec96dd9 --- /dev/null +++ b/gui/ui/examples/design-system/index.html @@ -0,0 +1,18 @@ + + + + + + Liana design system + + + + + + + diff --git a/gui/ui/examples/design-system/src/main.rs b/gui/ui/examples/design-system/src/main.rs new file mode 100644 index 00000000..705afdde --- /dev/null +++ b/gui/ui/examples/design-system/src/main.rs @@ -0,0 +1,172 @@ +mod section; + +use iced::widget::{button, column, container, radio, row, text, Column, Space}; +use iced::{executor, Application, Command, Length, Settings, Subscription}; +use liana_ui::{theme, widget::Element}; + +pub fn main() -> iced::Result { + DesignSystem::run(Settings::with_flags(Config {})) +} + +struct Config {} + +#[derive(Default)] +struct DesignSystem { + theme: theme::Theme, + sections: Vec>, + current: usize, +} + +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum ThemeType { + Light, + Dark, +} + +#[derive(Debug, Clone)] +pub enum Message { + ThemeChanged(ThemeType), + Event(iced_native::Event), + Section(usize), + Ignore, +} + +impl Application for DesignSystem { + type Message = Message; + type Theme = theme::Theme; + type Flags = Config; + type Executor = executor::Default; + + fn title(&self) -> String { + String::from("Liana - Design System") + } + + fn new(_config: Config) -> (Self, Command) { + let app = Self { + theme: theme::Theme::Light, + sections: vec![ + Box::new(section::Overview {}), + Box::new(section::Colors {}), + Box::new(section::Buttons {}), + ], + current: 0, + }; + #[cfg(target_arch = "wasm32")] + { + use iced_native::{command, window}; + let window = web_sys::window().unwrap(); + let (width, height) = ( + (window.inner_width().unwrap().as_f64().unwrap()) as u32, + (window.inner_height().unwrap().as_f64().unwrap()) as u32, + ); + ( + app, + Command::single(command::Action::Window(window::Action::Resize { + width, + height, + })), + ) + } + #[cfg(not(target_arch = "wasm32"))] + (app, Command::none()) + } + + fn update(&mut self, message: Message) -> Command { + match message { + Message::ThemeChanged(theme) => { + self.theme = match theme { + ThemeType::Light => theme::Theme::Light, + ThemeType::Dark => theme::Theme::Dark, + } + } + Message::Section(i) => { + if self.sections.get(i).is_some() { + self.current = i; + } + } + Message::Event(iced::Event::Window(iced_native::window::Event::Resized { + width, + height, + })) => { + #[cfg(target_arch = "wasm32")] + { + use iced_native::{command, window}; + return Command::single(command::Action::Window(window::Action::Resize { + width, + height, + })); + } + } + _ => {} + } + Command::none() + } + + fn subscription(&self) -> Subscription { + iced_native::subscription::events().map(Self::Message::Event) + } + + fn view(&self) -> Element { + let sidebar = container( + column![ + [ThemeType::Light, ThemeType::Dark].iter().fold( + column![text("Choose a theme:")].spacing(10), + |column, theme| { + column.push(radio( + format!("{theme:?}"), + *theme, + Some(match self.theme { + theme::Theme::Light => ThemeType::Light, + theme::Theme::Dark => ThemeType::Dark, + }), + Message::ThemeChanged, + )) + }, + ), + Space::with_height(Length::Units(100)), + self.sections.iter().enumerate().fold( + Column::new().spacing(10), + |col, (i, section)| col.push( + button( + container(text(section.title())) + .width(Length::Fill) + .padding(5) + ) + .style(if i == self.current { + theme::Button::Primary + } else { + theme::Button::Transparent + }) + .on_press(Message::Section(i)) + .width(Length::Units(200)) + ) + ) + ] + .spacing(20), + ) + .padding(20) + .style(theme::Container::Foreground) + .height(Length::Fill); + + container(row![ + sidebar.width(Length::Units(200)), + Space::with_width(Length::Units(150)), + column![ + Space::with_height(Length::Units(150)), + container(self.sections[self.current].view()).width(Length::Fill) + ] + ]) + .width(Length::Fill) + .height(Length::Fill) + .into() + } + + fn theme(&self) -> theme::Theme { + self.theme.clone() + } +} + +pub trait Section { + fn title(&self) -> &'static str; + fn view(&self) -> Element; +} diff --git a/gui/ui/examples/design-system/src/section.rs b/gui/ui/examples/design-system/src/section.rs new file mode 100644 index 00000000..516b6630 --- /dev/null +++ b/gui/ui/examples/design-system/src/section.rs @@ -0,0 +1,104 @@ +use iced::{ + alignment, + widget::{button, column, container, row, Space}, + Alignment, Length, +}; +use liana_ui::{color, text::*, theme, widget::Element}; + +use super::{Message, Section}; + +pub struct Overview {} + +impl Section for Overview { + fn title(&self) -> &'static str { + "Overview" + } + + fn view(&self) -> Element { + column![ + text("Hello").bold().size(50), + column![text( + "This is the Liana design system for the Iced framework" + )] + .spacing(10) + ] + .spacing(100) + .into() + } +} + +pub struct Colors {} + +impl Section for Colors { + fn title(&self) -> &'static str { + "Colors" + } + + fn view(&self) -> Element { + column![ + text(self.title()).bold().size(50), + column![ + color_row(color::BLACK, "BLACK (0,0,0)"), + color_row(color::LIGHT_BLACK, "LIGHT_BLACK #141414 original design"), + color_row(color::GREEN, "GREEN #00FF66 original design"), + color_row(color::DARK_GREY, "DARK_GREY #555555"), + color_row(color::GREY, "GREY #CCCCCC original design"), + color_row(color::LIGHT_GREY, "LIGHT_GREY #E6E6E6 original design"), + color_row(color::RED, "RED #F04359"), + color_row(color::ORANGE, "ORANGE #FFa700") + ] + .spacing(10) + ] + .spacing(100) + .into() + } +} + +fn color_row<'a, T: 'a>(color: iced::Color, label: &'static str) -> Element<'a, T> { + row![ + container(Space::with_width(Length::Units(100))) + .height(Length::Units(100)) + .style(theme::Container::Custom(color)), + text(label) + ] + .spacing(10) + .align_items(Alignment::Center) + .spacing(10) + .into() +} + +pub struct Buttons {} + +impl Section for Buttons { + fn title(&self) -> &'static str { + "Buttons" + } + + fn view(&self) -> Element { + column![ + text(self.title()).bold().size(50), + column![ + button_row(theme::Button::Primary, "Primary"), + button_row(theme::Button::Secondary, "Secondary"), + button_row(theme::Button::Destructive, "Destructive"), + button_row(theme::Button::Transparent, "Transparent") + ] + .spacing(20) + ] + .spacing(100) + .into() + } +} + +fn button_row(style: theme::Button, label: &'static str) -> Element { + button( + container(text(label)) + .width(Length::Fill) + .align_x(alignment::Horizontal::Center), + ) + .width(Length::Units(200)) + .padding(5) + .style(style) + .on_press(Message::Ignore) + .into() +} diff --git a/gui/ui/src/color.rs b/gui/ui/src/color.rs new file mode 100644 index 00000000..69109d73 --- /dev/null +++ b/gui/ui/src/color.rs @@ -0,0 +1,42 @@ +use iced::Color; + +pub const BLACK: Color = iced::Color::BLACK; + +pub const LIGHT_BLACK: Color = Color::from_rgb( + 0x14 as f32 / 255.0, + 0x14 as f32 / 255.0, + 0x14 as f32 / 255.0, +); + +pub const GREEN: Color = Color::from_rgb( + 0x00 as f32 / 255.0, + 0xFF as f32 / 255.0, + 0x66 as f32 / 255.0, +); + +pub const DARK_GREY: Color = Color::from_rgb( + 0x55 as f32 / 255.0, + 0x55 as f32 / 255.0, + 0x55 as f32 / 255.0, +); + +pub const GREY: Color = Color::from_rgb( + 0xCC as f32 / 255.0, + 0xCC as f32 / 255.0, + 0xCC as f32 / 255.0, +); + +pub const LIGHT_GREY: Color = Color::from_rgb( + 0xE6 as f32 / 255.0, + 0xE6 as f32 / 255.0, + 0xE6 as f32 / 255.0, +); + +pub const RED: Color = Color::from_rgb( + 0xF0 as f32 / 255.0, + 0x43 as f32 / 255.0, + 0x59 as f32 / 255.0, +); + +pub const ORANGE: Color = + Color::from_rgb(0xFF as f32 / 255.0, 0xa7 as f32 / 255.0, 0x0 as f32 / 255.0); diff --git a/gui/ui/src/font.rs b/gui/ui/src/font.rs new file mode 100644 index 00000000..eb7555d5 --- /dev/null +++ b/gui/ui/src/font.rs @@ -0,0 +1,11 @@ +use iced::Font; + +pub const BOLD: Font = Font::External { + name: "Bold", + bytes: include_bytes!("../../static/fonts/OpenSans-Bold.ttf"), +}; + +pub const REGULAR: Font = Font::External { + name: "Regular", + bytes: include_bytes!("../../static/fonts/OpenSans-Regular.ttf"), +}; diff --git a/gui/ui/src/lib.rs b/gui/ui/src/lib.rs new file mode 100644 index 00000000..8f1ec600 --- /dev/null +++ b/gui/ui/src/lib.rs @@ -0,0 +1,14 @@ +pub mod color; +pub mod font; +pub mod text; +pub mod theme; + +pub mod widget { + #![allow(dead_code)] + use crate::theme::Theme; + + pub type Renderer = iced::Renderer; + pub type Element<'a, Message> = iced::Element<'a, Message, Renderer>; + pub type Container<'a, Message> = iced::widget::Container<'a, Message, Renderer>; + pub type Button<'a, Message> = iced::widget::Button<'a, Message, Renderer>; +} diff --git a/gui/ui/src/text.rs b/gui/ui/src/text.rs new file mode 100644 index 00000000..a131b188 --- /dev/null +++ b/gui/ui/src/text.rs @@ -0,0 +1,24 @@ +use crate::{font, theme::Theme}; +use std::borrow::Cow; + +pub const TEXT_REGULAR_SIZE: u16 = 25; + +pub fn text<'a>(content: impl Into>) -> iced::widget::Text<'a, iced::Renderer> { + iced::widget::Text::new(content) + .font(font::REGULAR) + .size(TEXT_REGULAR_SIZE) +} + +pub trait Text { + fn bold(self) -> Self; + fn small(self) -> Self; +} + +impl Text for iced::widget::Text<'_, iced::Renderer> { + fn bold(self) -> Self { + self.font(font::BOLD) + } + fn small(self) -> Self { + self.size(20) + } +} diff --git a/gui/ui/src/theme.rs b/gui/ui/src/theme.rs new file mode 100644 index 00000000..1f82b477 --- /dev/null +++ b/gui/ui/src/theme.rs @@ -0,0 +1,304 @@ +use iced::{ + application, + widget::{button, container, radio, text}, +}; + +use super::color; + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Default)] +pub enum Theme { + #[default] + Dark, + Light, +} + +impl application::StyleSheet for Theme { + type Style = (); + + fn appearance(&self, _style: &Self::Style) -> application::Appearance { + match self { + Theme::Light => application::Appearance { + background_color: color::LIGHT_GREY, + text_color: color::LIGHT_BLACK, + }, + Theme::Dark => application::Appearance { + background_color: color::LIGHT_BLACK, + text_color: color::LIGHT_GREY, + }, + } + } +} + +#[derive(Clone, Copy, Default)] +pub enum Text { + #[default] + Default, + Color(iced::Color), +} + +impl From for Text { + fn from(color: iced::Color) -> Self { + Text::Color(color) + } +} + +impl text::StyleSheet for Theme { + type Style = Text; + + fn appearance(&self, style: Self::Style) -> text::Appearance { + match style { + Text::Default => Default::default(), + Text::Color(c) => text::Appearance { color: Some(c) }, + } + } +} + +#[derive(Debug, Copy, Clone, Default)] +pub enum Container { + #[default] + Transparent, + Background, + Foreground, + Border, + Custom(iced::Color), +} + +impl container::StyleSheet for Theme { + type Style = Container; + fn appearance(&self, style: &Self::Style) -> iced::widget::container::Appearance { + match self { + Theme::Light => match style { + Container::Transparent => container::Appearance { + background: iced::Color::TRANSPARENT.into(), + ..container::Appearance::default() + }, + Container::Background => container::Appearance { + background: color::LIGHT_GREY.into(), + ..container::Appearance::default() + }, + Container::Foreground => container::Appearance { + background: color::GREY.into(), + ..container::Appearance::default() + }, + Container::Border => container::Appearance { + background: iced::Color::TRANSPARENT.into(), + border_width: 1.0, + border_color: color::LIGHT_BLACK.into(), + ..container::Appearance::default() + }, + Container::Custom(c) => container::Appearance { + background: (*c).into(), + ..container::Appearance::default() + }, + }, + Theme::Dark => match style { + Container::Transparent => container::Appearance { + background: iced::Color::TRANSPARENT.into(), + ..container::Appearance::default() + }, + Container::Background => container::Appearance { + background: color::LIGHT_BLACK.into(), + ..container::Appearance::default() + }, + Container::Foreground => container::Appearance { + background: color::BLACK.into(), + ..container::Appearance::default() + }, + Container::Border => container::Appearance { + background: iced::Color::TRANSPARENT.into(), + border_width: 1.0, + border_color: color::LIGHT_GREY.into(), + ..container::Appearance::default() + }, + Container::Custom(c) => container::Appearance { + background: (*c).into(), + ..container::Appearance::default() + }, + }, + } + } +} + +#[derive(Default)] +pub struct Radio {} +impl radio::StyleSheet for Theme { + type Style = Radio; + + fn active(&self, _style: &Self::Style, _is_selected: bool) -> radio::Appearance { + radio::Appearance { + background: iced::Color::TRANSPARENT.into(), + dot_color: color::GREEN, + border_width: 1.0, + border_color: color::GREEN, + text_color: None, + } + } + + fn hovered(&self, style: &Self::Style, is_selected: bool) -> radio::Appearance { + let active = self.active(style, is_selected); + radio::Appearance { + dot_color: color::GREEN, + background: iced::Color::TRANSPARENT.into(), + ..active + } + } +} + +#[derive(Default)] +pub enum Button { + #[default] + Primary, + Secondary, + Destructive, + Transparent, +} + +impl button::StyleSheet for Theme { + type Style = Button; + + fn active(&self, style: &Self::Style) -> button::Appearance { + match self { + Theme::Light => match style { + Button::Primary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::LIGHT_BLACK.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + Button::Secondary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: iced::Color::TRANSPARENT.into(), + border_radius: 10.0, + border_width: 1.0, + border_color: color::DARK_GREY, + text_color: color::LIGHT_BLACK, + }, + Button::Destructive => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::RED.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + Button::Transparent => button::Appearance { + shadow_offset: iced::Vector::default(), + background: iced::Color::TRANSPARENT.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + }, + Theme::Dark => match style { + Button::Primary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::GREY.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + Button::Secondary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::LIGHT_BLACK.into(), + border_radius: 10.0, + border_width: 1.0, + border_color: color::LIGHT_GREY, + text_color: color::LIGHT_GREY, + }, + Button::Destructive => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::RED.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + Button::Transparent => button::Appearance { + shadow_offset: iced::Vector::default(), + background: iced::Color::TRANSPARENT.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + }, + } + } + + fn hovered(&self, style: &Self::Style) -> button::Appearance { + match self { + Theme::Light => match style { + Button::Primary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::LIGHT_BLACK.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + Button::Secondary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::LIGHT_BLACK.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + Button::Destructive => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::RED.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + Button::Transparent => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::DARK_GREY.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + }, + Theme::Dark => match style { + Button::Primary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::GREY.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + Button::Secondary => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::GREY.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + Button::Destructive => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::RED.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_BLACK, + }, + Button::Transparent => button::Appearance { + shadow_offset: iced::Vector::default(), + background: color::DARK_GREY.into(), + border_radius: 10.0, + border_width: 0.0, + border_color: iced::Color::TRANSPARENT, + text_color: color::LIGHT_GREY, + }, + }, + } + } +} diff --git a/gui/ui/static/fonts/LICENSE.txt b/gui/ui/static/fonts/LICENSE.txt new file mode 100644 index 00000000..75b52484 --- /dev/null +++ b/gui/ui/static/fonts/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/gui/ui/static/fonts/OpenSans-Bold.ttf b/gui/ui/static/fonts/OpenSans-Bold.ttf new file mode 100644 index 00000000..efdd5e84 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-Bold.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-BoldItalic.ttf b/gui/ui/static/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 00000000..9bf9b4e9 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-BoldItalic.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-ExtraBold.ttf b/gui/ui/static/fonts/OpenSans-ExtraBold.ttf new file mode 100644 index 00000000..67fcf0fb Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-ExtraBold.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-ExtraBoldItalic.ttf b/gui/ui/static/fonts/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 00000000..08672280 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-ExtraBoldItalic.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-Italic.ttf b/gui/ui/static/fonts/OpenSans-Italic.ttf new file mode 100644 index 00000000..11785670 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-Italic.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-Light.ttf b/gui/ui/static/fonts/OpenSans-Light.ttf new file mode 100644 index 00000000..6580d3a1 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-Light.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-LightItalic.ttf b/gui/ui/static/fonts/OpenSans-LightItalic.ttf new file mode 100644 index 00000000..1e0c3319 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-LightItalic.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-Regular.ttf b/gui/ui/static/fonts/OpenSans-Regular.ttf new file mode 100644 index 00000000..29bfd35a Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-Regular.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-SemiBold.ttf b/gui/ui/static/fonts/OpenSans-SemiBold.ttf new file mode 100644 index 00000000..54e7059c Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-SemiBold.ttf differ diff --git a/gui/ui/static/fonts/OpenSans-SemiBoldItalic.ttf b/gui/ui/static/fonts/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 00000000..aebcf142 Binary files /dev/null and b/gui/ui/static/fonts/OpenSans-SemiBoldItalic.ttf differ diff --git a/gui/ui/static/icons/LICENSE.md b/gui/ui/static/icons/LICENSE.md new file mode 100644 index 00000000..0add0a0e --- /dev/null +++ b/gui/ui/static/icons/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 The Bootstrap Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/gui/ui/static/icons/README.md b/gui/ui/static/icons/README.md new file mode 100644 index 00000000..54666a2f --- /dev/null +++ b/gui/ui/static/icons/README.md @@ -0,0 +1,6 @@ +# Icons + +From the getbootstrap.com repository. +Converted from .woff to ttf with https://raw.githubusercontent.com/hanikesn/woff2otf/master/woff2otf.py + +Use http://mathew-kurian.github.io/CharacterMap/ to check Unicode. diff --git a/gui/ui/static/icons/bootstrap-icons.ttf b/gui/ui/static/icons/bootstrap-icons.ttf new file mode 100644 index 00000000..d8768998 Binary files /dev/null and b/gui/ui/static/icons/bootstrap-icons.ttf differ