Skip to content

Commit 8c0487d

Browse files
authored
Fix date picker component import and add tests for dx components add --all to CI (#142)
* add harness * Fix date picker and add checks to CI * fix all components CI branches * fix imports for the preview * disable ci check until dx is updated * fix components mod
1 parent 0067c31 commit 8c0487d

File tree

15 files changed

+304
-5
lines changed

15 files changed

+304
-5
lines changed

.DS_Store

2 KB
Binary file not shown.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# name: Add All Components
2+
3+
# on:
4+
# push:
5+
# branches:
6+
# - main
7+
# paths:
8+
# - /**
9+
# - preview/**/*.rs
10+
# - preview/**/Cargo.toml
11+
# - primitives/**/*.rs
12+
# - primitives/**/Cargo.toml
13+
# - .github/**
14+
# - Cargo.toml
15+
16+
# pull_request:
17+
# types: [opened, synchronize, reopened, ready_for_review]
18+
# branches:
19+
# - main
20+
# paths:
21+
# - /**
22+
# - preview/**/*.rs
23+
# - preview/**/Cargo.toml
24+
# - primitives/**/*.rs
25+
# - primitives/**/Cargo.toml
26+
# - .github/**
27+
# - Cargo.toml
28+
29+
# concurrency:
30+
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
31+
# cancel-in-progress: true
32+
33+
# jobs:
34+
# deploy-preview:
35+
# if: github.event.pull_request.draft == false
36+
# name: Add All Components
37+
# runs-on: ubuntu-latest
38+
# env:
39+
# CARGO_INCREMENTAL: 1
40+
# steps:
41+
# - name: Checkout code
42+
# uses: actions/checkout@v4
43+
# with:
44+
# ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
45+
# fetch-depth: 0
46+
# - uses: awalsh128/cache-apt-pkgs-action@latest
47+
# with:
48+
# packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
49+
# version: 1.0
50+
# - name: Install Rust
51+
# uses: dtolnay/rust-toolchain@master
52+
# with:
53+
# toolchain: stable
54+
# targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
55+
# - uses: Swatinem/rust-cache@v2
56+
# with:
57+
# cache-all-crates: "true"
58+
# cache-on-failure: "false"
59+
# - uses: cargo-bins/cargo-binstall@main
60+
# - name: Install CLI
61+
# run: cargo binstall dioxus-cli -y --force --version 0.7.0-rc.3
62+
# - name: Add components and check
63+
# run: cd test-harness && dx components add --all --path .. --force && cargo check --all-features

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
cache-on-failure: "false"
4444
- uses: cargo-bins/cargo-binstall@main
4545
- name: Install CLI
46-
run: cargo binstall dioxus-cli -y --force --version 0.7.0-rc.0
46+
run: cargo binstall dioxus-cli -y --force --version 0.7.0-rc.3
4747
- name: Build
4848
run: cd preview && dx build --web --release --base-path "components/pr-preview/pr-${{ github.event.pull_request.number }}/"
4949
- name: Copy output

Cargo.lock

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
resolver = "3"
3-
members = ["primitives", "preview"]
3+
members = ["primitives", "preview", "test-harness"]
44

55
[workspace.dependencies]
66
dioxus-primitives = { path = "primitives" }

preview/src/components/date_picker/component.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use dioxus_primitives::{
66
ContentAlign,
77
};
88

9-
use super::super::calendar::component::*;
10-
use super::super::popover::component::*;
9+
use super::super::calendar::*;
10+
use super::super::popover::*;
1111

1212
#[component]
1313
pub fn DatePicker(props: DatePickerProps) -> Element {

preview/src/components/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ macro_rules! examples {
44
$(
55
pub(crate) mod $name {
66
pub(crate) mod component;
7+
#[allow(unused)]
8+
pub use component::*;
79
pub(crate) mod variants {
810
pub(crate) mod main;
911
$(

test-harness/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target
4+
.DS_Store
5+
6+
# These are backup files generated by rustfmt
7+
**/*.rs.bk

test-harness/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "test-harness"
3+
version = "0.1.0"
4+
authors = ["Evan Almloff <[email protected]>"]
5+
edition = "2021"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
dioxus = { version = "0.7.0-rc.1", features = [] }
11+
dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false, features = ["router"] }
12+
13+
[features]
14+
default = ["web"]
15+
web = ["dioxus/web"]
16+
desktop = ["dioxus/desktop"]
17+
mobile = ["dioxus/mobile"]
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* This file contains the global styles for the styled dioxus components. You only
2+
* need to import this file once in your project root.
3+
*/
4+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
5+
6+
body {
7+
padding: 0;
8+
margin: 0;
9+
background-color: var(--primary-color);
10+
color: var(--secondary-color-4);
11+
font-family: Inter, sans-serif;
12+
font-optical-sizing: auto;
13+
font-style: normal;
14+
font-weight: 400;
15+
}
16+
17+
@media (prefers-color-scheme: dark) {
18+
:root {
19+
--dark: initial;
20+
--light: ;
21+
}
22+
}
23+
24+
@media (prefers-color-scheme: light) {
25+
:root {
26+
--dark: ;
27+
--light: initial;
28+
}
29+
}
30+
31+
:root {
32+
/* Primary colors */
33+
--primary-color: var(--dark, #000) var(--light, #fff);
34+
--primary-color-1: var(--dark, #0e0e0e) var(--light, #fbfbfb);
35+
--primary-color-2: var(--dark, #0a0a0a) var(--light, #fff);
36+
--primary-color-3: var(--dark, #141313) var(--light, #f8f8f8);
37+
--primary-color-4: var(--dark, #1a1a1a) var(--light, #f8f8f8);
38+
--primary-color-5: var(--dark, #262626) var(--light, #f5f5f5);
39+
--primary-color-6: var(--dark, #232323) var(--light, #e5e5e5);
40+
--primary-color-7: var(--dark, #3e3e3e) var(--light, #b0b0b0);
41+
42+
/* Secondary colors */
43+
--secondary-color: var(--dark, #fff) var(--light, #000);
44+
--secondary-color-1: var(--dark, #fafafa) var(--light, #000);
45+
--secondary-color-2: var(--dark, #e6e6e6) var(--light, #0d0d0d);
46+
--secondary-color-3: var(--dark, #dcdcdc) var(--light, #2b2b2b);
47+
--secondary-color-4: var(--dark, #d4d4d4) var(--light, #111);
48+
--secondary-color-5: var(--dark, #a1a1a1) var(--light, #848484);
49+
--secondary-color-6: var(--dark, #5d5d5d) var(--light, #d0d0d0);
50+
51+
/* Highlight colors */
52+
--focused-border-color: var(--dark, #2b7fff) var(--light, #2b7fff);
53+
--primary-success-color: var(--dark, #02271c) var(--light, #ecfdf5);
54+
--secondary-success-color: var(--dark, #b6fae3) var(--light, #10b981);
55+
--primary-warning-color: var(--dark, #342203) var(--light, #fffbeb);
56+
--secondary-warning-color: var(--dark, #feeac7) var(--light, #f59e0b);
57+
--primary-error-color: var(--dark, #a22e2e) var(--light, #dc2626);
58+
--secondary-error-color: var(--dark, #9b1c1c) var(--light, #ef4444);
59+
--contrast-error-color: var(--dark, var(--secondary-color-3))
60+
var(--light, var(--primary-color));
61+
--primary-info-color: var(--dark, var(--primary-color-5))
62+
var(--light, var(--primary-color));
63+
--secondary-info-color: var(--dark, var(--primary-color-7))
64+
var(--light, var(--secondary-color-3));
65+
}
66+
67+
/* Modern browsers with `scrollbar-*` support */
68+
@supports (scrollbar-width: auto) {
69+
:not(:hover) {
70+
scrollbar-color: rgb(0 0 0 / 0%) rgb(0 0 0 / 0%);
71+
}
72+
73+
:hover {
74+
scrollbar-color: var(--secondary-color-2) rgb(0 0 0 / 0%);
75+
}
76+
}
77+
78+
/* Legacy browsers with `::-webkit-scrollbar-*` support */
79+
@supports selector(::-webkit-scrollbar) {
80+
:root::-webkit-scrollbar-track {
81+
background: transparent;
82+
}
83+
}

0 commit comments

Comments
 (0)