diff --git a/.templui.json b/.templui.json index 171c637..5326cba 100644 --- a/.templui.json +++ b/.templui.json @@ -1,5 +1,5 @@ { - "componentsDir": "server/web/components", - "utilsDir": "server/web/utils", + "componentsDir": "server/web/templui/components", + "utilsDir": "server/web/templui/utils", "moduleName": "git.jmbit.de/jmb/scanfile" -} \ No newline at end of file +} diff --git a/Makefile b/Makefile index c82c186..67963e4 100644 --- a/Makefile +++ b/Makefile @@ -2,43 +2,40 @@ all: deps build -deps: +deps: ## Install build dependencies go mod tidy go install github.com/a-h/templ/cmd/templ@latest -build: +build: ## Build and compile echo "Building..." tailwindcss -o server/web/assets/styles.css templ generate go build -o main.out server/main.go -# Run the application -run: +run: ## Run the application go run main.go -# Test the application -test: +test: ## Run test echo "Testing..." go test ./tests/... -v -# Clean the binary -clean: +clean: ## Delete build artifacts echo "Cleaning..." rm -f main.out rm -rf sessions/* rm -rf storage/* -dev: +dev: ## Start templ-dev tailwind-dev and watch make -j3 templ-dev tailwind-dev watch -templ-dev: +templ-dev: ## Watch & Live rebuild of templ templ generate --watch --proxy="http://localhost:8080" --open-browser=false -tailwind-dev: +tailwind-dev: ##Live rebuild of tailwind tailwindcss -o server/web/assets/styles.css -i input.css --watch # Live Reload -watch: +watch: ##Live reload with air @if command -v air > /dev/null; then \ air; \ echo "Watching...";\ @@ -54,4 +51,14 @@ watch: fi; \ fi -.PHONY: all build run test clean +help: ## Display this Help. + @awk 'BEGIN { \ + FS = ":.*##"; \ + printf "\nUsage:\n make \n" \ + } \ + /^[a-zA-Z_-]+:.*?##/ { \ + printf " %-20s %s\n", $$1, $$2 \ + } \ + ' $(MAKEFILE_LIST) + +.PHONY: all build run test clean help diff --git a/config.toml b/config.toml index bae0f3b..5481256 100644 --- a/config.toml +++ b/config.toml @@ -11,7 +11,10 @@ user = "scanfile" port = 5432 password = "Sequel-Gutless-Epilogue1-Scorch-Nuclei" database = "scanfile" +debug = true [store] path = "./storage/files/" +[processing] +executors = 5 diff --git a/go.mod b/go.mod index ab2e30e..d4e1c79 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,17 @@ module git.jmbit.de/jmb/scanfile go 1.24.1 require ( + github.com/Oudwins/tailwind-merge-go v0.2.1 github.com/a-h/templ v0.3.865 github.com/google/uuid v1.6.0 github.com/gorilla/securecookie v1.1.2 github.com/gorilla/sessions v1.4.0 github.com/h2non/filetype v1.1.3 + github.com/jackc/pgx/v5 v5.7.5 github.com/joho/godotenv v1.5.1 github.com/lib/pq v1.10.9 github.com/spf13/viper v1.20.1 + golang.org/x/crypto v0.38.0 xorm.io/xorm v1.3.9 ) @@ -20,6 +23,8 @@ require ( github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/goccy/go-json v0.10.5 // indirect github.com/golang/snappy v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mattn/go-sqlite3 v1.14.27 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -35,7 +40,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.25.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect xorm.io/builder v0.3.13 // indirect ) diff --git a/go.sum b/go.sum index 482e4e1..26f70a4 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= +github.com/Oudwins/tailwind-merge-go v0.2.1 h1:jxRaEqGtwwwF48UuFIQ8g8XT7YSualNuGzCvQ89nPFE= +github.com/Oudwins/tailwind-merge-go v0.2.1/go.mod h1:kkZodgOPvZQ8f7SIrlWkG/w1g9JTbtnptnePIh3V72U= github.com/a-h/templ v0.3.865 h1:nYn5EWm9EiXaDgWcMQaKiKvrydqgxDUtT1+4zU2C43A= github.com/a-h/templ v0.3.865/go.mod h1:oLBbZVQ6//Q6zpvSMPTuBK0F3qOtBdFBcGRspcT+VNQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -39,17 +41,22 @@ github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs= +github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= @@ -90,6 +97,7 @@ github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= @@ -98,6 +106,8 @@ github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFd github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= +golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -123,6 +133,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= diff --git a/server/internal/config/config.go b/server/internal/config/config.go index c861571..f7f1d16 100644 --- a/server/internal/config/config.go +++ b/server/internal/config/config.go @@ -42,6 +42,7 @@ func setDefaults() { viper.SetDefault("db.user", "scanfile") viper.SetDefault("db.database", "scanfile") viper.SetDefault("db.password", "CHANGEME") + viper.SetDefault("db.debug", false) viper.SetDefault("store.path", "./storage/files/") } diff --git a/server/internal/database/createFile.go b/server/internal/database/createFile.go new file mode 100644 index 0000000..65a7f90 --- /dev/null +++ b/server/internal/database/createFile.go @@ -0,0 +1,59 @@ +package database + + +import ( + "encoding/hex" + "log/slog" + + "github.com/google/uuid" + "golang.org/x/crypto/blake2b" + + "git.jmbit.de/jmb/scanfile/server/internal/store" +) + + +// CreateFile() creates the filesystem object and the DB entry for a file +func CreateFile(name string, fileBytes []byte, size int64) (File, error) { + file := File{ + Name: name, + Size: size, + } + + bl2hash := blake2b.Sum256(fileBytes) + file.Blake2 = hex.EncodeToString(bl2hash[:]) + fileExists, err := FileAlreadyExists(file.Blake2) + if err != nil { + slog.Error("Could not check if a duplicate exists", "error", err) + err = nil + } + if fileExists { + slog.Info("File seems to already exist") + sameFile, err := FileByBlake2(file.Blake2) + if err != nil { + slog.Error("Could not retrieve duplicate", "error", err) + err = nil + } + return sameFile, nil + } + + //Using UUIDs instead of the file hash to make switching storage backends easier + fileUUID, err := uuid.NewRandom() + if err != nil { + slog.Error("could not save file,", "error", err) + return file, err + } + uuid, err := store.SaveFile(fileUUID.String(), fileBytes) + if err != nil { + return file, err + } + file.Uuid = uuid + + file.MimeType, _ = store.GetFileType(file.Uuid) + + err = file.Insert() + if err != nil { + return file, nil + } + + return file, nil +} diff --git a/server/internal/database/db.go b/server/internal/database/db.go index d77fb28..55fbdf0 100644 --- a/server/internal/database/db.go +++ b/server/internal/database/db.go @@ -8,6 +8,7 @@ import ( _ "github.com/lib/pq" "github.com/spf13/viper" "xorm.io/xorm" + "xorm.io/xorm/log" "xorm.io/xorm/names" ) @@ -33,6 +34,10 @@ func Connect() (*xorm.Engine, error) { if err != nil { slog.Error("Error syncing DB schema", "error", err) } + if viper.GetBool("db.debug") { + engi.SetLogLevel(log.LOG_DEBUG) + engi.ShowSQL(true) + } engine = engi return engi, nil diff --git a/server/internal/database/file.go b/server/internal/database/file.go index 585c902..5495b1c 100644 --- a/server/internal/database/file.go +++ b/server/internal/database/file.go @@ -1,7 +1,8 @@ package database import ( - "mime/multipart" + "fmt" + "log/slog" "time" "git.jmbit.de/jmb/scanfile/server/internal/store" @@ -9,12 +10,13 @@ import ( type File struct { Id int64 - Uuid string //used for file blob storage etc. + Blake2 string `xorm:"unique"`//Used for checking if the file already exists + Uuid string `xorm:"unique"`//used for file blob storage etc. Name string //Name of the file Description string //Any text to add to it for context MimeType string Size int64 - CreatedAt time.Time `xorm:"create"` + CreatedAt time.Time `xorm:"created"` UpdatedAt time.Time `xorm:"updated"` } @@ -24,28 +26,26 @@ func (f File) Insert() error { return err } -// CreateFile() creates the filesystem object and the DB entry for a file -func CreateFile(name string, fileData multipart.File, size int64) (File, error) { - file := File{ - Name: name, - Size: size, - } - uuid, err := store.SaveFile(fileData) - if err != nil { - return file, err - } - file.Uuid = uuid +// Deletes a File +// TODO: Make atomic +func (f File) Delete() error { + err := store.DeleteFile(f.Uuid) + if err != nil { + slog.Error("Could not delete File from disk", "file-uuid", f.Uuid, "file-name", f.Name) + return err + } + slog.Info("Deleted File from disk", "uuid", f.Uuid) + _, err = engine.Delete(f) + if err != nil { + slog.Error("Could not delete File from DB", "file-uuid", f.Uuid, "file-name", f.Name) + return err + } + slog.Info("Deleted File from DB", "file-uuid", f.Uuid) - file.MimeType, _ = store.GetFileType(file.Uuid) - - err = file.Insert() - if err != nil { - return file, nil - } - - return file, nil + return nil } + func FileByID(id int64) (File, error) { file := File{Id: id} success, err := engine.Get(&file) @@ -63,3 +63,30 @@ func FileByUUID(uuid string) (File, error) { } return file, nil } + +func FileByBlake2(hash string) (File, error) { + file := File{Blake2: hash} + success, err := engine.Get(&file) + slog.Info("Getting file for blake2 hash", "success", success, "hash", hash) + if err != nil { + return file, err + } + if success == false { + return file, fmt.Errorf("Record not found") + } + return file, nil +} + +func FileAlreadyExists(blake2 string) (bool, error) { + file := new(File) + count, err := engine.Where("blake2 LIKE ?", blake2).Count(file) + if err != nil { + return false, err + } + if count > 0 { + return true, nil + } else { + return false, nil + } +} + diff --git a/server/internal/database/processingJob.go b/server/internal/database/processingJob.go new file mode 100644 index 0000000..a74691e --- /dev/null +++ b/server/internal/database/processingJob.go @@ -0,0 +1,38 @@ +package database + +import ( + "log/slog" + "time" +) + +type ProcessingJob struct { + Id int64 + FileID int64 + FileUUID string + Created time.Time `xorm:"created"` + Started time.Time + Completed time.Time + Status string //Could be an enum, but who cares + Type string +} + +func (j ProcessingJob) Update() error { + _, err := engine.Update(j) + if err != nil { + slog.Error("Error updating processing job", "error", err, "file-uuid", j.FileUUID, "job-id", j.Id, "job-type", j.Type) + } + return err +} + +func NewProcessingJob(fileID int64, fileUUID string) (ProcessingJob, error) { + job := ProcessingJob{ + FileID: fileID, + } + _, err := engine.InsertOne(job) + if err != nil { + slog.Error("Unable to create new processing job", "file-uuid", fileUUID) + return job, err + } + + return job, nil +} diff --git a/server/internal/database/queries-files.sql b/server/internal/database/queries-files.sql new file mode 100644 index 0000000..78e23b0 --- /dev/null +++ b/server/internal/database/queries-files.sql @@ -0,0 +1,23 @@ +-- name: CreateFile :one +INSERT INTO files ( + name, description, mimetype, size, blake2 +) VALUES ( + $1,$2,$3,$4,$5 +) +ON CONFLICT DO NOTHING -- Handle this in application code +RETURNING *; + +-- name: GetFileByUUID :one +SELECT * +FROM files +WHERE id = $1; + +-- name: GetFileByBlake2 :one +SELECT * +FROM files +WHERE blake2 = $1; + +-- name: UpdateFileDescription :exec +UPDATE files +SET description = $1 +WHERE id = $2; diff --git a/server/internal/database/queries-processing_jobs.sql b/server/internal/database/queries-processing_jobs.sql new file mode 100644 index 0000000..f38867d --- /dev/null +++ b/server/internal/database/queries-processing_jobs.sql @@ -0,0 +1,17 @@ +-- name: CreateProcessingJob :one +INSERT INTO processing_jobs ( + file_id, job_type +) VALUES ($1,$2 ) +RETURNING *; + +-- name: StartProcessingJob :exec +UPDATE processing_jobs +SET started = NOW(), + status = "started" +WHERE id = $1; + +-- name: FinishProcessingJob :exec +UPDATE processing_jobs +SET completed = NOW(), + status = "completed" +WHERE id = $1; diff --git a/server/internal/database/schema.sql b/server/internal/database/schema.sql new file mode 100644 index 0000000..bfc9ce4 --- /dev/null +++ b/server/internal/database/schema.sql @@ -0,0 +1,21 @@ +CREATE EXTENSION IF NOT EXISTS "pgcrypto"; +CREATE TABLE IF NOT EXISTS files ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + name TEXT NOT NULL, + description TEXT, + mimetype TEXT NOT NULL, + size INTEGER NOT NULL, + blake2 BYTEA NOT NULL UNIQUE, + created TIMESTAMP DEFAULT NOW() NOT NULL, + updated TIMESTAMP DEFAULT NOW() NOT NULL +); + +CREATE TABLE IF NOT EXISTS processing_jobs ( + id SERIAL PRIMARY KEY, + file_id UUID REFERENCES files (id), + created TIMESTAMP DEFAULT NOW(), + started TIMESTAMP, + completed TIMESTAMP, + status TEXT, + job_type TEXT +); diff --git a/server/internal/processing/processing.go b/server/internal/processing/processing.go new file mode 100644 index 0000000..ea1556c --- /dev/null +++ b/server/internal/processing/processing.go @@ -0,0 +1,4 @@ +package processing + +func Submit() + diff --git a/server/internal/sqlc/db.go b/server/internal/sqlc/db.go new file mode 100644 index 0000000..2725108 --- /dev/null +++ b/server/internal/sqlc/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.29.0 + +package sqlc + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/server/internal/sqlc/models.go b/server/internal/sqlc/models.go new file mode 100644 index 0000000..5188ca1 --- /dev/null +++ b/server/internal/sqlc/models.go @@ -0,0 +1,30 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.29.0 + +package sqlc + +import ( + "github.com/jackc/pgx/v5/pgtype" +) + +type File struct { + ID pgtype.UUID + Name string + Description pgtype.Text + Mimetype string + Size int32 + Blake2 []byte + Created pgtype.Timestamp + Updated pgtype.Timestamp +} + +type ProcessingJob struct { + ID int32 + FileID pgtype.UUID + Created pgtype.Timestamp + Started pgtype.Timestamp + Completed pgtype.Timestamp + Status pgtype.Text + JobType pgtype.Text +} diff --git a/server/internal/sqlc/queries-files.sql.go b/server/internal/sqlc/queries-files.sql.go new file mode 100644 index 0000000..581253e --- /dev/null +++ b/server/internal/sqlc/queries-files.sql.go @@ -0,0 +1,112 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.29.0 +// source: queries-files.sql + +package sqlc + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createFile = `-- name: CreateFile :one +INSERT INTO files ( + name, description, mimetype, size, blake2 +) VALUES ( + $1,$2,$3,$4,$5 +) +ON CONFLICT DO NOTHING -- Handle this in application code +RETURNING id, name, description, mimetype, size, blake2, created, updated +` + +type CreateFileParams struct { + Name string + Description pgtype.Text + Mimetype string + Size int32 + Blake2 []byte +} + +func (q *Queries) CreateFile(ctx context.Context, arg CreateFileParams) (File, error) { + row := q.db.QueryRow(ctx, createFile, + arg.Name, + arg.Description, + arg.Mimetype, + arg.Size, + arg.Blake2, + ) + var i File + err := row.Scan( + &i.ID, + &i.Name, + &i.Description, + &i.Mimetype, + &i.Size, + &i.Blake2, + &i.Created, + &i.Updated, + ) + return i, err +} + +const getFileByBlake2 = `-- name: GetFileByBlake2 :one +SELECT id, name, description, mimetype, size, blake2, created, updated +FROM files +WHERE blake2 = $1 +` + +func (q *Queries) GetFileByBlake2(ctx context.Context, blake2 []byte) (File, error) { + row := q.db.QueryRow(ctx, getFileByBlake2, blake2) + var i File + err := row.Scan( + &i.ID, + &i.Name, + &i.Description, + &i.Mimetype, + &i.Size, + &i.Blake2, + &i.Created, + &i.Updated, + ) + return i, err +} + +const getFileByUUID = `-- name: GetFileByUUID :one +SELECT id, name, description, mimetype, size, blake2, created, updated +FROM files +WHERE id = $1 +` + +func (q *Queries) GetFileByUUID(ctx context.Context, id pgtype.UUID) (File, error) { + row := q.db.QueryRow(ctx, getFileByUUID, id) + var i File + err := row.Scan( + &i.ID, + &i.Name, + &i.Description, + &i.Mimetype, + &i.Size, + &i.Blake2, + &i.Created, + &i.Updated, + ) + return i, err +} + +const updateFileDescription = `-- name: UpdateFileDescription :exec +UPDATE files +SET description = $1 +WHERE id = $2 +` + +type UpdateFileDescriptionParams struct { + Description pgtype.Text + ID pgtype.UUID +} + +func (q *Queries) UpdateFileDescription(ctx context.Context, arg UpdateFileDescriptionParams) error { + _, err := q.db.Exec(ctx, updateFileDescription, arg.Description, arg.ID) + return err +} diff --git a/server/internal/sqlc/queries-processing_jobs.sql.go b/server/internal/sqlc/queries-processing_jobs.sql.go new file mode 100644 index 0000000..e8efe59 --- /dev/null +++ b/server/internal/sqlc/queries-processing_jobs.sql.go @@ -0,0 +1,63 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.29.0 +// source: queries-processing_jobs.sql + +package sqlc + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createProcessingJob = `-- name: CreateProcessingJob :one +INSERT INTO processing_jobs ( + file_id, job_type +) VALUES ($1,$2 ) +RETURNING id, file_id, created, started, completed, status, job_type +` + +type CreateProcessingJobParams struct { + FileID pgtype.UUID + JobType pgtype.Text +} + +func (q *Queries) CreateProcessingJob(ctx context.Context, arg CreateProcessingJobParams) (ProcessingJob, error) { + row := q.db.QueryRow(ctx, createProcessingJob, arg.FileID, arg.JobType) + var i ProcessingJob + err := row.Scan( + &i.ID, + &i.FileID, + &i.Created, + &i.Started, + &i.Completed, + &i.Status, + &i.JobType, + ) + return i, err +} + +const finishProcessingJob = `-- name: FinishProcessingJob :exec +UPDATE processing_jobs +SET completed = NOW(), + status = "completed" +WHERE id = $1 +` + +func (q *Queries) FinishProcessingJob(ctx context.Context, id int32) error { + _, err := q.db.Exec(ctx, finishProcessingJob, id) + return err +} + +const startProcessingJob = `-- name: StartProcessingJob :exec +UPDATE processing_jobs +SET started = NOW(), + status = "started" +WHERE id = $1 +` + +func (q *Queries) StartProcessingJob(ctx context.Context, id int32) error { + _, err := q.db.Exec(ctx, startProcessingJob, id) + return err +} diff --git a/server/internal/store/store.go b/server/internal/store/store.go index 390958f..332e68d 100644 --- a/server/internal/store/store.go +++ b/server/internal/store/store.go @@ -1,13 +1,10 @@ package store import ( - "io" "log/slog" - "mime/multipart" "os" "path/filepath" - "github.com/google/uuid" "github.com/spf13/viper" ) @@ -24,56 +21,54 @@ func SetupStore() { slog.Info("Initialized File storage directory") } -func SaveFile(file multipart.File) (string, error) { +func SaveFile(fileName string, fileBytes []byte) (string, error) { path, err := filepath.Abs(viper.GetString("store.path")) if err != nil { slog.Error("could not save file,", "error", err) return "", err } - fileName, err := uuid.NewRandom() + + osFile, err := os.Create(filepath.Join(path, fileName)) if err != nil { - slog.Error("could not save file,", "error", err) + slog.Error("could not create file on disk,", "error", err) return "", err } - osFile, err := os.Create(filepath.Join(path, fileName.String())) + defer osFile.Close() + _, err = osFile.Write(fileBytes) if err != nil { - slog.Error("could not write to file on disk,", "error", err) - return "", err - } - _, err = io.Copy(osFile, file) - if err != nil { - slog.Error("could not save file,", "error", err) + slog.Error("could not write file content,", "error", err) return "", err } - return fileName.String(), nil + return fileName, nil } -func OpenFile(fileId string) (*os.File, error) { +func OpenFile(fileName string) (*os.File, error) { path, err := filepath.Abs(viper.GetString("store.path")) if err != nil { slog.Error("Storage directory not accessible", "error", err) return nil, err } - file, err := os.Open(filepath.Join(path, fileId)) + file, err := os.Open(filepath.Join(path, fileName)) return file, err } -func DeleteFile(fileId string) error { +func DeleteFile(fileName string) error { path, err := filepath.Abs(viper.GetString("store.path")) if err != nil { slog.Error("Storage directory not accessible", "error", err) return err } - return os.Remove(path) + file := filepath.Join(path, fileName) + return os.Remove(file) } -func absPath(fileID string) (string, error) { +func absPath(fileName string) (string, error) { path, err := filepath.Abs(viper.GetString("store.path")) if err != nil { slog.Error("could not get full path for file,", "error", err) return "", err } - return path, nil + return filepath.Join(path, fileName), nil } diff --git a/server/web/assets/styles.css b/server/web/assets/styles.css index 811da5d..7ecdf9d 100644 --- a/server/web/assets/styles.css +++ b/server/web/assets/styles.css @@ -1,4 +1,4 @@ -/*! tailwindcss v4.1.7 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */ @layer properties; @layer theme, base, components, utilities; @layer theme { @@ -8,7 +8,6 @@ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-500: oklch(63.7% 0.237 25.331); - --color-amber-100: oklch(96.2% 0.059 95.617); --color-yellow-400: oklch(85.2% 0.199 91.936); --color-yellow-500: oklch(79.5% 0.184 86.047); --color-green-500: oklch(72.3% 0.219 149.579); @@ -22,6 +21,7 @@ --color-black: #000; --color-white: #fff; --spacing: 0.25rem; + --container-sm: 24rem; --text-xs: 0.75rem; --text-xs--line-height: calc(1 / 0.75); --text-sm: 0.875rem; @@ -39,8 +39,6 @@ --tracking-tight: -0.025em; --tracking-widest: 0.1em; --leading-relaxed: 1.625; - --radius-md: calc(var(--radius) - 2px); - --radius-2xl: 1rem; --ease-in: cubic-bezier(0.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, 0.2, 1); --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); @@ -247,9 +245,6 @@ .top-0 { top: calc(var(--spacing) * 0); } - .top-1 { - top: calc(var(--spacing) * 1); - } .top-1\/2 { top: calc(1/2 * 100%); } @@ -271,9 +266,6 @@ .left-0 { left: calc(var(--spacing) * 0); } - .left-1 { - left: calc(var(--spacing) * 1); - } .left-1\/2 { left: calc(1/2 * 100%); } @@ -475,9 +467,6 @@ .w-0 { width: calc(var(--spacing) * 0); } - .w-1 { - width: calc(var(--spacing) * 1); - } .w-1\/2 { width: calc(1/2 * 100%); } @@ -487,9 +476,6 @@ .w-1\/4 { width: calc(1/4 * 100%); } - .w-2 { - width: calc(var(--spacing) * 2); - } .w-2\.5 { width: calc(var(--spacing) * 2.5); } @@ -538,6 +524,9 @@ .w-full { width: 100%; } + .max-w-sm { + max-width: var(--container-sm); + } .min-w-0 { min-width: calc(var(--spacing) * 0); } @@ -550,12 +539,12 @@ .flex-1 { flex: 1; } - .flex-shrink { - flex-shrink: 1; - } .flex-shrink-0 { flex-shrink: 0; } + .shrink { + flex-shrink: 1; + } .shrink-0 { flex-shrink: 0; } @@ -568,13 +557,6 @@ .caption-bottom { caption-side: bottom; } - .border-collapse { - border-collapse: collapse; - } - .-translate-x-1 { - --tw-translate-x: calc(var(--spacing) * -1); - translate: var(--tw-translate-x) var(--tw-translate-y); - } .-translate-x-1\/2 { --tw-translate-x: calc(calc(1/2 * 100%) * -1); translate: var(--tw-translate-x) var(--tw-translate-y); @@ -591,10 +573,6 @@ --tw-translate-x: 100%; translate: var(--tw-translate-x) var(--tw-translate-y); } - .-translate-y-1 { - --tw-translate-y: calc(var(--spacing) * -1); - translate: var(--tw-translate-x) var(--tw-translate-y); - } .-translate-y-1\/2 { --tw-translate-y: calc(calc(1/2 * 100%) * -1); translate: var(--tw-translate-x) var(--tw-translate-y); @@ -631,6 +609,9 @@ --tw-scale-z: 100%; scale: var(--tw-scale-x) var(--tw-scale-y); } + .scale-3d { + scale: var(--tw-scale-x) var(--tw-scale-y) var(--tw-scale-z); + } .rotate-45 { rotate: 45deg; } @@ -664,6 +645,15 @@ .appearance-none { appearance: none; } + .columns-2 { + columns: 2; + } + .columns-3 { + columns: 3; + } + .columns-4 { + columns: 4; + } .grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } @@ -703,12 +693,8 @@ .gap-2 { gap: calc(var(--spacing) * 2); } - .space-y-1 { - :where(& > :not(:last-child)) { - --tw-space-y-reverse: 0; - margin-block-start: calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse)); - margin-block-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse))); - } + .gap-4 { + gap: calc(var(--spacing) * 4); } .space-y-1\.5 { :where(& > :not(:last-child)) { @@ -803,9 +789,6 @@ .rounded { border-radius: 0.25rem; } - .rounded-2xl { - border-radius: var(--radius-2xl); - } .rounded-full { border-radius: calc(infinity * 1px); } @@ -878,10 +861,6 @@ --tw-border-style: dotted; border-style: dotted; } - .border-solid { - --tw-border-style: solid; - border-style: solid; - } .border-border { border-color: var(--border); } @@ -924,9 +903,6 @@ background-color: color-mix(in oklab, var(--background) 80%, transparent); } } - .bg-black { - background-color: var(--color-black); - } .bg-black\/20 { background-color: color-mix(in srgb, #000 20%, transparent); @supports (color: color-mix(in lab, red, red)) { @@ -1029,9 +1005,6 @@ .px-5 { padding-inline: calc(var(--spacing) * 5); } - .py-0 { - padding-block: calc(var(--spacing) * 0); - } .py-0\.5 { padding-block: calc(var(--spacing) * 0.5); } @@ -1144,9 +1117,6 @@ .text-background { color: var(--background); } - .text-black { - color: var(--color-black); - } .text-blue-500 { color: var(--color-blue-500); } @@ -1195,6 +1165,9 @@ .text-yellow-500 { color: var(--color-yellow-500); } + .italic { + font-style: italic; + } .underline { text-decoration-line: underline; } @@ -1263,10 +1236,6 @@ -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); } - .backdrop-filter { - -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); - backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); - } .transition { transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events; transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); diff --git a/server/web/base.templ b/server/web/base.templ index a10535d..1bd571c 100644 --- a/server/web/base.templ +++ b/server/web/base.templ @@ -11,7 +11,7 @@ templ Base(title string) { {title} - +
diff --git a/server/web/base_templ.go b/server/web/base_templ.go index 7cf15b7..265d050 100644 --- a/server/web/base_templ.go +++ b/server/web/base_templ.go @@ -46,7 +46,7 @@ func Base(title string) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/fileView.go b/server/web/fileView.go index 73213f7..8b05949 100644 --- a/server/web/fileView.go +++ b/server/web/fileView.go @@ -10,7 +10,7 @@ import ( func FileViewWebHandler(w http.ResponseWriter, r *http.Request) { file, err := database.FileByUUID(r.PathValue("uuid")) if err != nil { - slog.Error("Error getting File in FileViewWebHandler", "error", err, "id", r.PathValue("uuid")) + slog.Error("Error getting File in FileViewWebHandler", "error", err, "file-uuid", r.PathValue("uuid")) http.Error(w, err.Error(), http.StatusBadRequest) } component := FileView(file) diff --git a/server/web/index.go b/server/web/index.go index 1879d91..f367605 100644 --- a/server/web/index.go +++ b/server/web/index.go @@ -1,7 +1,7 @@ package web import ( - "fmt" + "io" "log/slog" "net/http" @@ -15,6 +15,7 @@ func IndexWebHandler(w http.ResponseWriter, r *http.Request) { if err != nil { slog.Error("Error rendering in IndexWebHandler", "error", err) http.Error(w, err.Error(), http.StatusBadRequest) + return } } @@ -32,12 +33,28 @@ func IndexUploadHandler(w http.ResponseWriter, r *http.Request) { if err != nil { slog.Error("Error parsing form in IndexUploadHandler", "error", err) http.Error(w, err.Error(), http.StatusBadRequest) + return } - file, err := database.CreateFile(fileHeader.Filename, fileData, fileHeader.Size) + fileBytes, err := io.ReadAll(fileData) + if err != nil { + slog.Error("Error reading file in IndexUploadHandler", "error", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + fileSize := len(fileBytes) + + file, err := database.CreateFile(fileHeader.Filename, fileBytes, int64(fileSize)) if err != nil { slog.Error("Error saving file in IndexUploadHandler", "error", err) http.Error(w, err.Error(), http.StatusBadRequest) + return } - http.Redirect(w, r, fmt.Sprintf("/files/%s", file.Uuid), http.StatusSeeOther) + component := UploadSuccessCard(file) + err = component.Render(r.Context(), w) + if err != nil { + slog.Error("Error rendering in IndexUploadHandler", "error", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } } diff --git a/server/web/index.templ b/server/web/index.templ index 2b3d84d..574ecea 100644 --- a/server/web/index.templ +++ b/server/web/index.templ @@ -1,18 +1,78 @@ package web +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/card" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/form" + "git.jmbit.de/jmb/scanfile/server/internal/database" + "fmt" +) templ Index() { @Base("Scanfile") { - -
-
- - -
+
+ @UploadCard()
} } +templ UploadCard() { + @card.Card(card.Props{ID: "upload-card"}) { + @card.Header() { + @card.Title() { + Upload File + } + } + @card.Content() { +
+ + @form.Item() { +
+ @form.Label(form.LabelProps{ + For: "file", + }) { + File + } + @input.Input(input.Props{ + ID: "file", + Name: "file", + Type: input.TypeFile, + }) +
+ } + @form.Item() { + @button.Button(button.Props{Type: button.TypeSubmit}) { + Submit + } + } +
+ } + } +} + +templ UploadSuccessCard(file database.File) { + @card.Card(card.Props{ID: "upload-card"}) { + @card.Header() { + @card.Title() { + Upload Successful + } + @card.Description() { + Name: { file.Name } + } + } + + @card.Content() { +
+

ID: { file.Uuid }

+

Size: { file.Size } Bytes

+ + @button.Button(button.Props{Type: button.TypeButton, Href: fmt.Sprintf("/files/%s", file.Uuid)}) { + Go to file + } +
+ } + } +} + diff --git a/server/web/index_templ.go b/server/web/index_templ.go index fd819ab..d8426ca 100644 --- a/server/web/index_templ.go +++ b/server/web/index_templ.go @@ -8,6 +8,15 @@ package web import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/internal/database" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/card" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/form" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" +) + func Index() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -41,7 +50,15 @@ func Index() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = UploadCard().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -55,4 +72,411 @@ func Index() templ.Component { }) } +func UploadCard() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "Upload File") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Title().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Header().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "File") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = form.Label(form.LabelProps{ + For: "file", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = input.Input(input.Props{ + ID: "file", + Name: "file", + Type: input.TypeFile, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = form.Item().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "Submit") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{Type: button.TypeSubmit}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = form.Item().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Content().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Card(card.Props{ID: "upload-card"}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func UploadSuccessCard(file database.File) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var13 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var14 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "Upload Successful") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Title().Render(templ.WithChildren(ctx, templ_7745c5c3_Var15), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "Name: ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(file.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/index.templ`, Line: 62, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Description().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Header().Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var18 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "

ID: ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var19 string + templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(file.Uuid) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/index.templ`, Line: 68, Col: 30} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "

Size: ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(file.Size) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/index.templ`, Line: 69, Col: 30} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, " Bytes

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var21 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "Go to file") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{Type: button.TypeButton, Href: fmt.Sprintf("/files/%s", file.Uuid)}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Content().Render(templ.WithChildren(ctx, templ_7745c5c3_Var18), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Card(card.Props{ID: "upload-card"}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/accordion/accordion.templ b/server/web/templui/components/accordion/accordion.templ new file mode 100644 index 0000000..3206e59 --- /dev/null +++ b/server/web/templui/components/accordion/accordion.templ @@ -0,0 +1,126 @@ +// templui component accordion - version: main installed by templui v0.71.0 +package accordion + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Accordion(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
summary_svg]:rotate-180", + p.Class, + ), + } + { p.Attributes... } + > + { children... } +
+} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + +
+ { children... } +
+ @icon.ChevronDown(icon.Props{ + Size: 16, + Class: "transition-transform", + }) +
+} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} diff --git a/server/web/templui/components/accordion/accordion_templ.go b/server/web/templui/components/accordion/accordion_templ.go new file mode 100644 index 0000000..6bd6d99 --- /dev/null +++ b/server/web/templui/components/accordion/accordion_templ.go @@ -0,0 +1,437 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component accordion - version: main installed by templui v0.71.0 + +package accordion + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Accordion(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "divide-y rounded-md divide-border border", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "group", + "open:[&>summary_svg]:rotate-180", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + "flex w-full items-center justify-between py-4 px-5", + "text-left font-medium cursor-pointer", + "transition-all hover:underline", + "list-none [&::-webkit-details-marker]:hidden", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronDown(icon.Props{ + Size: 16, + Class: "transition-transform", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var14 = []any{ + utils.TwMerge( + "px-5 pb-4 pt-0", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/alert/alert.templ b/server/web/templui/components/alert/alert.templ new file mode 100644 index 0000000..675502b --- /dev/null +++ b/server/web/templui/components/alert/alert.templ @@ -0,0 +1,107 @@ +// templui component alert - version: main installed by templui v0.71.0 +package alert + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantDefault Variant = "default" + VariantDestructive Variant = "destructive" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Alert(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
svg]:absolute [&>svg]:left-4 [&>svg]:top-4", + "[&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11", + "rounded-lg border", + variantClasses(p.Variant), + p.Class, + ), + } + role="alert" + { p.Attributes... } + > + { children... } +
+} + +templ Title(props ...TitleProps) { + {{ var p TitleProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +func variantClasses(variant Variant) string { + switch variant { + case VariantDestructive: + return "border-destructive text-destructive" + default: + return "border-border text-foreground" + } +} diff --git a/server/web/templui/components/alert/alert_templ.go b/server/web/templui/components/alert/alert_templ.go new file mode 100644 index 0000000..614c9ee --- /dev/null +++ b/server/web/templui/components/alert/alert_templ.go @@ -0,0 +1,339 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component alert - version: main installed by templui v0.71.0 + +package alert + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantDefault Variant = "default" + VariantDestructive Variant = "destructive" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Alert(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative w-full p-4", + "[&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4", + "[&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11", + "rounded-lg border", + variantClasses(p.Variant), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Title(props ...TitleProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TitleProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "mb-1 font-medium leading-none tracking-tight", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + "[&_p]:leading-relaxed text-sm", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func variantClasses(variant Variant) string { + switch variant { + case VariantDestructive: + return "border-destructive text-destructive" + default: + return "border-border text-foreground" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/aspectratio/aspect_ratio.templ b/server/web/templui/components/aspectratio/aspect_ratio.templ new file mode 100644 index 0000000..273f7a9 --- /dev/null +++ b/server/web/templui/components/aspectratio/aspect_ratio.templ @@ -0,0 +1,60 @@ +// templui component aspectratio - version: main installed by templui v0.71.0 +package aspectratio + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Ratio string + +const ( + RatioAuto Ratio = "auto" + RatioSquare Ratio = "square" + RatioVideo Ratio = "video" + RatioPortrait Ratio = "portrait" + RatioWide Ratio = "wide" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Ratio Ratio +} + +templ AspectRatio(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+
+ { children... } +
+
+} + +func ratioClass(ratio Ratio) string { + switch ratio { + case RatioSquare: + return "aspect-square" + case RatioVideo: + return "aspect-video" + case RatioPortrait: + return "aspect-[3/4]" + case RatioWide: + return "aspect-[2/1]" + default: + return "aspect-square" + } +} diff --git a/server/web/templui/components/aspectratio/aspect_ratio_templ.go b/server/web/templui/components/aspectratio/aspect_ratio_templ.go new file mode 100644 index 0000000..b1ddcc2 --- /dev/null +++ b/server/web/templui/components/aspectratio/aspect_ratio_templ.go @@ -0,0 +1,143 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component aspectratio - version: main installed by templui v0.71.0 + +package aspectratio + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Ratio string + +const ( + RatioAuto Ratio = "auto" + RatioSquare Ratio = "square" + RatioVideo Ratio = "video" + RatioPortrait Ratio = "portrait" + RatioWide Ratio = "wide" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Ratio Ratio +} + +func AspectRatio(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative w-full", + ratioClass(p.Ratio), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func ratioClass(ratio Ratio) string { + switch ratio { + case RatioSquare: + return "aspect-square" + case RatioVideo: + return "aspect-video" + case RatioPortrait: + return "aspect-[3/4]" + case RatioWide: + return "aspect-[2/1]" + default: + return "aspect-square" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/avatar/avatar.templ b/server/web/templui/components/avatar/avatar.templ new file mode 100644 index 0000000..dc68bba --- /dev/null +++ b/server/web/templui/components/avatar/avatar.templ @@ -0,0 +1,291 @@ +// templui component avatar - version: main installed by templui v0.71.0 +package avatar + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strings" +) + +type Size string +type GroupSpacing string + +const ( + SizeSm Size = "sm" + SizeMd Size = "md" + SizeLg Size = "lg" +) + +const ( + GroupSpacingSm GroupSpacing = "sm" + GroupSpacingMd GroupSpacing = "medium" + GroupSpacingLg GroupSpacing = "large" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Size Size + InGroup bool +} + +type ImageProps struct { + ID string + Class string + Attributes templ.Attributes + Alt string + Src string +} + +type FallbackProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes + Spacing GroupSpacing +} + +templ Avatar(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Image(props ...ImageProps) { + {{ var p ImageProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + { +} + +templ Fallback(props ...FallbackProps) { + {{ var p FallbackProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ GroupOverflow(count int, props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ +{ fmt.Sprint(count) } +
+} + +func SizeClasses(size Size) string { + switch size { + case SizeSm: + return "w-8 h-8 text-xs" + case SizeLg: + return "w-16 h-16 text-xl" + default: // SizeMd + return "w-12 h-12 text-base" + } +} + +func Initials(name string) string { + parts := strings.Fields(name) + initials := "" + for i, part := range parts { + if i > 1 { + break + } + if len(part) > 0 { + initials += string(part[0]) + } + } + return strings.ToUpper(initials) +} + +func groupSpacingClasses(spacing GroupSpacing) string { + switch spacing { + case GroupSpacingSm: + return "-space-x-1" + case GroupSpacingLg: + return "-space-x-4" + default: // GroupSpacingMd + return "-space-x-2" + } +} + +func avatarAlt(p ImageProps) string { + if p.Alt != "" { + return p.Alt + } + + if p.ID != "" { + return fmt.Sprintf("Avatar of %s", p.ID) + } + + if p.Src != "" { + return "User avatar" + } + + return "" +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/avatar/avatar_templ.go b/server/web/templui/components/avatar/avatar_templ.go new file mode 100644 index 0000000..8ca0bf1 --- /dev/null +++ b/server/web/templui/components/avatar/avatar_templ.go @@ -0,0 +1,692 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component avatar - version: main installed by templui v0.71.0 + +package avatar + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strings" +) + +type Size string +type GroupSpacing string + +const ( + SizeSm Size = "sm" + SizeMd Size = "md" + SizeLg Size = "lg" +) + +const ( + GroupSpacingSm GroupSpacing = "sm" + GroupSpacingMd GroupSpacing = "medium" + GroupSpacingLg GroupSpacing = "large" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Size Size + InGroup bool +} + +type ImageProps struct { + ID string + Class string + Attributes templ.Attributes + Alt string + Src string +} + +type FallbackProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes + Spacing GroupSpacing +} + +func Avatar(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "inline-flex items-center justify-center", + SizeClasses(p.Size), + "rounded-full bg-muted", + utils.If(p.InGroup, "ring-2 ring-background"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Image(props ...ImageProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ImageProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "w-full h-full", + "rounded-full object-cover", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\"")") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Fallback(props ...FallbackProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FallbackProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{ + utils.TwMerge( + "font-medium text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{ + utils.TwMerge( + "flex items-center -space-x-3", + groupSpacingClasses(p.Spacing), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func GroupOverflow(count int, props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{ + utils.TwMerge( + "inline-flex items-center justify-center", + SizeClasses(p.Size), + "rounded-full bg-muted ring-2 ring-background", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "+") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var23 string + templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprint(count)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 168, Col: 56} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func SizeClasses(size Size) string { + switch size { + case SizeSm: + return "w-8 h-8 text-xs" + case SizeLg: + return "w-16 h-16 text-xl" + default: // SizeMd + return "w-12 h-12 text-base" + } +} + +func Initials(name string) string { + parts := strings.Fields(name) + initials := "" + for i, part := range parts { + if i > 1 { + break + } + if len(part) > 0 { + initials += string(part[0]) + } + } + return strings.ToUpper(initials) +} + +func groupSpacingClasses(spacing GroupSpacing) string { + switch spacing { + case GroupSpacingSm: + return "-space-x-1" + case GroupSpacingLg: + return "-space-x-4" + default: // GroupSpacingMd + return "-space-x-2" + } +} + +func avatarAlt(p ImageProps) string { + if p.Alt != "" { + return p.Alt + } + + if p.ID != "" { + return fmt.Sprintf("Avatar of %s", p.ID) + } + + if p.Src != "" { + return "User avatar" + } + + return "" +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var24 := templ.GetChildren(ctx) + if templ_7745c5c3_Var24 == nil { + templ_7745c5c3_Var24 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var25 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/badge/badge.templ b/server/web/templui/components/badge/badge.templ new file mode 100644 index 0000000..01f9395 --- /dev/null +++ b/server/web/templui/components/badge/badge.templ @@ -0,0 +1,57 @@ +// templui component badge - version: main installed by templui v0.71.0 +package badge + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantDefault Variant = "default" + VariantSecondary Variant = "secondary" + VariantDestructive Variant = "destructive" + VariantOutline Variant = "outline" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant +} + +templ Badge(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +func (p Props) variantClasses() string { + switch p.Variant { + case VariantDestructive: + return "border-transparent bg-destructive text-destructive-foreground" + case VariantOutline: + return "text-foreground border-border" + case VariantSecondary: + return "border-transparent bg-secondary text-secondary-foreground" + default: + return "border-transparent bg-primary text-primary-foreground" + } +} diff --git a/server/web/templui/components/badge/badge_templ.go b/server/web/templui/components/badge/badge_templ.go new file mode 100644 index 0000000..f6cb426 --- /dev/null +++ b/server/web/templui/components/badge/badge_templ.go @@ -0,0 +1,142 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component badge - version: main installed by templui v0.71.0 + +package badge + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantDefault Variant = "default" + VariantSecondary Variant = "secondary" + VariantDestructive Variant = "destructive" + VariantOutline Variant = "outline" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant +} + +func Badge(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "inline-flex items-center gap-2", + "rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors", + "focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2", + p.variantClasses(), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func (p Props) variantClasses() string { + switch p.Variant { + case VariantDestructive: + return "border-transparent bg-destructive text-destructive-foreground" + case VariantOutline: + return "text-foreground border-border" + case VariantSecondary: + return "border-transparent bg-secondary text-secondary-foreground" + default: + return "border-transparent bg-primary text-primary-foreground" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/breadcrumb/breadcrumb.templ b/server/web/templui/components/breadcrumb/breadcrumb.templ new file mode 100644 index 0000000..4dbb94d --- /dev/null +++ b/server/web/templui/components/breadcrumb/breadcrumb.templ @@ -0,0 +1,175 @@ +// templui component breadcrumb - version: main installed by templui v0.71.0 +package breadcrumb + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ListProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Current bool +} + +type LinkProps struct { + ID string + Class string + Attributes templ.Attributes + Href string +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes + UseCustom bool +} + +templ Breadcrumb(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +templ List(props ...ListProps) { + {{ var p ListProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
+} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
  • + { children... } +
  • +} + +templ Link(props ...LinkProps) { + {{ var p LinkProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Separator(props ...SeparatorProps) { + {{ var p SeparatorProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + if p.UseCustom { + { children... } + } else { + @icon.ChevronRight(icon.Props{Size: 14, Class: "text-muted-foreground"}) + } + +} + +templ Page(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} diff --git a/server/web/templui/components/breadcrumb/breadcrumb_templ.go b/server/web/templui/components/breadcrumb/breadcrumb_templ.go new file mode 100644 index 0000000..babfd74 --- /dev/null +++ b/server/web/templui/components/breadcrumb/breadcrumb_templ.go @@ -0,0 +1,643 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component breadcrumb - version: main installed by templui v0.71.0 + +package breadcrumb + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ListProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Current bool +} + +type LinkProps struct { + ID string + Class string + Attributes templ.Attributes + Href string +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes + UseCustom bool +} + +func Breadcrumb(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "flex", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func List(props ...ListProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ListProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "flex items-center flex-wrap gap-1 text-sm", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + "flex items-center", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Link(props ...LinkProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LinkProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var14 = []any{ + utils.TwMerge( + "text-muted-foreground hover:text-foreground hover:underline flex items-center gap-1.5 transition-colors", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Separator(props ...SeparatorProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SeparatorProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var19 = []any{ + utils.TwMerge( + "mx-2 text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.UseCustom { + templ_7745c5c3_Err = templ_7745c5c3_Var18.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = icon.ChevronRight(icon.Props{Size: 14, Class: "text-muted-foreground"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Page(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var22 := templ.GetChildren(ctx) + if templ_7745c5c3_Var22 == nil { + templ_7745c5c3_Var22 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var23 = []any{ + utils.TwMerge( + "font-medium text-foreground flex items-center gap-1.5", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/button/button.templ b/server/web/templui/components/button/button.templ new file mode 100644 index 0000000..58f7a5c --- /dev/null +++ b/server/web/templui/components/button/button.templ @@ -0,0 +1,169 @@ +// templui component button - version: main installed by templui v0.71.0 +package button + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strings" +) + +type Variant string +type Size string +type Type string + +const ( + VariantDefault Variant = "default" + VariantDestructive Variant = "destructive" + VariantOutline Variant = "outline" + VariantSecondary Variant = "secondary" + VariantGhost Variant = "ghost" + VariantLink Variant = "link" +) + +const ( + TypeButton Type = "button" + TypeReset Type = "reset" + TypeSubmit Type = "submit" +) + +const ( + SizeIcon Size = "icon" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant + Size Size + FullWidth bool + Href string + Target string + Disabled bool + Type Type + HxGet string + HxPost string + HxPut string + HxDelete string + HxTrigger string + HxTarget string + HxSwap string + HxReplaceUrl string +} + +templ Button(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Type == "" { + {{ p.Type = TypeButton }} + } + if p.Href != "" && !p.Disabled { + + { children... } + + } else { + + } +} + +func (b Props) variantClasses() string { + switch b.Variant { + case VariantDestructive: + return "bg-destructive text-destructive-foreground hover:bg-destructive/90" + case VariantOutline: + return "border border-input bg-background hover:bg-accent hover:text-accent-foreground" + case VariantSecondary: + return "bg-secondary text-secondary-foreground hover:bg-secondary/80" + case VariantGhost: + return "hover:bg-accent hover:text-accent-foreground" + case VariantLink: + return "text-primary underline-offset-4 hover:underline" + default: + return "bg-primary text-primary-foreground hover:bg-primary/90" + } +} + +func (b Props) sizeClasses() string { + switch b.Size { + case SizeIcon: + return "h-10 w-10" + default: + return "h-10 px-4 py-2 rounded-md" + } +} + +func (b Props) modifierClasses() string { + classes := []string{} + if b.FullWidth { + classes = append(classes, "w-full") + } + return strings.Join(classes, " ") +} diff --git a/server/web/templui/components/button/button_templ.go b/server/web/templui/components/button/button_templ.go new file mode 100644 index 0000000..e538fc7 --- /dev/null +++ b/server/web/templui/components/button/button_templ.go @@ -0,0 +1,483 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component button - version: main installed by templui v0.71.0 + +package button + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strings" +) + +type Variant string +type Size string +type Type string + +const ( + VariantDefault Variant = "default" + VariantDestructive Variant = "destructive" + VariantOutline Variant = "outline" + VariantSecondary Variant = "secondary" + VariantGhost Variant = "ghost" + VariantLink Variant = "link" +) + +const ( + TypeButton Type = "button" + TypeReset Type = "reset" + TypeSubmit Type = "submit" +) + +const ( + SizeIcon Size = "icon" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Variant Variant + Size Size + FullWidth bool + Href string + Target string + Disabled bool + Type Type + HxGet string + HxPost string + HxPut string + HxDelete string + HxTrigger string + HxTarget string + HxSwap string + HxReplaceUrl string +} + +func Button(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.Type == "" { + p.Type = TypeButton + } + if p.Href != "" && !p.Disabled { + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", + "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", + "cursor-pointer", + p.variantClasses(), + p.sizeClasses(), + p.modifierClasses(), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var7 = []any{ + utils.TwMerge( + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", + "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", + "disabled:opacity-50 disabled:cursor-not-allowed", + "cursor-pointer", + p.variantClasses(), + p.sizeClasses(), + p.modifierClasses(), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func (b Props) variantClasses() string { + switch b.Variant { + case VariantDestructive: + return "bg-destructive text-destructive-foreground hover:bg-destructive/90" + case VariantOutline: + return "border border-input bg-background hover:bg-accent hover:text-accent-foreground" + case VariantSecondary: + return "bg-secondary text-secondary-foreground hover:bg-secondary/80" + case VariantGhost: + return "hover:bg-accent hover:text-accent-foreground" + case VariantLink: + return "text-primary underline-offset-4 hover:underline" + default: + return "bg-primary text-primary-foreground hover:bg-primary/90" + } +} + +func (b Props) sizeClasses() string { + switch b.Size { + case SizeIcon: + return "h-10 w-10" + default: + return "h-10 px-4 py-2 rounded-md" + } +} + +func (b Props) modifierClasses() string { + classes := []string{} + if b.FullWidth { + classes = append(classes, "w-full") + } + return strings.Join(classes, " ") +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/calendar/calendar.templ b/server/web/templui/components/calendar/calendar.templ new file mode 100644 index 0000000..05cdb61 --- /dev/null +++ b/server/web/templui/components/calendar/calendar.templ @@ -0,0 +1,303 @@ +// templui component calendar - version: main installed by templui v0.71.0 +package calendar + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" + "time" +) + +type LocaleTag string + +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + LocaleTag LocaleTag + Value *time.Time + Name string + InitialMonth int // Optional: 0-11 (Default: current or from Value). Controls the initially displayed month view. + InitialYear int // Optional: (Default: current or from Value). Controls the initially displayed year view. +} + +templ Calendar(props ...Props) { + @Script() + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + "-calendar" + } + if p.Name == "" { + // Should be provided by parent (e.g., DatePicker or in standalone usage) + p.Name = p.ID + "-value" // Fallback name + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + + initialView := time.Now() + if p.Value != nil { + initialView = *p.Value + } + + initialMonth := p.InitialMonth + initialYear := p.InitialYear + + // Use year from initialView if InitialYear prop is invalid/unset (<= 0) + if initialYear <= 0 { + initialYear = initialView.Year() + } + + // Use month from initialView if InitialMonth prop is invalid OR + // if InitialMonth is default 0 AND InitialYear was also defaulted (meaning neither was likely set explicitly) + if (initialMonth < 0 || initialMonth > 11) || (initialMonth == 0 && p.InitialYear <= 0) { + initialMonth = int(initialView.Month()) - 1 // time.Month is 1-12 + } + + initialSelectedISO := "" + if p.Value != nil { + initialSelectedISO = p.Value.Format("2006-01-02") + } + }} +
    + +
    + +
    + +
    + + +
    +
    + +
    + +
    +
    +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/calendar/calendar_templ.go b/server/web/templui/components/calendar/calendar_templ.go new file mode 100644 index 0000000..e333575 --- /dev/null +++ b/server/web/templui/components/calendar/calendar_templ.go @@ -0,0 +1,328 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component calendar - version: main installed by templui v0.71.0 + +package calendar + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" + "time" +) + +type LocaleTag string + +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + LocaleTag LocaleTag + Value *time.Time + Name string + InitialMonth int // Optional: 0-11 (Default: current or from Value). Controls the initially displayed month view. + InitialYear int // Optional: (Default: current or from Value). Controls the initially displayed year view. +} + +func Calendar(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + "-calendar" + } + if p.Name == "" { + // Should be provided by parent (e.g., DatePicker or in standalone usage) + p.Name = p.ID + "-value" // Fallback name + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + + initialView := time.Now() + if p.Value != nil { + initialView = *p.Value + } + + initialMonth := p.InitialMonth + initialYear := p.InitialYear + + // Use year from initialView if InitialYear prop is invalid/unset (<= 0) + if initialYear <= 0 { + initialYear = initialView.Year() + } + + // Use month from initialView if InitialMonth prop is invalid OR + // if InitialMonth is default 0 AND InitialYear was also defaulted (meaning neither was likely set explicitly) + if (initialMonth < 0 || initialMonth > 11) || (initialMonth == 0 && p.InitialYear <= 0) { + initialMonth = int(initialView.Month()) - 1 // time.Month is 1-12 + } + + initialSelectedISO := "" + if p.Value != nil { + initialSelectedISO = p.Value.Format("2006-01-02") + } + var templ_7745c5c3_Var2 = []any{p.Class} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var14 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/card/card.templ b/server/web/templui/components/card/card.templ new file mode 100644 index 0000000..9f314d8 --- /dev/null +++ b/server/web/templui/components/card/card.templ @@ -0,0 +1,305 @@ +// templui component card - version: main installed by templui v0.71.0 +package card + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/aspectratio" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type MediaPosition string +type MediaWidth string + +const ( + MediaPositionTop MediaPosition = "top" + MediaPositionBottom MediaPosition = "bottom" + MediaPositionLeft MediaPosition = "left" + MediaPositionRight MediaPosition = "right" +) + +const ( + MediaWidthAuto MediaWidth = "auto" + MediaWidthFull MediaWidth = "full" + MediaWidthHalf MediaWidth = "half" + MediaWidthThird MediaWidth = "third" + MediaWidthQuarter MediaWidth = "quarter" + MediaWidthTwoThirds MediaWidth = "two-thirds" + MediaWidthThreeQuarters MediaWidth = "three-quarters" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type HorizontalProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type MediaProps struct { + ID string + Class string + Attributes templ.Attributes + Src string + Alt string + Position MediaPosition + Width MediaWidth + AspectRatio aspectratio.Ratio +} + +templ Card(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Title(props ...TitleProps) { + {{ var p TitleProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Horizontal(props ...HorizontalProps) { + {{ var p HorizontalProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Media(props ...MediaProps) { + {{ var p MediaProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + @aspectratio.AspectRatio(aspectratio.Props{ + ID: p.ID + "-aspect", + Ratio: p.AspectRatio, + Class: "h-full w-full", + }) { + { + } +
    +} + +func mediaPositionClasses(position MediaPosition, width MediaWidth) string { + var positionClass string + + switch position { + case MediaPositionTop: + return "w-full rounded-t-lg" + case MediaPositionBottom: + return "w-full rounded-b-lg" + case MediaPositionLeft: + positionClass = "shrink-0 rounded-l-lg" + case MediaPositionRight: + positionClass = "shrink-0 rounded-r-lg" + default: + positionClass = "" + } + + if position == MediaPositionLeft || position == MediaPositionRight { + return positionClass + " " + widthClass(width) + } + + return positionClass +} + +func widthClass(width MediaWidth) string { + switch width { + case MediaWidthFull: + return "w-full" + case MediaWidthHalf: + return "w-1/2" + case MediaWidthThird: + return "w-1/3" + case MediaWidthQuarter: + return "w-1/4" + case MediaWidthTwoThirds: + return "w-2/3" + case MediaWidthThreeQuarters: + return "w-3/4" + default: + return "w-1/3" + } +} diff --git a/server/web/templui/components/card/card_templ.go b/server/web/templui/components/card/card_templ.go new file mode 100644 index 0000000..28aa5d5 --- /dev/null +++ b/server/web/templui/components/card/card_templ.go @@ -0,0 +1,958 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component card - version: main installed by templui v0.71.0 + +package card + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/aspectratio" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type MediaPosition string +type MediaWidth string + +const ( + MediaPositionTop MediaPosition = "top" + MediaPositionBottom MediaPosition = "bottom" + MediaPositionLeft MediaPosition = "left" + MediaPositionRight MediaPosition = "right" +) + +const ( + MediaWidthAuto MediaWidth = "auto" + MediaWidthFull MediaWidth = "full" + MediaWidthHalf MediaWidth = "half" + MediaWidthThird MediaWidth = "third" + MediaWidthQuarter MediaWidth = "quarter" + MediaWidthTwoThirds MediaWidth = "two-thirds" + MediaWidthThreeQuarters MediaWidth = "three-quarters" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type HorizontalProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type MediaProps struct { + ID string + Class string + Attributes templ.Attributes + Src string + Alt string + Position MediaPosition + Width MediaWidth + AspectRatio aspectratio.Ratio +} + +func Card(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "w-full rounded-lg border bg-card text-card-foreground shadow-xs", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "flex flex-col space-y-1.5 p-6 pb-0", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Title(props ...TitleProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TitleProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + "text-lg font-semibold leading-none tracking-tight", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var14 = []any{ + utils.TwMerge( + "text-sm text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var18 = []any{ + utils.TwMerge( + "p-6", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var21 := templ.GetChildren(ctx) + if templ_7745c5c3_Var21 == nil { + templ_7745c5c3_Var21 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var22 = []any{ + utils.TwMerge( + "flex items-center p-6 pt-0", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var22...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var21.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Horizontal(props ...HorizontalProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var25 := templ.GetChildren(ctx) + if templ_7745c5c3_Var25 == nil { + templ_7745c5c3_Var25 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HorizontalProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var26 = []any{ + utils.TwMerge( + "flex overflow-hidden", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var26...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var25.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Media(props ...MediaProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var29 := templ.GetChildren(ctx) + if templ_7745c5c3_Var29 == nil { + templ_7745c5c3_Var29 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p MediaProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var30 = []any{ + utils.TwMerge( + "overflow-hidden", + mediaPositionClasses(p.Position, p.Width), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var30...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var33 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = aspectratio.AspectRatio(aspectratio.Props{ + ID: p.ID + "-aspect", + Ratio: p.AspectRatio, + Class: "h-full w-full", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var33), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func mediaPositionClasses(position MediaPosition, width MediaWidth) string { + var positionClass string + + switch position { + case MediaPositionTop: + return "w-full rounded-t-lg" + case MediaPositionBottom: + return "w-full rounded-b-lg" + case MediaPositionLeft: + positionClass = "shrink-0 rounded-l-lg" + case MediaPositionRight: + positionClass = "shrink-0 rounded-r-lg" + default: + positionClass = "" + } + + if position == MediaPositionLeft || position == MediaPositionRight { + return positionClass + " " + widthClass(width) + } + + return positionClass +} + +func widthClass(width MediaWidth) string { + switch width { + case MediaWidthFull: + return "w-full" + case MediaWidthHalf: + return "w-1/2" + case MediaWidthThird: + return "w-1/3" + case MediaWidthQuarter: + return "w-1/4" + case MediaWidthTwoThirds: + return "w-2/3" + case MediaWidthThreeQuarters: + return "w-3/4" + default: + return "w-1/3" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/carousel/carousel.templ b/server/web/templui/components/carousel/carousel.templ new file mode 100644 index 0000000..5a23fd6 --- /dev/null +++ b/server/web/templui/components/carousel/carousel.templ @@ -0,0 +1,394 @@ +// templui component carousel - version: main installed by templui v0.71.0 +package carousel + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Autoplay bool + Interval int + Loop bool +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type PreviousProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type NextProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type IndicatorsProps struct { + ID string + Class string + Attributes templ.Attributes + Count int +} + +templ Carousel(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Previous(props ...PreviousProps) { + {{ var p PreviousProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +templ Next(props ...NextProps) { + {{ var p NextProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +templ Indicators(props ...IndicatorsProps) { + {{ var p IndicatorsProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + for i := 0; i < p.Count; i++ { + + } +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/carousel/carousel_templ.go b/server/web/templui/components/carousel/carousel_templ.go new file mode 100644 index 0000000..214d410 --- /dev/null +++ b/server/web/templui/components/carousel/carousel_templ.go @@ -0,0 +1,778 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component carousel - version: main installed by templui v0.71.0 + +package carousel + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Autoplay bool + Interval int + Loop bool +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type PreviousProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type NextProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type IndicatorsProps struct { + ID string + Class string + Attributes templ.Attributes + Count int +} + +func Carousel(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "carousel-component relative overflow-hidden w-full", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var9 = []any{ + utils.TwMerge( + "carousel-track flex h-full w-full transition-transform duration-500 ease-in-out", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var8.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var13 = []any{ + utils.TwMerge( + "carousel-item flex-shrink-0 w-full h-full relative", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var12.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Previous(props ...PreviousProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p PreviousProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var17 = []any{ + utils.TwMerge( + "carousel-prev absolute left-2 top-1/2 transform -translate-y-1/2 p-2 rounded-full bg-black/20 text-white hover:bg-black/40 focus:outline-none", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var17...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronLeft().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Next(props ...NextProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var20 := templ.GetChildren(ctx) + if templ_7745c5c3_Var20 == nil { + templ_7745c5c3_Var20 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p NextProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var21 = []any{ + utils.TwMerge( + "carousel-next absolute right-2 top-1/2 transform -translate-y-1/2 p-2 rounded-full bg-black/20 text-white hover:bg-black/40 focus:outline-none", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var21...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronRight().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Indicators(props ...IndicatorsProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var24 := templ.GetChildren(ctx) + if templ_7745c5c3_Var24 == nil { + templ_7745c5c3_Var24 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p IndicatorsProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var25 = []any{ + utils.TwMerge( + "absolute bottom-4 left-1/2 transform -translate-x-1/2 flex gap-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var25...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i := 0; i < p.Count; i++ { + var templ_7745c5c3_Var28 = []any{ + utils.TwMerge( + "carousel-indicator w-3 h-3 rounded-full bg-white/50 hover:bg-white/80 focus:outline-none transition-colors", + utils.If(i == 0, "bg-white"), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var28...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var31 := templ.GetChildren(ctx) + if templ_7745c5c3_Var31 == nil { + templ_7745c5c3_Var31 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var32 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var32), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/chart/chart.templ b/server/web/templui/components/chart/chart.templ new file mode 100644 index 0000000..1a72305 --- /dev/null +++ b/server/web/templui/components/chart/chart.templ @@ -0,0 +1,330 @@ +// templui component chart - version: main installed by templui v0.71.0 +package chart + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantBar Variant = "bar" + VariantLine Variant = "line" + VariantPie Variant = "pie" + VariantDoughnut Variant = "doughnut" + VariantRadar Variant = "radar" +) + +type Dataset struct { + Label string `json:"label"` + Data []float64 `json:"data"` + BorderWidth int `json:"borderWidth,omitempty"` + BorderColor interface{} `json:"borderColor,omitempty"` + BackgroundColor interface{} `json:"backgroundColor,omitempty"` + Tension float64 `json:"tension,omitempty"` + Fill bool `json:"fill,omitempty"` + Stepped bool `json:"stepped,omitempty"` +} + +type Options struct { + Responsive bool `json:"responsive,omitempty"` + Legend bool `json:"legend,omitempty"` +} + +type Data struct { + Labels []string `json:"labels"` + Datasets []Dataset `json:"datasets"` +} + +type Config struct { + Type Variant `json:"type"` + Data Data `json:"data"` + Options Options `json:"options,omitempty"` + ShowLegend bool `json:"showLegend,omitempty"` + ShowXAxis bool `json:"showXAxis"` + ShowYAxis bool `json:"showYAxis"` + ShowXLabels bool `json:"showXLabels"` + ShowYLabels bool `json:"showYLabels"` + ShowXGrid bool `json:"showXGrid"` + ShowYGrid bool `json:"showYGrid"` + Horizontal bool `json:"horizontal"` + Stacked bool `json:"stacked"` +} + +// Erweiterung des Props um ID und Attributes +type Props struct { + ID string + Variant Variant + Data Data + Options Options + ShowLegend bool + ShowXAxis bool + ShowYAxis bool + ShowXLabels bool + ShowYLabels bool + ShowXGrid bool + ShowYGrid bool + Horizontal bool + Stacked bool + Class string + Attributes templ.Attributes +} + +templ Chart(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = "chart-" + utils.RandomID() }} + } + {{ canvasId := p.ID + "-canvas" }} + {{ dataId := p.ID + "-data" }} +
    + +
    + {{ + chartConfig := Config{ + Type: p.Variant, + Data: p.Data, + Options: p.Options, + ShowLegend: p.ShowLegend, + ShowXAxis: p.ShowXAxis, + ShowYAxis: p.ShowYAxis, + ShowXLabels: p.ShowXLabels, + ShowYLabels: p.ShowYLabels, + ShowXGrid: p.ShowXGrid, + ShowYGrid: p.ShowYGrid, + Horizontal: p.Horizontal, + Stacked: p.Stacked, + } + }} + @templ.JSONScript(dataId, chartConfig) +} + +templ Script() { + + +} diff --git a/server/web/templui/components/chart/chart_templ.go b/server/web/templui/components/chart/chart_templ.go new file mode 100644 index 0000000..3ebc801 --- /dev/null +++ b/server/web/templui/components/chart/chart_templ.go @@ -0,0 +1,265 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component chart - version: main installed by templui v0.71.0 + +package chart + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Variant string + +const ( + VariantBar Variant = "bar" + VariantLine Variant = "line" + VariantPie Variant = "pie" + VariantDoughnut Variant = "doughnut" + VariantRadar Variant = "radar" +) + +type Dataset struct { + Label string `json:"label"` + Data []float64 `json:"data"` + BorderWidth int `json:"borderWidth,omitempty"` + BorderColor interface{} `json:"borderColor,omitempty"` + BackgroundColor interface{} `json:"backgroundColor,omitempty"` + Tension float64 `json:"tension,omitempty"` + Fill bool `json:"fill,omitempty"` + Stepped bool `json:"stepped,omitempty"` +} + +type Options struct { + Responsive bool `json:"responsive,omitempty"` + Legend bool `json:"legend,omitempty"` +} + +type Data struct { + Labels []string `json:"labels"` + Datasets []Dataset `json:"datasets"` +} + +type Config struct { + Type Variant `json:"type"` + Data Data `json:"data"` + Options Options `json:"options,omitempty"` + ShowLegend bool `json:"showLegend,omitempty"` + ShowXAxis bool `json:"showXAxis"` + ShowYAxis bool `json:"showYAxis"` + ShowXLabels bool `json:"showXLabels"` + ShowYLabels bool `json:"showYLabels"` + ShowXGrid bool `json:"showXGrid"` + ShowYGrid bool `json:"showYGrid"` + Horizontal bool `json:"horizontal"` + Stacked bool `json:"stacked"` +} + +// Erweiterung des Props um ID und Attributes +type Props struct { + ID string + Variant Variant + Data Data + Options Options + ShowLegend bool + ShowXAxis bool + ShowYAxis bool + ShowXLabels bool + ShowYLabels bool + ShowXGrid bool + ShowYGrid bool + Horizontal bool + Stacked bool + Class string + Attributes templ.Attributes +} + +func Chart(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = "chart-" + utils.RandomID() + } + canvasId := p.ID + "-canvas" + dataId := p.ID + "-data" + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "chart-container relative", + p.Class), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + + chartConfig := Config{ + Type: p.Variant, + Data: p.Data, + Options: p.Options, + ShowLegend: p.ShowLegend, + ShowXAxis: p.ShowXAxis, + ShowYAxis: p.ShowYAxis, + ShowXLabels: p.ShowXLabels, + ShowYLabels: p.ShowYLabels, + ShowXGrid: p.ShowXGrid, + ShowYGrid: p.ShowYGrid, + Horizontal: p.Horizontal, + Stacked: p.Stacked, + } + templ_7745c5c3_Err = templ.JSONScript(dataId, chartConfig).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/checkbox/checkbox.templ b/server/web/templui/components/checkbox/checkbox.templ new file mode 100644 index 0000000..6967465 --- /dev/null +++ b/server/web/templui/components/checkbox/checkbox.templ @@ -0,0 +1,70 @@ +// templui component checkbox - version: main installed by templui v0.71.0 +package checkbox + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Disabled bool + Required bool + Checked bool + Icon templ.Component +} + +templ Checkbox(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + +
    + if p.Icon != nil { + @p.Icon + } else { + @icon.Check(icon.Props{Size: 12}) + } +
    +
    +} diff --git a/server/web/templui/components/checkbox/checkbox_templ.go b/server/web/templui/components/checkbox/checkbox_templ.go new file mode 100644 index 0000000..9f8648b --- /dev/null +++ b/server/web/templui/components/checkbox/checkbox_templ.go @@ -0,0 +1,225 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component checkbox - version: main installed by templui v0.71.0 + +package checkbox + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Disabled bool + Required bool + Checked bool + Icon templ.Component +} + +func Checkbox(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative size-4 overflow-hidden peer", + "before:absolute before:inset-0 before:content['']", + "appearance-none rounded-sm border-2 border-primary bg-background", + "cursor-pointer transition-colors", + "checked:before:bg-primary", + "disabled:cursor-not-allowed disabled:opacity-50", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 = []any{ + utils.TwMerge( + "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", + "size-3 text-primary-foreground pointer-events-none opacity-0", + "peer-checked:opacity-100", + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Icon != nil { + templ_7745c5c3_Err = p.Icon.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = icon.Check(icon.Props{Size: 12}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/checkboxcard/checkbox_card.templ b/server/web/templui/components/checkboxcard/checkbox_card.templ new file mode 100644 index 0000000..2e1e131 --- /dev/null +++ b/server/web/templui/components/checkboxcard/checkbox_card.templ @@ -0,0 +1,152 @@ +// templui component checkboxcard - version: main installed by templui v0.71.0 +package checkboxcard + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Checked bool + Disabled bool + Required bool + Name string + Value string +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ CheckboxCard(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + {{ inputId := p.ID + "-input" }} +
    + + +
    +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} diff --git a/server/web/templui/components/checkboxcard/checkbox_card_templ.go b/server/web/templui/components/checkboxcard/checkbox_card_templ.go new file mode 100644 index 0000000..67dc290 --- /dev/null +++ b/server/web/templui/components/checkboxcard/checkbox_card_templ.go @@ -0,0 +1,548 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component checkboxcard - version: main installed by templui v0.71.0 + +package checkboxcard + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Checked bool + Disabled bool + Required bool + Name string + Value string +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func CheckboxCard(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + inputId := p.ID + "-input" + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative", + utils.If(p.Disabled, "opacity-60"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 = []any{ + utils.TwMerge( + "block w-full rounded-lg border overflow-hidden h-full", + "bg-card text-card-foreground p-4 flex flex-col", + "cursor-pointer", + "hover:border-primary/50", + "peer-checked:ring-1 peer-checked:ring-primary peer-checked:border-primary", + utils.If(p.Disabled, "cursor-not-allowed"), + "transition-all duration-200", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{ + utils.TwMerge( + "flex items-center justify-between mb-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{ + utils.TwMerge( + "text-sm text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{ + utils.TwMerge( + "mt-auto pt-4 w-full", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/code/code.templ b/server/web/templui/components/code/code.templ new file mode 100644 index 0000000..b76c44b --- /dev/null +++ b/server/web/templui/components/code/code.templ @@ -0,0 +1,197 @@ +// templui component code - version: main installed by templui v0.71.0 +package code + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Size string + +const ( + SizeSm Size = "sm" + SizeLg Size = "lg" + SizeFull Size = "full" +) + +type Props struct { + ID string + Class string + Attrs templ.Attributes + Language string + ShowCopyButton bool + Size Size + CodeClass string +} + +templ Code(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = "code-" + utils.RandomID() }} + } +
    +
    +			
    +				{ children... }
    +			
    +		
    + if p.ShowCopyButton { + + } +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + + + } +} diff --git a/server/web/templui/components/code/code_templ.go b/server/web/templui/components/code/code_templ.go new file mode 100644 index 0000000..b2745d7 --- /dev/null +++ b/server/web/templui/components/code/code_templ.go @@ -0,0 +1,256 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component code - version: main installed by templui v0.71.0 + +package code + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Size string + +const ( + SizeSm Size = "sm" + SizeLg Size = "lg" + SizeFull Size = "full" +) + +type Props struct { + ID string + Class string + Attrs templ.Attributes + Language string + ShowCopyButton bool + Size Size + CodeClass string +} + +func Code(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = "code-" + utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("relative code-component", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ")
    +		if templ_7745c5c3_Err != nil {
    +			return templ_7745c5c3_Err
    +		}
    +		var templ_7745c5c3_Var5 = []any{
    +			utils.TwMerge(
    +				"language-"+p.Language,
    +				"overflow-y-auto! rounded-md block text-sm max-h-[501px]",
    +				utils.If(p.Size == SizeSm, "max-h-[250px]"),
    +				utils.If(p.Size == SizeLg, "max-h-[1000px]"),
    +				utils.If(p.Size == SizeFull, "max-h-full"),
    +				"hljs-target",
    +				p.CodeClass,
    +			),
    +		}
    +		templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...)
    +		if templ_7745c5c3_Err != nil {
    +			return templ_7745c5c3_Err
    +		}
    +		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "")
    +		if templ_7745c5c3_Err != nil {
    +			return templ_7745c5c3_Err
    +		}
    +		templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
    +		if templ_7745c5c3_Err != nil {
    +			return templ_7745c5c3_Err
    +		}
    +		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.ShowCopyButton { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/datepicker/date_picker.templ b/server/web/templui/components/datepicker/date_picker.templ new file mode 100644 index 0000000..44edf83 --- /dev/null +++ b/server/web/templui/components/datepicker/date_picker.templ @@ -0,0 +1,319 @@ +// templui component datepicker - version: main installed by templui v0.71.0 +package datepicker + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/calendar" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "time" +) + +type Format string +type LocaleTag string + +const ( + FormatLOCALE_SHORT Format = "locale-short" // Locale-specific short format (e.g., MM/DD/YY or DD.MM.YY) + FormatLOCALE_MEDIUM Format = "locale-medium" // Locale-specific medium format (e.g., Jan 5, 2024 or 5. Jan. 2024) + FormatLOCALE_LONG Format = "locale-long" // Locale-specific long format (e.g., January 5, 2024 or 5. Januar 2024) + FormatLOCALE_FULL Format = "locale-full" // Locale-specific full format (e.g., Monday, January 5, 2024 or Montag, 5. Januar 2024) +) + +// Common Locale (BCP 47) +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value time.Time + Format Format // Controls the display format using Intl dateStyle options. + LocaleTag LocaleTag // BCP 47 Locale Tag (e.g., "en-US", "es-ES"). Determines language and regional format defaults. + Placeholder string + Disabled bool + Required bool + HasError bool + Name string +} + +templ DatePicker(props ...Props) { + @Script() + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Name == "" { + p.Name = p.ID + } + if p.Placeholder == "" { + p.Placeholder = "Select a date" + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + if p.Format == "" { + p.Format = FormatLOCALE_MEDIUM + } + + var contentID = p.ID + "-content" + var valuePtr *time.Time + if !p.Value.IsZero() { + valuePtr = &p.Value + } + }} + @popover.Popover() { + @popover.Trigger(popover.TriggerProps{For: contentID}) { + @button.Button(button.Props{ + ID: p.ID, + Variant: button.VariantOutline, + Class: utils.TwMerge( + "w-full select-trigger flex items-center justify-between", + utils.If(p.HasError, "border-destructive ring-destructive"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes(p.Attributes, templ.Attributes{ + "data-datepicker": "true", + "data-display-format": string(p.Format), + "data-locale-tag": string(p.LocaleTag), + "data-placeholder": p.Placeholder, + }), + }) { + if p.Placeholder != "" { + + { p.Placeholder } + + } + + @icon.Calendar(icon.Props{Size: 16}) + + } + } + @popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Class: "p-3", + }) { + @calendar.Calendar(calendar.Props{ + ID: p.ID + "-calendar-instance", // Pass ID for calendar instance + Name: p.Name, // Pass Name for hidden input + LocaleTag: calendar.LocaleTag(p.LocaleTag), // Pass locale tag to calendar + Value: valuePtr, // Pass pointer to value + }) + } + } +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/datepicker/date_picker_templ.go b/server/web/templui/components/datepicker/date_picker_templ.go new file mode 100644 index 0000000..e2f84d0 --- /dev/null +++ b/server/web/templui/components/datepicker/date_picker_templ.go @@ -0,0 +1,328 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component datepicker - version: main installed by templui v0.71.0 + +package datepicker + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/calendar" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "time" +) + +type Format string +type LocaleTag string + +const ( + FormatLOCALE_SHORT Format = "locale-short" // Locale-specific short format (e.g., MM/DD/YY or DD.MM.YY) + FormatLOCALE_MEDIUM Format = "locale-medium" // Locale-specific medium format (e.g., Jan 5, 2024 or 5. Jan. 2024) + FormatLOCALE_LONG Format = "locale-long" // Locale-specific long format (e.g., January 5, 2024 or 5. Januar 2024) + FormatLOCALE_FULL Format = "locale-full" // Locale-specific full format (e.g., Monday, January 5, 2024 or Montag, 5. Januar 2024) +) + +// Common Locale (BCP 47) +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value time.Time + Format Format // Controls the display format using Intl dateStyle options. + LocaleTag LocaleTag // BCP 47 Locale Tag (e.g., "en-US", "es-ES"). Determines language and regional format defaults. + Placeholder string + Disabled bool + Required bool + HasError bool + Name string +} + +func DatePicker(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Name == "" { + p.Name = p.ID + } + if p.Placeholder == "" { + p.Placeholder = "Select a date" + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + if p.Format == "" { + p.Format = FormatLOCALE_MEDIUM + } + + var contentID = p.ID + "-content" + var valuePtr *time.Time + if !p.Value.IsZero() { + valuePtr = &p.Value + } + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + if p.Placeholder != "" { + var templ_7745c5c3_Var5 = []any{"text-left grow text-muted-foreground"} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/datepicker/date_picker.templ`, Line: 98, Col: 21} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Calendar(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Variant: button.VariantOutline, + Class: utils.TwMerge( + "w-full select-trigger flex items-center justify-between", + utils.If(p.HasError, "border-destructive ring-destructive"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes(p.Attributes, templ.Attributes{ + "data-datepicker": "true", + "data-display-format": string(p.Format), + "data-locale-tag": string(p.LocaleTag), + "data-placeholder": p.Placeholder, + }), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{For: contentID}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = calendar.Calendar(calendar.Props{ + ID: p.ID + "-calendar-instance", // Pass ID for calendar instance + Name: p.Name, // Pass Name for hidden input + LocaleTag: calendar.LocaleTag(p.LocaleTag), // Pass locale tag to calendar + Value: valuePtr, // Pass pointer to value + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Class: "p-3", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Popover().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/drawer/drawer.templ b/server/web/templui/components/drawer/drawer.templ new file mode 100644 index 0000000..fcfaac3 --- /dev/null +++ b/server/web/templui/components/drawer/drawer.templ @@ -0,0 +1,432 @@ +// templui component drawer - version: main installed by templui v0.71.0 +package drawer + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Position string + +const ( + PositionTop Position = "top" + PositionRight Position = "right" + PositionBottom Position = "bottom" + PositionLeft Position = "left" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Side Position +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Position Position +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CloseProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Drawer(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } +
    + { children... } +
    +} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + +
    +
    + { children... } +
    +
    +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Title(props ...TitleProps) { + {{ var p TitleProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Close(props ...CloseProps) { + {{ var p CloseProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/drawer/drawer_templ.go b/server/web/templui/components/drawer/drawer_templ.go new file mode 100644 index 0000000..1095418 --- /dev/null +++ b/server/web/templui/components/drawer/drawer_templ.go @@ -0,0 +1,946 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component drawer - version: main installed by templui v0.71.0 + +package drawer + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Position string + +const ( + PositionTop Position = "top" + PositionRight Position = "right" + PositionBottom Position = "bottom" + PositionLeft Position = "left" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Side Position +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Position Position +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TitleProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CloseProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Drawer(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var7 = []any{utils.TwMerge("cursor-pointer", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var12 = []any{ + utils.TwMerge( + "fixed z-50 templui-drawer-content hidden", + p.Class, + utils.If(p.Position == PositionRight, "inset-y-0 right-0 w-3/4 md:w-1/2 lg:w-1/3"), + utils.If(p.Position == PositionLeft, "inset-y-0 left-0 w-3/4 md:w-1/2 lg:w-1/3"), + utils.If(p.Position == PositionTop, "inset-x-0 top-0 h-auto sm:h-1/2"), + utils.If(p.Position == PositionBottom, "inset-x-0 bottom-0 h-auto sm:h-1/2"), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var16 = []any{ + utils.TwMerge( + "h-full overflow-y-auto bg-background p-6 shadow-lg", + utils.If(p.Position == PositionRight, "border-l"), + utils.If(p.Position == PositionLeft, "border-r"), + utils.If(p.Position == PositionBottom, "border-t"), + utils.If(p.Position == PositionTop, "border-b"), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var10.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var19 = []any{utils.TwMerge("flex flex-col space-y-1.5 pb-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var18.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Title(props ...TitleProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var22 := templ.GetChildren(ctx) + if templ_7745c5c3_Var22 == nil { + templ_7745c5c3_Var22 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TitleProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var23 = []any{utils.TwMerge("text-lg font-semibold leading-none tracking-tight", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var26 := templ.GetChildren(ctx) + if templ_7745c5c3_Var26 == nil { + templ_7745c5c3_Var26 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var27 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var26.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var30 := templ.GetChildren(ctx) + if templ_7745c5c3_Var30 == nil { + templ_7745c5c3_Var30 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var31 = []any{utils.TwMerge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pt-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var30.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Close(props ...CloseProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var34 := templ.GetChildren(ctx) + if templ_7745c5c3_Var34 == nil { + templ_7745c5c3_Var34 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p CloseProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var35 = []any{ + utils.TwMerge( + "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background", + "transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent", + "hover:text-accent-foreground h-10 px-4 py-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var35...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var34.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var38 := templ.GetChildren(ctx) + if templ_7745c5c3_Var38 == nil { + templ_7745c5c3_Var38 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var39 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var39), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/dropdown/dropdown.templ b/server/web/templui/components/dropdown/dropdown.templ new file mode 100644 index 0000000..5677d2b --- /dev/null +++ b/server/web/templui/components/dropdown/dropdown.templ @@ -0,0 +1,421 @@ +// templui component dropdown - version: main installed by templui v0.71.0 +package dropdown + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type contextKey string + +var ( + contentIDKey contextKey = "contentID" + subContentIDKey contextKey = "subContentID" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Width string + MaxHeight string + Align string + Side string +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Disabled bool + Href string + Target string +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ShortcutProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubTriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type PortalProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Dropdown(props ...Props) { + @Script() + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + contentID := p.ID + if contentID == "" { + contentID = utils.RandomID() + } + ctx = context.WithValue(ctx, contentIDKey, contentID) + }} + @popover.Popover(popover.Props{ + Class: p.Class, + }) { + { children... } + } +} + +templ Trigger(props ...TriggerProps) { + {{ + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-content-id" + } + }} + @popover.Trigger(popover.TriggerProps{ + ID: p.ID, + For: contentID, TriggerType: popover.TriggerTypeClick, + }) { + + { children... } + + } +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ contentID, ok := ctx.Value(contentIDKey).(string) }} + if !ok { + {{ contentID = "fallback-content-id" }} // Must match fallback in Trigger + } + {{ + var maxHeight string = "300px" + if p.MaxHeight != "" { + maxHeight = p.MaxHeight + } + maxHeightClass := fmt.Sprintf("max-h-[%s]", maxHeight) + }} + @popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + Class: utils.TwMerge( + "z-50 rounded-md bg-popover p-1 shadow-md focus:outline-none overflow-auto", + "border border-border", + "min-w-[8rem]", + maxHeightClass, + p.Width, + p.Class, + ), + Attributes: p.Attributes, + }) { + { children... } + } +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Label(props ...LabelProps) { + {{ var p LabelProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + if p.Href != "" { + + { children... } + + } else { + + } +} + +templ Separator(props ...SeparatorProps) { + {{ var p SeparatorProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +templ Shortcut(props ...ShortcutProps) { + {{ var p ShortcutProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Sub(props ...SubProps) { + {{ + var p SubProps + if len(props) > 0 { + p = props[0] + } + subContentID := p.ID + if subContentID == "" { + subContentID = utils.RandomID() + } + ctx = context.WithValue(ctx, subContentIDKey, subContentID) + }} +
    + { children... } +
    +} + +templ SubTrigger(props ...SubTriggerProps) { + {{ + var p SubTriggerProps + if len(props) > 0 { + p = props[0] + } + subContentID, ok := ctx.Value(subContentIDKey).(string) + if !ok { + subContentID = "fallback-subcontent-id" + } + }} + @popover.Trigger(popover.TriggerProps{ + ID: p.ID, + For: subContentID, + TriggerType: popover.TriggerTypeHover, + }) { + + } +} + +templ SubContent(props ...SubContentProps) { + {{ + var p SubContentProps + if len(props) > 0 { + p = props[0] + } + subContentID, ok := ctx.Value(subContentIDKey).(string) + if !ok { + subContentID = "fallback-subcontent-id" + } + }} + @popover.Content(popover.ContentProps{ + ID: subContentID, + Placement: popover.PlacementRightStart, + Offset: -4, // Adjust as needed + HoverDelay: 100, // ms + HoverOutDelay: 200, // ms + Class: utils.TwMerge( + "z-[9999] min-w-[8rem] rounded-md border bg-popover p-1 shadow-lg", + p.Class, + ), + Attributes: p.Attributes, + }) { + { children... } + } +} + +var dropdownHandle = templ.NewOnceHandle() + +templ Script() { + +} diff --git a/server/web/templui/components/dropdown/dropdown_templ.go b/server/web/templui/components/dropdown/dropdown_templ.go new file mode 100644 index 0000000..e0625fb --- /dev/null +++ b/server/web/templui/components/dropdown/dropdown_templ.go @@ -0,0 +1,1190 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component dropdown - version: main installed by templui v0.71.0 + +package dropdown + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type contextKey string + +var ( + contentIDKey contextKey = "contentID" + subContentIDKey contextKey = "subContentID" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Width string + MaxHeight string + Align string + Side string +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Disabled bool + Href string + Target string +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ShortcutProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubTriggerProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SubContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type PortalProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Dropdown(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + + var p Props + if len(props) > 0 { + p = props[0] + } + contentID := p.ID + if contentID == "" { + contentID = utils.RandomID() + } + ctx = context.WithValue(ctx, contentIDKey, contentID) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Popover(popover.Props{ + Class: p.Class, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-content-id" + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + var templ_7745c5c3_Var5 = []any{utils.TwMerge("inline-block", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ + ID: p.ID, + For: contentID, TriggerType: popover.TriggerTypeClick, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-content-id" + } + + var maxHeight string = "300px" + if p.MaxHeight != "" { + maxHeight = p.MaxHeight + } + maxHeightClass := fmt.Sprintf("max-h-[%s]", maxHeight) + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + Class: utils.TwMerge( + "z-50 rounded-md bg-popover p-1 shadow-md focus:outline-none overflow-auto", + "border border-border", + "min-w-[8rem]", + maxHeightClass, + p.Width, + p.Class, + ), + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{utils.TwMerge("py-1", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Label(props ...LabelProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LabelProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var14 = []any{utils.TwMerge("px-2 py-1.5 text-sm font-semibold", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Href != "" { + var templ_7745c5c3_Var18 = []any{ + utils.TwMerge( + "flex text-left items-center px-2 py-1.5 text-sm rounded-sm", + utils.If(!p.Disabled, "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default"), + utils.If(p.Disabled, "opacity-50 pointer-events-none"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var23 = []any{ + utils.TwMerge( + "w-full text-left flex items-center justify-between px-2 py-1.5 text-sm rounded-sm", + utils.If(!p.Disabled, "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default"), + utils.If(p.Disabled, "opacity-50 pointer-events-none"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func Separator(props ...SeparatorProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var26 := templ.GetChildren(ctx) + if templ_7745c5c3_Var26 == nil { + templ_7745c5c3_Var26 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SeparatorProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var27 = []any{utils.TwMerge("h-px my-1 -mx-1 bg-muted", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Shortcut(props ...ShortcutProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var30 := templ.GetChildren(ctx) + if templ_7745c5c3_Var30 == nil { + templ_7745c5c3_Var30 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ShortcutProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var31 = []any{utils.TwMerge("ml-auto text-xs tracking-widest opacity-60", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var30.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Sub(props ...SubProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var34 := templ.GetChildren(ctx) + if templ_7745c5c3_Var34 == nil { + templ_7745c5c3_Var34 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p SubProps + if len(props) > 0 { + p = props[0] + } + subContentID := p.ID + if subContentID == "" { + subContentID = utils.RandomID() + } + ctx = context.WithValue(ctx, subContentIDKey, subContentID) + var templ_7745c5c3_Var35 = []any{utils.TwMerge("relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var35...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var34.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func SubTrigger(props ...SubTriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var38 := templ.GetChildren(ctx) + if templ_7745c5c3_Var38 == nil { + templ_7745c5c3_Var38 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p SubTriggerProps + if len(props) > 0 { + p = props[0] + } + subContentID, ok := ctx.Value(subContentIDKey).(string) + if !ok { + subContentID = "fallback-subcontent-id" + } + templ_7745c5c3_Var39 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + var templ_7745c5c3_Var40 = []any{ + utils.TwMerge( + "w-full text-left flex items-center justify-between px-2 py-1.5 text-sm rounded-sm", + "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var40...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ + ID: p.ID, + For: subContentID, + TriggerType: popover.TriggerTypeHover, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var39), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func SubContent(props ...SubContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var42 := templ.GetChildren(ctx) + if templ_7745c5c3_Var42 == nil { + templ_7745c5c3_Var42 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p SubContentProps + if len(props) > 0 { + p = props[0] + } + subContentID, ok := ctx.Value(subContentIDKey).(string) + if !ok { + subContentID = "fallback-subcontent-id" + } + templ_7745c5c3_Var43 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var42.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: subContentID, + Placement: popover.PlacementRightStart, + Offset: -4, // Adjust as needed + HoverDelay: 100, // ms + HoverOutDelay: 200, // ms + Class: utils.TwMerge( + "z-[9999] min-w-[8rem] rounded-md border bg-popover p-1 shadow-lg", + p.Class, + ), + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var43), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var dropdownHandle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var44 := templ.GetChildren(ctx) + if templ_7745c5c3_Var44 == nil { + templ_7745c5c3_Var44 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/form/form.templ b/server/web/templui/components/form/form.templ new file mode 100644 index 0000000..3999bc4 --- /dev/null +++ b/server/web/templui/components/form/form.templ @@ -0,0 +1,137 @@ +// templui component form - version: main installed by templui v0.71.0 +package form + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/label" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type MessageVariant string + +const ( + MessageVariantError MessageVariant = "error" + MessageVariantInfo MessageVariant = "info" +) + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes + For string + DisabledClass string +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type MessageProps struct { + ID string + Class string + Attributes templ.Attributes + Variant MessageVariant +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ ItemFlex(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Label(props ...LabelProps) { + {{ var p LabelProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + @label.Label(label.Props{ + ID: p.ID, + Class: p.Class, + Attributes: p.Attributes, + For: p.For, + }) { + { children... } + } +} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Message(props ...MessageProps) { + {{ var p MessageProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +func messageVariantClass(variant MessageVariant) string { + switch variant { + case MessageVariantError: + return "text-red-500" + case MessageVariantInfo: + return "text-blue-500" + default: + return "" + } +} diff --git a/server/web/templui/components/form/form_templ.go b/server/web/templui/components/form/form_templ.go new file mode 100644 index 0000000..6582349 --- /dev/null +++ b/server/web/templui/components/form/form_templ.go @@ -0,0 +1,485 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component form - version: main installed by templui v0.71.0 + +package form + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/label" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type MessageVariant string + +const ( + MessageVariantError MessageVariant = "error" + MessageVariantInfo MessageVariant = "info" +) + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes + For string + DisabledClass string +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type MessageProps struct { + ID string + Class string + Attributes templ.Attributes + Variant MessageVariant +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("space-y-2", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func ItemFlex(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{utils.TwMerge("items-center flex space-x-2", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Label(props ...LabelProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LabelProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = label.Label(label.Props{ + ID: p.ID, + Class: p.Class, + Attributes: p.Attributes, + For: p.For, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Message(props ...MessageProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p MessageProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{ + utils.TwMerge( + "text-[0.8rem] font-medium", + messageVariantClass(p.Variant), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func messageVariantClass(variant MessageVariant) string { + switch variant { + case MessageVariantError: + return "text-red-500" + case MessageVariantInfo: + return "text-blue-500" + default: + return "" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/icon/icon.go b/server/web/templui/components/icon/icon.go new file mode 100644 index 0000000..8d1f5df --- /dev/null +++ b/server/web/templui/components/icon/icon.go @@ -0,0 +1,117 @@ +// templui component icon - version: main installed by templui v0.71.0 +package icon + +import ( + "context" + "fmt" + "io" + "sync" + + "github.com/a-h/templ" +) + +// iconContents caches the fully generated SVG strings for icons that have been used, +// keyed by a composite key of name and props to handle different stylings. +var ( + iconContents = make(map[string]string) + iconMutex sync.RWMutex +) + +// Props defines the properties that can be set for an icon. +type Props struct { + Size int + Color string + Fill string + Stroke string + StrokeWidth string // Stroke Width of Icon, Usage: "2.5" + Class string +} + +// Icon returns a function that generates a templ.Component for the specified icon name. +func Icon(name string) func(...Props) templ.Component { + return func(props ...Props) templ.Component { + var p Props + if len(props) > 0 { + p = props[0] + } + + // Create a unique key for the cache based on icon name and all relevant props. + // This ensures different stylings of the same icon are cached separately. + cacheKey := fmt.Sprintf("%s|s:%d|c:%s|f:%s|sk:%s|sw:%s|cl:%s", + name, p.Size, p.Color, p.Fill, p.Stroke, p.StrokeWidth, p.Class) + + return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) { + iconMutex.RLock() + svg, cached := iconContents[cacheKey] + iconMutex.RUnlock() + + if cached { + _, err = w.Write([]byte(svg)) + return err + } + + // Not cached, generate it + // The actual generation now happens once and is cached. + generatedSvg, err := generateSVG(name, p) // p (Props) is passed to generateSVG + if err != nil { + // Provide more context in the error message + return fmt.Errorf("failed to generate svg for icon '%s' with props %+v: %w", name, p, err) + } + + iconMutex.Lock() + iconContents[cacheKey] = generatedSvg + iconMutex.Unlock() + + _, err = w.Write([]byte(generatedSvg)) + return err + }) + } +} + +// generateSVG creates an SVG string for the specified icon with the given properties. +// This function is called when an icon-prop combination is not yet in the cache. +func generateSVG(name string, props Props) (string, error) { + // Get the raw, inner SVG content for the icon name from our internal data map. + content, err := getIconContent(name) // This now reads from internalSvgData + if err != nil { + return "", err // Error from getIconContent already includes icon name + } + + size := props.Size + if size <= 0 { + size = 24 // Default size + } + + fill := props.Fill + if fill == "" { + fill = "none" // Default fill + } + + stroke := props.Stroke + if stroke == "" { + stroke = props.Color // Fallback to Color if Stroke is not set + } + if stroke == "" { + stroke = "currentColor" // Default stroke color + } + + strokeWidth := props.StrokeWidth + if strokeWidth == "" { + strokeWidth = "2" // Default stroke width + } + + // Construct the final SVG string. + // The data-lucide attribute helps identify these as Lucide icons if needed. + return fmt.Sprintf("%s", + size, size, fill, stroke, strokeWidth, props.Class, content), nil +} + +// getIconContent retrieves the raw inner SVG content for a given icon name. +// It reads from the pre-generated internalSvgData map from icon_data.go. +func getIconContent(name string) (string, error) { + content, exists := internalSvgData[name] + if !exists { + return "", fmt.Errorf("icon '%s' not found in internalSvgData map", name) + } + return content, nil +} diff --git a/server/web/templui/components/icon/icon_data.go b/server/web/templui/components/icon/icon_data.go new file mode 100644 index 0000000..e0aad7e --- /dev/null +++ b/server/web/templui/components/icon/icon_data.go @@ -0,0 +1,6289 @@ +// templui component icon - version: main installed by templui v0.71.0 +package icon + +// This file is auto generated +// Using Lucide icons version 0.507.0 + +const LucideVersion = "0.507.0" + +var internalSvgData = map[string]string{ + "layout-panel-left": ` + + `, + "arrow-big-left-dash": ` + `, + "banknote": ` + + `, + "chart-column-big": ` + + `, + "clover": ` + + `, + "corner-right-up": ` + `, + "drumstick": ` + `, + "alarm-clock-plus": ` + + + + + + `, + "align-end-vertical": ` + + `, + "badge-info": ` + + `, + "battery-full": ` + + + + `, + "file-chart-column": ` + + + + `, + "grip-vertical": ` + + + + + `, + "git-commit-horizontal": ` + + `, + "megaphone-off": ` + + + `, + "calculator": ` + + + + + + + + + `, + "between-horizontal-end": ` + + `, + "chevron-right": ``, + "creative-commons": ` + + `, + "heading-4": ` + + + + `, + "message-square-heart": ` + `, + "pencil": ` + `, + "power-off": ` + + + `, + "biceps-flexed": ` + + `, + "headphones": ``, + "funnel-plus": ` + + `, + "scroll-text": ` + + + `, + "swords": ` + + + + + + + `, + "list-todo": ` + + + + `, + "move-vertical": ` + + `, + "bandage": ` + + + + + + `, + "book-type": ` + + + `, + "circle-check": ` + `, + "drill": ` + + + + + `, + "file-plus-2": ` + + + `, + "inspection-panel": ` + + + + `, + "calendar-minus-2": ` + + + + `, + "dollar-sign": ` + `, + "memory-stick": ` + + + + + + + + `, + "octagon-alert": ` + + `, + "phone-missed": ` + + `, + "piggy-bank": ` + + `, + "scan-heart": ` + + + + `, + "square-arrow-down-left": ` + + `, + "align-vertical-distribute-center": ` + + + + + `, + "binoculars": ` + + + + + `, + "circle-fading-arrow-up": ` + + + + + + `, + "dice-1": ` + `, + "file-lock": ` + + `, + "hand-platter": ` + + + + + `, + "heart-handshake": ` + + + `, + "picture-in-picture": ` + + + + `, + "database-zap": ` + + + + `, + "download": ` + + `, + "file-pen-line": ` + + `, + "folder-check": ` + `, + "heading-3": ` + + + + `, + "frown": ` + + + `, + "lock-keyhole-open": ` + + `, + "map-pin-plus": ` + + + `, + "backpack": ` + + + + `, + "calendar-plus-2": ` + + + + + `, + "file-badge": ` + + + `, + "fuel": ` + + + `, + "piano": ` + + + + + `, + "receipt-japanese-yen": ` + + + + `, + "scan": ` + + + `, + "sword": ` + + + `, + "align-vertical-justify-center": ` + + `, + "chart-no-axes-gantt": ` + + `, + "chart-pie": ` + `, + "grid-2x2-plus": ` + + `, + "table-of-contents": ` + + + + + `, + "square-power": ` + + `, + "trash-2": ` + + + + `, + "file-badge-2": ` + + `, + "fish-off": ` + + `, + "gavel": ` + + + + `, + "list-checks": ` + + + + `, + "shield-ban": ` + `, + "square-minus": ` + `, + "university": ` + + + + + + `, + "book-audio": ` + + + `, + "bookmark-plus": ` + + `, + "chart-gantt": ` + + + `, + "leaf": ` + `, + "lock": ` + `, + "plus": ` + `, + "square-kanban": ` + + + `, + "square-pi": ` + + + `, + "calendar-search": ` + + + + + `, + "club": ` + `, + "flame-kindling": ` + + `, + "house": ` + `, + "square-round-corner": ` + `, + "book": ``, + "cloud-moon-rain": ` + + + `, + "flag-triangle-right": ``, + "location-edit": ` + + `, + "package": ` + + + `, + "microscope": ` + + + + + `, + "torus": ` + `, + "unplug": ` + + + + + `, + "bomb": ` + + `, + "file-diff": ` + + + `, + "house-wifi": ` + + + `, + "mic-off": ` + + + + + `, + "redo-2": ` + `, + "table-cells-split": ` + + + `, + "squircle": ``, + "user-round-cog": ` + + + + + + + + + + `, + "decimals-arrow-right": ` + + + + `, + "file-video-2": ` + + + `, + "minimize": ` + + + `, + "smile": ` + + + `, + "axe": ` + `, + "house-plug": ` + + + `, + "message-circle": ``, + "octagon-x": ` + + `, + "users-round": ` + + `, + "arrows-up-from-line": ` + + + + `, + "circle-dot-dashed": ` + + + + + + + + `, + "ear-off": ` + + + + `, + "layers-2": ` + `, + "map-pin-x": ` + + + `, + "message-square-quote": ` + + `, + "navigation": ``, + "minus": ``, + "list-check": ` + + + `, + "reply": ` + `, + "scroll": ` + `, + "search-slash": ` + + `, + "section": ` + `, + "unlink": ` + + + + + `, + "a-large-small": ` + + + `, + "earth-lock": ` + + + + + `, + "octagon-pause": ` + + `, + "square-arrow-up": ` + + `, + "cookie": ` + + + + + `, + "music": ` + + `, + "monitor-off": ` + + + + `, + "sun-medium": ` + + + + + + + + `, + "traffic-cone": ` + + + `, + "volume-off": ` + + + + `, + "cake": ` + + + + + + + + `, + "message-square-share": ` + + `, + "pound-sterling": ` + + + `, + "slack": ` + + + + + + + `, + "wifi-low": ` + `, + "activity": ``, + "ampersand": ` + `, + "badge-japanese-yen": ` + + + + `, + "book-check": ` + `, + "clock-5": ` + `, + "locate-off": ` + + + + + + `, + "log-in": ` + + `, + "octagon-minus": ` + `, + "alarm-clock": ` + + + + + `, + "archive-x": ` + + + `, + "circle-minus": ` + `, + "hop-off": ` + + + + + + + + `, + "ligature": ` + + + + `, + "map": ` + + `, + "search-code": ` + + + `, + "tv": ` + `, + "arrow-down-narrow-wide": ` + + + + `, + "hop": ` + + + + + + + `, + "paintbrush": ` + + `, + "signpost-big": ` + + + `, + "square-check": ` + `, + "circle-equal": ` + + `, + "egg": ``, + "file-check-2": ` + + `, + "flip-horizontal": ` + + + + + `, + "lasso": ` + + `, + "paint-roller": ` + + `, + "sigma": ``, + "align-vertical-justify-start": ` + + `, + "sprout": ` + + + `, + "wheat-off": ` + + + + + + + + + `, + "align-horizontal-justify-start": ` + + `, + "badge-dollar-sign": ` + + `, + "check": ``, + "circle-play": ` + `, + "message-square-plus": ` + + `, + "saudi-riyal": ` + + + `, + "signal": ` + + + + `, + "badge-percent": ` + + + `, + "file-question": ` + + `, + "file-video": ` + + `, + "tally-4": ` + + + `, + "rocket": ` + + + `, + "wine": ` + + + `, + "antenna": ` + + + + + `, + "circle-small": ``, + "git-fork": ` + + + + `, + "list-x": ` + + + + `, + "siren": ` + + + + + + + `, + "clock-3": ` + `, + "layers": ` + + `, + "spell-check-2": ` + + `, + "unfold-vertical": ` + + + + + + + `, + "calendar-arrow-down": ` + + + + + `, + "battery-medium": ` + + + `, + "brain-circuit": ` + + + + + + + + + + + + `, + "cloud-sun-rain": ` + + + + + + + `, + "redo": ` + `, + "table-columns-split": ` + + + + + + + + + + `, + "bot-off": ` + + + + + + `, + "codesandbox": ` + + + + + `, + "lock-keyhole": ` + + `, + "square-dashed-mouse-pointer": ` + + + + + + + + + `, + "utensils": ` + + `, + "brick-wall": ` + + + + + + + `, + "circle-slash": ` + `, + "file-type": ` + + + + `, + "folder-minus": ` + `, + "laptop": ` + `, + "party-popper": ` + + + + + + + + `, + "move-down": ` + `, + "wand-sparkles": ` + + + + + + + `, + "fish-symbol": ``, + "volume-2": ` + + `, + "pointer-off": ` + + + + + `, + "dice-2": ` + + `, + "door-closed": ` + + `, + "git-compare-arrows": ` + + + + + `, + "git-graph": ` + + + + + `, + "share": ` + + `, + "toggle-left": ` + `, + "webhook-off": ` + + + + + + `, + "eraser": ` + + `, + "monitor-cog": ` + + + + + + + + + + + `, + "move-down-left": ` + `, + "shell": ``, + "book-open": ` + `, + "pointer": ` + + + + `, + "shield-half": ` + `, + "thumbs-down": ` + `, + "square-parking": ` + `, + "cloud-rain": ` + + + `, + "ghost": ` + + `, + "image-play": ` + + + `, + "layout-panel-top": ` + + `, + "mouse": ` + `, + "square-dashed": ` + + + + + + + + + + + `, + "badge": ``, + "flag-off": ` + + + `, + "search-x": ` + + + `, + "square-chevron-left": ` + `, + "square-parking-off": ` + + + + `, + "align-start-vertical": ` + + `, + "calendar-x": ` + + + + + `, + "circuit-board": ` + + + + `, + "folder-symlink": ` + `, + "list": ` + + + + + `, + "picture-in-picture-2": ` + `, + "wand": ` + + + + + + + + `, + "arrow-big-right-dash": ` + `, + "file-output": ` + + + + `, + "hand-heart": ` + + + `, + "heading-1": ` + + + `, + "key": ` + + `, + "land-plot": ` + + + `, + "mail": ` + `, + "sun-dim": ` + + + + + + + + `, + "alarm-smoke": ` + + + + `, + "align-vertical-distribute-start": ` + + + `, + "arrow-up-1-0": ` + + + + `, + "calendar-cog": ` + + + + + + + + + + + + `, + "circle-arrow-out-down-right": ` + + `, + "clipboard-x": ` + + + `, + "list-video": ` + + + `, + "notebook": ` + + + + + `, + "book-minus": ` + `, + "battery-charging": ` + + + `, + "monitor-pause": ` + + + + `, + "quote": ` + `, + "rotate-cw-square": ` + + `, + "rows-3": ` + + `, + "tablet-smartphone": ` + + `, + "user-minus": ` + + `, + "circle-dollar-sign": ` + + `, + "ruler": ` + + + + `, + "user-round-plus": ` + + + `, + "podcast": ` + + + `, + "clipboard-list": ` + + + + + `, + "omega": ``, + "popcorn": ` + + + `, + "square-chevron-down": ` + `, + "ticket-check": ` + `, + "user-x": ` + + + `, + "wallet-minimal": ` + `, + "blocks": ` + `, + "hand-coins": ` + + + + `, + "maximize": ` + + + `, + "plug-zap": ` + + + + `, + "infinity": ``, + "lamp-ceiling": ` + + `, + "mail-question": ` + + + `, + "nut-off": ` + + + + `, + "package-x": ` + + + + `, + "radio-receiver": ` + + + `, + "rotate-ccw-square": ` + + `, + "table-cells-merge": ` + + + + `, + "archive-restore": ` + + + + `, + "chevrons-up-down": ` + `, + "hard-hat": ` + + + `, + "lamp-floor": ` + + `, + "logs": ` + + + + + + + + `, + "tangent": ` + + + `, + "upload": ` + + `, + "cloud-off": ` + + `, + "lamp-wall-down": ` + + `, + "message-circle-dashed": ` + + + + + + + `, + "sunrise": ` + + + + + + + `, + "between-vertical-end": ` + + `, + "chart-column": ` + + + `, + "decimals-arrow-left": ` + + + `, + "plug": ` + + + `, + "step-back": ` + `, + "align-left": ` + + `, + "book-up": ` + + `, + "battery-plus": ` + + + + `, + "clipboard-plus": ` + + + `, + "lightbulb": ` + + `, + "shield-minus": ` + `, + "volume-x": ` + + `, + "file-text": ` + + + + `, + "refrigerator": ` + + `, + "arrow-left-from-line": ` + + `, + "badge-indian-rupee": ` + + + `, + "bean-off": ` + + + `, + "circle-chevron-up": ` + `, + "concierge-bell": ` + + + `, + "focus": ` + + + + `, + "library-big": ` + + `, + "message-circle-x": ` + + `, + "arrow-down-z-a": ` + + + + `, + "fan": ` + `, + "move-down-right": ` + `, + "shrimp": ` + + + + `, + "spray-can": ` + + + + + + + + + `, + "refresh-cw-off": ` + + + + + + `, + "clock-arrow-up": ` + + + `, + "coins": ` + + + `, + "sandwich": ` + + + + `, + "shovel": ` + + `, + "shower-head": ` + + + + + + + + + `, + "square-bottom-dashed-scissors": ` + + + + + + + `, + "arrow-big-up-dash": ` + `, + "bell-ring": ` + + + `, + "dna": ` + + + + + + + + + + `, + "file-archive": ` + + + + + `, + "folder-closed": ` + `, + "funnel": ``, + "inbox": ` + `, + "star-off": ` + + `, + "bell-off": ` + + + `, + "clock-alert": ` + + + `, + "fingerprint": ` + + + + + + + + `, + "iteration-ccw": ` + `, + "ungroup": ` + `, + "ear": ` + `, + "file-audio-2": ` + + + + `, + "remove-formatting": ` + + + + `, + "square-arrow-out-up-left": ` + + `, + "smartphone": ` + `, + "folder-sync": ` + + + + `, + "signature": ` + `, + "spline-pointer": ` + + + `, + "trending-down": ` + `, + "user-round-minus": ` + + `, + "circle-chevron-down": ` + `, + "folder-search": ` + + `, + "lasso-select": ` + + + + `, + "skip-back": ` + `, + "square-code": ` + + `, + "banana": ` + `, + "clock-4": ` + `, + "copy-plus": ` + + + `, + "credit-card": ` + `, + "file-audio": ` + + `, + "music-2": ` + `, + "power": ` + `, + "sticky-note": ` + `, + "book-marked": ` + `, + "cloud-fog": ` + + `, + "message-circle-more": ` + + + `, + "syringe": ` + + + + + `, + "test-tubes": ` + + + + + `, + "align-right": ` + + `, + "circle-divide": ` + + + `, + "message-square-dashed": ` + + + + + + + + `, + "proportions": ` + + `, + "squares-subtract": ` + + + + + `, + "triangle": ``, + "cloud-rain-wind": ` + + + `, + "arrow-up-a-z": ` + + + + `, + "equal": ` + `, + "eye": ` + `, + "image-off": ` + + + + + `, + "text-select": ` + + + + + + + + + + + + + + `, + "square-library": ` + + + `, + "square-terminal": ` + + `, + "bell-electric": ` + + + + + `, + "swatch-book": ` + + + `, + "user-check": ` + + `, + "arrow-up-from-line": ` + + `, + "door-closed-locked": ` + + + + `, + "file-axis-3d": ` + + + `, + "ice-cream-bowl": ` + + `, + "signal-medium": ` + + `, + "unlink-2": ``, + "group": ` + + + + + `, + "instagram": ` + + `, + "separator-vertical": ` + + `, + "user": ` + `, + "archive": ` + + `, + "brain": ` + + + + + + + + `, + "clapperboard": ` + + + `, + "file-search": ` + + + `, + "history": ` + + `, + "loader": ` + + + + + + + `, + "link-2": ` + + `, + "moon": ``, + "axis-3d": ` + `, + "badge-x": ` + + `, + "candy-cane": ` + + + + `, + "dices": ` + + + + + `, + "git-pull-request-closed": ` + + + + + `, + "joystick": ` + + + `, + "lock-open": ` + `, + "panel-left-close": ` + + `, + "align-horizontal-distribute-end": ` + + + `, + "audio-lines": ` + + + + + `, + "chart-column-increasing": ` + + + `, + "chevrons-left": ` + `, + "cloud-moon": ` + `, + "phone-incoming": ` + + `, + "screen-share": ` + + + + `, + "thermometer-sun": ` + + + + + `, + "arrow-down-wide-narrow": ` + + + + `, + "chevrons-left-right-ellipsis": ` + + + + `, + "locate-fixed": ` + + + + + `, + "link-2-off": ` + + + `, + "monitor-dot": ` + + + `, + "settings": ` + `, + "tornado": ` + + + + `, + "wine-off": ` + + + + `, + "baseline": ` + + `, + "file-x-2": ` + + + `, + "printer": ` + + `, + "radius": ` + + + `, + "car": ` + + + `, + "eclipse": ` + `, + "mars-stroke": ` + + + `, + "merge": ` + + `, + "receipt-russian-ruble": ` + + `, + "satellite": ` + + + + `, + "scan-face": ` + + + + + + `, + "calendar-plus": ` + + + + + `, + "circle-x": ` + + `, + "cog": ` + + + + + + + + + + + + + `, + "square-play": ` + `, + "touchpad": ` + + `, + "dribbble": ` + + + `, + "parentheses": ` + `, + "pc-case": ` + + + `, + "puzzle": ``, + "smartphone-charging": ` + `, + "bring-to-front": ` + + `, + "circle-plus": ` + + `, + "scan-barcode": ` + + + + + + `, + "bold": ``, + "circle-arrow-out-up-left": ` + + `, + "drama": ` + + + + + + + `, + "hamburger": ` + + + `, + "folder-up": ` + + `, + "goal": ` + + `, + "map-pin-house": ` + + + `, + "shield-user": ` + + `, + "align-horizontal-space-between": ` + + + `, + "feather": ` + + `, + "save-off": ` + + + + + + `, + "square": ``, + "user-lock": ` + + + `, + "umbrella-off": ` + + + `, + "tv-minimal-play": ` + + `, + "air-vent": ` + + + `, + "calendar-check-2": ` + + + + `, + "bean": ` + `, + "camera-off": ` + + + `, + "navigation-2-off": ` + + `, + "speaker": ` + + + `, + "square-slash": ` + `, + "step-forward": ` + `, + "file-box": ` + + + + `, + "gem": ` + + `, + "lamp-desk": ` + + + `, + "phone-forwarded": ` + + `, + "printer-check": ` + + + `, + "receipt-indian-rupee": ` + + + `, + "shopping-basket": ` + + + + + + `, + "test-tube-diagonal": ` + + `, + "chart-no-axes-column-decreasing": ` + + `, + "receipt-swiss-franc": ` + + + `, + "text-quote": ` + + + `, + "theater": ` + + + + + + + + `, + "tree-deciduous": ` + `, + "bow-arrow": ` + + + + `, + "kanban": ` + + `, + "megaphone": ` + `, + "view": ` + + + `, + "arrow-right-from-line": ` + + `, + "loader-circle": ``, + "panel-top": ` + `, + "pin": ` + `, + "radical": ``, + "speech": ` + + `, + "book-up-2": ` + + + + `, + "clock": ` + `, + "handshake": ` + + + + `, + "gallery-thumbnails": ` + + + + `, + "trash": ` + + `, + "alarm-clock-check": ` + + + + + `, + "audio-waveform": ``, + "bug-off": ` + + + + + + + + `, + "circle-gauge": ` + + `, + "contact-round": ` + + + + `, + "disc-2": ` + + `, + "sun": ` + + + + + + + + `, + "video": ` + `, + "arrow-left-to-line": ` + + `, + "clock-10": ` + `, + "cuboid": ` + + `, + "pause": ` + `, + "mouse-pointer-ban": ` + + `, + "square-equal": ` + + `, + "trophy": ` + + + + + `, + "chart-bar": ` + + + `, + "chart-network": ` + + + + + + `, + "calendar": ` + + + `, + "figma": ` + + + + `, + "fullscreen": ` + + + + `, + "message-circle-off": ` + + `, + "switch-camera": ` + + + + `, + "circle-arrow-right": ` + + `, + "circle-dot": ` + `, + "dice-4": ` + + + + `, + "file-json-2": ` + + + `, + "file-x": ` + + + `, + "hard-drive-upload": ` + + + + `, + "non-binary": ` + + + `, + "bike": ` + + + `, + "heading-6": ` + + + + `, + "git-pull-request-draft": ` + + + + `, + "github": ` + `, + "square-user": ` + + `, + "arrow-down-right": ` + `, + "crosshair": ` + + + + `, + "flask-conical-off": ` + + + + + `, + "folder-heart": ` + `, + "image-down": ` + + + `, + "paintbrush-vertical": ` + + + `, + "reply-all": ` + + `, + "angry": ` + + + + + `, + "circle-help": ` + + `, + "forward": ` + `, + "cloud-lightning": ` + `, + "battery-low": ` + + `, + "castle": ` + + + + + + + + `, + "equal-approximately": ` + `, + "hard-drive": ` + + + `, + "heart-plus": ` + + `, + "lamp-wall-up": ` + + `, + "smartphone-nfc": ` + + + `, + "tally-2": ` + `, + "chart-candlestick": ` + + + + + + `, + "mail-warning": ` + + + `, + "replace-all": ` + + + + + + + + `, + "star": ``, + "stethoscope": ` + + + + `, + "user-round-search": ` + + + `, + "weight": ` + `, + "arrow-big-down": ``, + "database-backup": ` + + + + + `, + "locate": ` + + + + `, + "mouse-pointer": ` + `, + "arrow-right": ` + `, + "brain-cog": ` + + + + + + + + + + + + + + `, + "corner-down-left": ` + `, + "file-spreadsheet": ` + + + + + `, + "pizza": ` + + + + `, + "replace": ` + + + + + + `, + "tower-control": ` + + + + + + `, + "whole-word": ` + + + + `, + "arrow-big-up": ``, + "bird": ` + + + + + `, + "diamond-minus": ` + `, + "flame": ``, + "folder-code": ` + + `, + "import": ` + + `, + "luggage": ` + + + + `, + "microchip": ` + + + + + + + + + + `, + "at-sign": ` + `, + "anchor": ` + + `, + "arrow-big-down-dash": ` + `, + "book-a": ` + + `, + "meh": ` + + + `, + "package-check": ` + + + + `, + "rotate-cw": ` + `, + "russian-ruble": ` + `, + "bookmark": ``, + "dice-3": ` + + + `, + "hard-drive-download": ` + + + + `, + "ratio": ` + `, + "square-activity": ` + `, + "toy-brick": ` + + `, + "wrench": ``, + "rectangle-horizontal": ``, + "map-pin-check-inside": ` + `, + "monitor-play": ` + + + `, + "square-arrow-down-right": ` + + `, + "square-arrow-up-left": ` + + `, + "tram-front": ` + + + + + + `, + "venus": ` + + `, + "wind": ` + + `, + "baggage-claim": ` + + + + `, + "calendar-check": ` + + + + `, + "case-sensitive": ` + + + `, + "door-open": ` + + + + `, + "eye-closed": ` + + + + `, + "folder-archive": ` + + + `, + "mail-x": ` + + + `, + "align-justify": ` + + `, + "book-copy": ` + + `, + "blinds": ` + + + + + + `, + "panel-top-open": ` + + `, + "target": ` + + `, + "pocket": ` + `, + "cat": ` + + + `, + "copy-check": ` + + `, + "headphone-off": ` + + + + `, + "hexagon": ``, + "highlighter": ` + `, + "mouse-pointer-2": ``, + "scan-qr-code": ` + + + + + + + `, + "ship-wheel": ` + + + + + + + + + `, + "anvil": ` + + + + `, + "bath": ` + + + + `, + "menu": ` + + `, + "sliders-horizontal": ` + + + + + + + + `, + "sun-moon": ` + + + + + + + + `, + "tags": ` + + `, + "square-pen": ` + `, + "triangle-alert": ` + + `, + "ambulance": ` + + + + + + `, + "battery-warning": ` + + + + `, + "chart-column-stacked": ` + + + + `, + "gamepad": ` + + + + `, + "notebook-text": ` + + + + + + + `, + "philippine-peso": ` + + `, + "corner-right-down": ` + `, + "flip-horizontal-2": ` + + + + + `, + "scan-line": ` + + + + `, + "venus-and-mars": ` + + + + `, + "cloud-snow": ` + + + + + + `, + "columns-3": ` + + `, + "message-square-reply": ` + + `, + "tally-5": ` + + + + `, + "user-cog": ` + + + + + + + + + + `, + "brick-wall-fire": ` + + + + + + `, + "corner-left-down": ` + `, + "guitar": ` + + + `, + "forklift": ` + + + `, + "move-right": ` + `, + "paint-bucket": ` + + + `, + "panel-left-dashed": ` + + + + `, + "square-arrow-up-right": ` + + `, + "square-x": ` + + `, + "type": ` + + `, + "copyright": ` + `, + "popsicle": ` + `, + "repeat-1": ` + + + + `, + "recycle": ` + + + + + `, + "shuffle": ` + + + + `, + "square-dashed-bottom": ` + + `, + "worm": ` + + `, + "clipboard-paste": ` + + + + `, + "grab": ` + + + + `, + "square-dot": ` + `, + "zap": ``, + "egg-off": ` + + `, + "lightbulb-off": ` + + + + `, + "pickaxe": ` + + + `, + "mountain": ``, + "circle-check-big": ` + `, + "ethernet-port": ` + + + + `, + "fold-horizontal": ` + + + + + + + `, + "folder-kanban": ` + + + `, + "git-merge": ` + + `, + "signpost": ` + + `, + "wrap-text": ` + + + `, + "badge-cent": ` + + `, + "book-heart": ` + `, + "chart-bar-stacked": ` + + + + `, + "corner-up-left": ` + `, + "file-chart-pie": ` + + + `, + "indian-rupee": ` + + + + `, + "list-music": ` + + + + `, + "move-up-right": ` + `, + "amphora": ` + + + + + `, + "banknote-x": ` + + + + + `, + "cone": ` + `, + "tree-palm": ` + + + `, + "truck-electric": ` + + + + + + `, + "user-pen": ` + + `, + "bell-minus": ` + + `, + "bubbles": ` + + + `, + "cloud-download": ` + + `, + "diamond-percent": ` + + + `, + "file-chart-column-increasing": ` + + + + `, + "key-round": ` + `, + "ticket-slash": ` + `, + "wheat": ` + + + + + + + `, + "align-horizontal-space-around": ` + + `, + "file-scan": ` + + + + + `, + "images": ` + + + `, + "lectern": ` + + `, + "settings-2": ` + + + `, + "snail": ` + + + + `, + "wifi-off": ` + + + + + + `, + "underline": ` + `, + "ban": ` + `, + "car-front": ` + + + + + `, + "circle-ellipsis": ` + + + `, + "crop": ` + `, + "file-lock-2": ` + + + `, + "pin-off": ` + + + `, + "receipt-euro": ` + + `, + "screen-share-off": ` + + + + `, + "terminal": ` + `, + "square-pilcrow": ` + + + `, + "flashlight-off": ` + + + `, + "hammer": ` + + `, + "route": ` + + `, + "bookmark-check": ` + `, + "cassette-tape": ` + + + + `, + "file-search-2": ` + + + `, + "mars": ` + + `, + "thumbs-up": ` + `, + "webhook": ` + + `, + "x": ` + `, + "youtube": ` + `, + "apple": ` + `, + "braces": ` + `, + "grip-horizontal": ` + + + + + `, + "list-plus": ` + + + + `, + "move": ` + + + + + `, + "scan-search": ` + + + + + `, + "square-arrow-left": ` + + `, + "telescope": ` + + + + + + `, + "clock-2": ` + `, + "file-volume": ` + + + `, + "panel-right": ` + `, + "voicemail": ` + + `, + "codepen": ` + + + + `, + "badge-euro": ` + + `, + "martini": ` + + `, + "sticker": ` + + + + `, + "align-center": ` + + `, + "book-down": ` + + `, + "calendar-off": ` + + + + + `, + "case-lower": ` + + + `, + "contact": ` + + + + `, + "radio-tower": ` + + + + + + `, + "videotape": ` + + + + `, + "copy-x": ` + + + `, + "file-chart-line": ` + + `, + "japanese-yen": ` + + `, + "utility-pole": ` + + + + + + `, + "watch": ` + + + `, + "alarm-clock-off": ` + + + + + `, + "arrow-up-to-line": ` + + `, + "bug-play": ` + + + + + + + + `, + "copy-minus": ` + + `, + "grid-2x2": ` + + `, + "newspaper": ` + + + `, + "ticket-percent": ` + + + `, + "square-function": ` + + `, + "building": ` + + + + + + + + + + `, + "cable": ` + + + + `, + "info": ` + + `, + "music-4": ` + + + `, + "paw-print": ` + + + `, + "phone": ``, + "save": ` + + `, + "shredder": ` + + + + + + `, + "layout-dashboard": ` + + + `, + "circle-arrow-out-down-left": ` + + `, + "circle-off": ` + + `, + "file-image": ` + + + `, + "glass-water": ` + `, + "shopping-bag": ` + + `, + "waves": ` + + `, + "rotate-3d": ` + + `, + "clock-fading": ` + + + + + `, + "server": ` + + + `, + "split": ` + + + `, + "swiss-franc": ` + + `, + "stamp": ` + + `, + "image-minus": ` + + + `, + "layout-grid": ` + + + `, + "grid-3x3": ` + + + + `, + "id-card": ` + + + + `, + "save-all": ` + + + `, + "shield-ellipsis": ` + + + `, + "between-vertical-start": ` + + `, + "circle-stop": ` + `, + "clock-12": ` + `, + "code-xml": ` + + `, + "panel-bottom-close": ` + + `, + "triangle-right": ``, + "briefcase-medical": ` + + + + + `, + "heart-crack": ` + `, + "refresh-ccw": ` + + + `, + "strikethrough": ` + + `, + "vault": ` + + + + + + + + + `, + "waves-ladder": ` + + + + `, + "arrow-up-left": ` + `, + "chevron-left": ``, + "film": ` + + + + + + + `, + "git-pull-request-arrow": ` + + + + `, + "lamp": ` + + `, + "message-circle-question": ` + + `, + "notebook-tabs": ` + + + + + + + + `, + "wifi-high": ` + + `, + "arrow-up-from-dot": ` + + `, + "chart-bar-decreasing": ` + + + `, + "chart-no-axes-column": ` + + `, + "cloudy": ` + `, + "file-symlink": ` + + `, + "map-pin-plus-inside": ` + + `, + "message-circle-plus": ` + + `, + "shield-x": ` + + `, + "cable-car": ` + + + + + + + `, + "chart-no-axes-column-increasing": ` + + `, + "cigarette": ` + + + + `, + "code": ` + `, + "grid-2x2-check": ` + `, + "package-minus": ` + + + + `, + "thermometer-snowflake": ` + + + + + + + `, + "alarm-clock-minus": ` + + + + + `, + "brush-cleaning": ` + + + `, + "drum": ` + + + + + + `, + "heading": ` + + `, + "package-search": ` + + + + + `, + "panel-left-open": ` + + `, + "square-percent": ` + + + `, + "chart-line": ` + `, + "candy-off": ` + + + + + + `, + "clipboard-pen-line": ` + + + + `, + "diamond-plus": ` + + `, + "ruler-dimension-line": ` + + + + + + `, + "shield": ``, + "tree-pine": ` + `, + "file-minus-2": ` + + `, + "footprints": ` + + + `, + "panel-bottom-open": ` + + `, + "aperture": ` + + + + + + `, + "baby": ` + + + `, + "cake-slice": ` + + + `, + "corner-left-up": ` + `, + "ham": ` + + + `, + "heart-off": ` + + `, + "git-branch-plus": ` + + + + + `, + "grape": ` + + + + + + + + `, + "arrow-down-from-line": ` + + `, + "key-square": ` + + `, + "message-circle-heart": ` + `, + "pen-line": ` + `, + "clock-1": ` + `, + "superscript": ` + + `, + "tally-1": ``, + "umbrella": ` + + `, + "chart-spline": ` + `, + "clipboard-copy": ` + + + + `, + "file-music": ` + + + `, + "laptop-minimal": ` + `, + "monitor": ` + + `, + "redo-dot": ` + + `, + "align-vertical-space-between": ` + + + `, + "asterisk": ` + + `, + "calendar-clock": ` + + + + + `, + "flag-triangle-left": ``, + "list-start": ` + + + + `, + "message-square-dot": ` + `, + "message-square-warning": ` + + `, + "nfc": ` + + + `, + "accessibility": ` + + + + `, + "currency": ` + + + + `, + "disc": ` + `, + "flag": ` + `, + "ice-cream-cone": ` + + `, + "lollipop": ` + + `, + "skip-forward": ` + `, + "twitter": ``, + "align-horizontal-justify-end": ` + + `, + "captions": ` + `, + "clock-arrow-down": ` + + + `, + "droplet": ``, + "folder-input": ` + + `, + "mountain-snow": ` + `, + "toggle-right": ` + `, + "boom-box": ` + + + + + + `, + "badge-check": ` + `, + "clipboard": ` + `, + "layout-list": ` + + + + + `, + "rotate-ccw-key": ` + + + + `, + "table-2": ``, + "zoom-in": ` + + + `, + "arrow-down-up": ` + + + `, + "arrow-down": ` + `, + "bluetooth-searching": ` + + `, + "cloud-cog": ` + + + + + + + + `, + "disc-album": ` + + `, + "file-digit": ` + + + + `, + "folder": ``, + "gauge": ` + `, + "arrow-right-to-line": ` + + `, + "circle-percent": ` + + + `, + "message-square": ``, + "text-search": ` + + + + `, + "squares-unite": ``, + "trending-up": ` + `, + "clock-plus": ` + + + `, + "facebook": ``, + "folder-output": ` + + `, + "monitor-check": ` + + + `, + "undo": ` + `, + "video-off": ` + + `, + "book-open-check": ` + + `, + "circle-arrow-left": ` + + `, + "file-code-2": ` + + + `, + "folder-down": ` + + `, + "haze": ` + + + + + + + `, + "panel-left": ` + `, + "pentagon": ``, + "move-diagonal": ` + + `, + "file-code": ` + + + `, + "map-pin-minus": ` + + `, + "monitor-x": ` + + + + `, + "rows-4": ` + + + `, + "shapes": ` + + `, + "shopping-cart": ` + + `, + "square-chevron-right": ` + `, + "square-chevron-up": ` + `, + "file-heart": ` + + `, + "fire-extinguisher": ` + + + + + `, + "refresh-cw": ` + + + `, + "square-dashed-bottom-code": ` + + + + `, + "square-dashed-kanban": ` + + + + + + + + + + + + + + `, + "user-round-check": ` + + `, + "washing-machine": ` + + + + `, + "bed": ` + + + `, + "cup-soda": ` + + + `, + "dot": ``, + "file-up": ` + + + `, + "keyboard-music": ` + + + + + + + + `, + "palette": ` + + + + `, + "monitor-speaker": ` + + + + `, + "align-center-vertical": ` + + + + `, + "pilcrow-right": ` + + + + `, + "rabbit": ` + + + + `, + "train-front": ` + + + + + `, + "waypoints": ` + + + + + + `, + "heater": ` + + + + + + + + + `, + "bluetooth-connected": ` + + `, + "circle-slash-2": ` + `, + "flower": ` + + + + + + + + + `, + "file": ` + `, + "align-vertical-space-around": ` + + `, + "book-x": ` + + `, + "circle-arrow-out-up-right": ` + + `, + "droplet-off": ` + + `, + "thermometer": ``, + "bluetooth-off": ` + + `, + "cylinder": ` + `, + "file-volume-2": ` + + + + `, + "network": ` + + + + `, + "panel-right-dashed": ` + + + + `, + "squares-exclude": ` + `, + "align-horizontal-distribute-start": ` + + + `, + "building-2": ` + + + + + + `, + "cannabis": ` + `, + "octagon": ``, + "package-open": ` + + + `, + "shirt": ``, + "boxes": ` + + + + + + + + + + + `, + "maximize-2": ` + + + `, + "square-radical": ` + `, + "bus": ` + + + + + + `, + "biohazard": ` + + + + + + + + + `, + "cloud-hail": ` + + + + + + `, + "corner-up-right": ` + `, + "file-stack": ` + + + `, + "grip": ` + + + + + + + + `, + "git-pull-request": ` + + + `, + "graduation-cap": ` + + `, + "check-check": ` + `, + "circle-chevron-left": ` + `, + "cloud-upload": ` + + `, + "magnet": ` + + `, + "pilcrow-left": ` + + + + `, + "pencil-off": ` + + + `, + "minimize-2": ` + + + `, + "sunset": ` + + + + + + + `, + "compass": ` + `, + "file-key-2": ` + + + + `, + "heart-minus": ` + `, + "rectangle-ellipsis": ` + + + `, + "spade": ` + `, + "square-split-vertical": ` + + `, + "venetian-mask": ` + + `, + "vibrate-off": ` + + + + `, + "arrow-down-left": ` + `, + "linkedin": ` + + `, + "pipette": ` + + `, + "framer": ``, + "table-properties": ` + + + `, + "clipboard-minus": ` + + `, + "folder-search-2": ` + + `, + "square-arrow-out-down-right": ` + + `, + "timer-off": ` + + + + `, + "chevrons-down": ` + `, + "divide": ` + + `, + "navigation-2": ``, + "phone-call": ` + + `, + "plane-landing": ` + `, + "qr-code": ` + + + + + + + + + + + `, + "book-lock": ` + + + `, + "file-clock": ` + + + `, + "folder-open-dot": ` + `, + "message-square-more": ` + + + `, + "text-cursor-input": ` + + + + `, + "triangle-dashed": ` + + + + + + + + `, + "a-arrow-down": ` + + + `, + "calendar-heart": ` + + + `, + "bot": ` + + + + + `, + "cloud-drizzle": ` + + + + + + `, + "eye-off": ` + + + `, + "fast-forward": ` + `, + "globe": ` + + `, + "binary": ` + + + + + `, + "chevrons-left-right": ` + `, + "file-json": ` + + + `, + "heading-2": ` + + + `, + "gallery-horizontal": ` + + `, + "navigation-off": ` + + `, + "router": ` + + + + + `, + "scan-text": ` + + + + + + `, + "app-window-mac": ` + + + `, + "calendar-1": ` + + + + `, + "cloud-sun": ` + + + + + `, + "file-cog": ` + + + + + + + + + + `, + "notepad-text-dashed": ` + + + + + + + + + + + + `, + "panel-top-dashed": ` + + + + `, + "pen": ``, + "separator-horizontal": ` + + `, + "arrow-big-left": ``, + "bell-dot": ` + + `, + "calendar-range": ` + + + + + + + `, + "chart-area": ` + `, + "citrus": ` + + + `, + "delete": ` + + `, + "ellipsis": ` + + `, + "send-to-back": ` + + + `, + "arrow-down-1-0": ` + + + + `, + "signal-high": ` + + + `, + "square-arrow-out-up-right": ` + + `, + "ticket": ` + + + `, + "undo-2": ` + `, + "badge-pound-sterling": ` + + + `, + "bitcoin": ``, + "diamond": ``, + "file-check": ` + + `, + "folder-clock": ` + + `, + "folder-dot": ` + `, + "funnel-x": ` + + `, + "medal": ` + + + + + `, + "clock-8": ` + `, + "mailbox": ` + + + `, + "landmark": ` + + + + + `, + "mic-vocal": ` + + `, + "monitor-smartphone": ` + + + `, + "radio": ` + + + + `, + "scale-3d": ` + + + `, + "sun-snow": ` + + + + + + + + + + `, + "arrow-left": ` + `, + "atom": ` + + `, + "circle-alert": ` + + `, + "columns-4": ` + + + `, + "copy": ` + `, + "table": ` + + + `, + "text-cursor": ` + + `, + "train-track": ` + + + + + + `, + "circle": ``, + "dock": ` + + `, + "map-plus": ` + + + + `, + "person-standing": ` + + + `, + "store": ` + + + + `, + "transgender": ` + + + + + + + `, + "user-round-pen": ` + + `, + "utensils-crossed": ` + + + `, + "align-vertical-distribute-end": ` + + + `, + "arrow-up-narrow-wide": ` + + + + `, + "briefcase": ` + `, + "link": ` + `, + "nut": ` + + `, + "microwave": ` + + + + `, + "rectangle-vertical": ``, + "tablet": ` + `, + "book-dashed": ` + + + + + + + + + + `, + "brackets": ` + `, + "mic": ` + + `, + "tractor": ` + + + + + + + + `, + "list-restart": ` + + + + `, + "notebook-pen": ` + + + + + `, + "move-horizontal": ` + + `, + "tag": ` + `, + "user-round": ` + `, + "cross": ``, + "file-input": ` + + + `, + "languages": ` + + + + + `, + "library": ` + + + `, + "ticket-plus": ` + + `, + "wifi-zero": ``, + "type-outline": ``, + "circle-pause": ` + + `, + "cloud": ``, + "flip-vertical": ` + + + + + `, + "layout-template": ` + + `, + "panel-bottom-dashed": ` + + + + `, + "phone-off": ` + + `, + "plane-takeoff": ` + `, + "space": ``, + "construction": ` + + + + + + + `, + "gallery-horizontal-end": ` + + `, + "chevron-first": ` + `, + "vote": ` + + `, + "align-center-horizontal": ` + + + + `, + "box": ` + + `, + "case-upper": ` + + `, + "sparkle": ``, + "tally-3": ` + + `, + "train-front-tunnel": ` + + + + + + `, + "badge-minus": ` + `, + "circle-parking": ` + `, + "clipboard-check": ` + + `, + "monitor-up": ` + + + + `, + "rainbow": ` + + `, + "send": ` + `, + "table-rows-split": ` + + + + + + + + + + `, + "square-arrow-right": ` + + `, + "airplay": ` + `, + "computer": ` + + + `, + "image-upscale": ` + + + + + + + `, + "package-plus": ` + + + + + `, + "pencil-ruler": ` + + + + + `, + "rotate-ccw": ` + `, + "slash": ``, + "square-split-horizontal": ` + + `, + "armchair": ` + + + `, + "cast": ` + + + `, + "chart-no-axes-combined": ` + + + + + `, + "chevron-down": ``, + "chevron-up": ``, + "dice-5": ` + + + + + `, + "external-link": ` + + `, + "heart": ``, + "component": ` + + + `, + "hourglass": ` + + + `, + "squirrel": ` + + + `, + "book-plus": ` + + `, + "chart-bar-big": ` + + `, + "droplets": ` + `, + "glasses": ` + + + + `, + "list-filter-plus": ` + + + + `, + "server-crash": ` + + + + `, + "trees": ` + + + `, + "trending-up-down": ` + + + `, + "arrow-up-wide-narrow": ` + + + + `, + "banknote-arrow-up": ` + + + + + `, + "bot-message-square": ` + + + + + `, + "dessert": ` + + `, + "ferris-wheel": ` + + + + + + + + `, + "indent-decrease": ` + + + `, + "pen-tool": ` + + + `, + "signal-low": ` + `, + "calendar-x-2": ` + + + + + `, + "camera": ` + `, + "flip-vertical-2": ` + + + + + `, + "gift": ` + + + `, + "iteration-cw": ` + `, + "music-3": ` + `, + "panel-right-close": ` + + `, + "soap-dispenser-droplet": ` + + + `, + "between-horizontal-start": ` + + `, + "egg-fried": ` + `, + "equal-not": ` + + `, + "git-pull-request-create": ` + + + + `, + "origami": ` + + `, + "sheet": ` + + + + `, + "star-half": ``, + "user-round-x": ` + + + `, + "brush": ` + + `, + "clock-11": ` + `, + "dumbbell": ` + + + + `, + "file-terminal": ` + + + `, + "mail-minus": ` + + `, + "message-square-off": ` + + `, + "timer": ` + + `, + "regex": ` + + + `, + "command": ``, + "arrow-up-down": ` + + + `, + "bookmark-minus": ` + `, + "cherry": ` + + + `, + "circle-user": ` + + `, + "milk-off": ` + + + `, + "square-check-big": ` + `, + "tv-minimal": ` + `, + "calendar-days": ` + + + + + + + + + `, + "carrot": ` + + `, + "captions-off": ` + + + + + `, + "circle-power": ` + + `, + "map-pinned": ` + + `, + "message-square-diff": ` + + + `, + "package-2": ` + + `, + "moon-star": ` + + `, + "message-square-lock": ` + + `, + "presentation": ` + + `, + "square-sigma": ` + `, + "timer-reset": ` + + + `, + "car-taxi-front": ` + + + + + + `, + "file-plus": ` + + + `, + "square-plus": ` + + `, + "book-open-text": ` + + + + + `, + "briefcase-business": ` + + + `, + "circle-chevron-right": ` + `, + "clock-7": ` + `, + "file-pen": ` + + `, + "hand": ` + + + `, + "log-out": ` + + `, + "rewind": ` + `, + "badge-alert": ` + + `, + "cctv": ` + + + + `, + "earth": ` + + + `, + "mail-search": ` + + + + `, + "pen-off": ` + + `, + "monitor-stop": ` + + + `, + "refresh-ccw-dot": ` + + + + `, + "grid-2x2-x": ` + + `, + "list-collapse": ` + + + + `, + "shrub": ` + + `, + "variable": ` + + + `, + "align-vertical-justify-end": ` + + `, + "arrow-big-right": ``, + "badge-swiss-franc": ` + + + `, + "chrome": ` + + + + `, + "clock-9": ` + `, + "panel-right-open": ` + + `, + "tent": ` + + + `, + "rocking-chair": ` + + + `, + "bolt": ` + `, + "chevrons-up": ` + `, + "drafting-compass": ` + + + + `, + "file-type-2": ` + + + + `, + "gitlab": ``, + "message-square-x": ` + + `, + "paperclip": ` + `, + "pilcrow": ` + + `, + "bus-front": ` + + + + + + + + `, + "battery": ` + `, + "donut": ` + `, + "rat": ` + + + + `, + "tablets": ` + + + `, + "square-divide": ` + + + `, + "disc-3": ` + + + `, + "map-pin-minus-inside": ` + `, + "shrink": ` + + + `, + "wallet-cards": ` + + `, + "beer": ` + + + + `, + "git-commit-vertical": ` + + `, + "milestone": ` + + `, + "square-arrow-out-down-left": ` + + `, + "clipboard-pen": ` + + + `, + "folder-open": ``, + "letter-text": ` + + + + `, + "pill-bottle": ` + + `, + "mouse-off": ` + + + `, + "scissors": ` + + + + `, + "shield-alert": ` + + `, + "spell-check": ` + + `, + "book-user": ` + + `, + "circle-dashed": ` + + + + + + + `, + "file-key": ` + + + `, + "rectangle-goggles": ``, + "tickets-plane": ` + + + + + + `, + "align-start-horizontal": ` + + `, + "blend": ` + `, + "beef": ` + + `, + "corner-down-right": ` + `, + "database": ` + + `, + "flower-2": ` + + + + `, + "italic": ` + + `, + "briefcase-conveyor-belt": ` + + + + + + `, + "ampersands": ` + `, + "circle-arrow-down": ` + + `, + "folder-tree": ` + + + `, + "house-plus": ` + + + `, + "sliders-vertical": ` + + + + + + + + `, + "volume": ``, + "repeat-2": ` + + + `, + "calendar-fold": ` + + + + `, + "gallery-vertical-end": ` + + `, + "scan-eye": ` + + + + + `, + "shield-plus": ` + + `, + "users": ` + + + `, + "volume-1": ` + `, + "banknote-arrow-down": ` + + + + + `, + "caravan": ` + + + `, + "ellipsis-vertical": ` + + `, + "heading-5": ` + + + + `, + "messages-square": ` + `, + "sofa": ` + + + + `, + "square-user-round": ` + + `, + "zap-off": ` + + + `, + "arrow-up": ` + `, + "badge-help": ` + + `, + "crown": ` + `, + "flask-conical": ` + + `, + "git-compare": ` + + + `, + "sailboat": ` + + `, + "server-cog": ` + + + + + + + + + + + `, + "ribbon": ` + + + + `, + "award": ` + `, + "plane": ``, + "wallpaper": ` + + + `, + "bluetooth": ``, + "fish": ` + + + + + `, + "folder-git": ` + + + `, + "folder-pen": ` + `, + "panels-top-left": ` + + `, + "pi": ` + + `, + "pyramid": ` + `, + "ship": ` + + + + `, + "app-window": ` + + + `, + "chart-bar-increasing": ` + + + `, + "map-pin-off": ` + + + + `, + "mouse-pointer-click": ` + + + + `, + "square-menu": ` + + + `, + "square-mouse-pointer": ` + `, + "webcam": ` + + + `, + "twitch": ``, + "book-image": ` + + `, + "columns-3-cog": ` + + + + + + + + + + + `, + "map-pin": ` + `, + "shield-question": ` + + `, + "truck": ` + + + + `, + "chart-column-decreasing": ` + + + `, + "cpu": ` + + + + + + + + + + + + + `, + "ticket-x": ` + + `, + "stretch-vertical": ` + `, + "warehouse": ` + + + `, + "cigarette-off": ` + + + + + `, + "dna-off": ` + + + + + + + + + `, + "file-sliders": ` + + + + + `, + "list-minus": ` + + + `, + "arrow-up-z-a": ` + + + + `, + "fence": ` + + + + + + `, + "folder-x": ` + + `, + "shield-check": ` + `, + "chevrons-right": ` + `, + "croissant": ` + + + + `, + "hand-helping": ` + + `, + "list-filter": ` + + `, + "salad": ` + + + + `, + "flashlight": ` + + `, + "mail-plus": ` + + + `, + "life-buoy": ` + + + + + `, + "snowflake": ` + + + + + + + + + + + `, + "dog": ` + + + + `, + "keyboard": ` + + + + + + + + `, + "phone-outgoing": ` + + `, + "square-asterisk": ` + + + `, + "square-stack": ` + + `, + "user-plus": ` + + + `, + "calendar-minus": ` + + + + `, + "circle-arrow-up": ` + + `, + "list-ordered": ` + + + + + `, + "map-pin-x-inside": ` + + `, + "percent": ` + + `, + "school": ` + + + + + `, + "arrow-left-right": ` + + + `, + "option": ` + `, + "repeat": ` + + + `, + "user-search": ` + + + `, + "calendar-sync": ` + + + + + + + `, + "coffee": ` + + + `, + "folder-key": ` + + + `, + "frame": ` + + + `, + "slice": ``, + "toilet": ` + `, + "book-headphones": ` + + + `, + "bed-single": ` + + `, + "circle-user-round": ` + + `, + "diff": ` + + `, + "move-up": ` + `, + "move-diagonal-2": ` + + `, + "square-square": ` + `, + "usb": ` + + + + + + `, + "receipt-pound-sterling": ` + + + `, + "milk": ` + + `, + "radar": ` + + + + + + + `, + "scaling": ` + + + `, + "squares-intersect": ` + + + + + + + + + + `, + "bed-double": ` + + + `, + "beer-off": ` + + + + + + + `, + "folder-cog": ` + + + + + + + + + `, + "hospital": ` + + + + + `, + "leafy-green": ` + `, + "move-up-left": ` + `, + "message-circle-reply": ` + + `, + "notepad-text": ` + + + + + + `, + "a-arrow-up": ` + + + `, + "diameter": ` + + + + `, + "projector": ` + + + + + `, + "radiation": ` + + + `, + "pocket-knife": ` + + + + `, + "square-scissors": ` + + + + + `, + "tickets": ` + + + + `, + "trello": ` + + `, + "circle-parking-off": ` + + + `, + "factory": ` + + + `, + "pill": ` + `, + "receipt-text": ` + + + `, + "roller-coaster": ` + + + + + + `, + "vibrate": ` + + `, + "candy": ` + + + + `, + "flask-round": ` + + `, + "folder-root": ` + + `, + "mail-check": ` + + `, + "message-square-code": ` + + `, + "receipt": ` + + `, + "soup": ` + + + + + `, + "zoom-out": ` + + `, + "arrow-down-a-z": ` + + + + `, + "expand": ` + + + + + + + `, + "folders": ` + `, + "panel-bottom": ` + `, + "play": ``, + "wifi-pen": ` + + + `, + "pencil-line": ` + + `, + "file-user": ` + + + `, + "hash": ` + + + `, + "rail-symbol": ` + + `, + "square-arrow-down": ` + + `, + "copyleft": ` + `, + "wallet": ` + `, + "badge-plus": ` + + `, + "dice-6": ` + + + + + + `, + "file-down": ` + + + `, + "hotel": ` + + + + + + + + + `, + "mail-open": ` + `, + "ticket-minus": ` + `, + "barcode": ` + + + + `, + "columns-2": ` + `, + "image": ` + + `, + "panda": ` + + + + + `, + "parking-meter": ` + + + + `, + "square-chart-gantt": ` + + + `, + "align-end-horizontal": ` + + `, + "calendar-arrow-up": ` + + + + + `, + "bookmark-x": ` + + `, + "chevrons-right-left": ` + `, + "cooking-pot": ` + + + `, + "contrast": ` + `, + "shield-off": ` + + `, + "subscript": ` + + `, + "arrow-down-to-dot": ` + + `, + "clipboard-type": ` + + + + `, + "git-branch": ` + + + `, + "image-plus": ` + + + + `, + "list-end": ` + + + + `, + "spline": ` + + `, + "gamepad-2": ` + + + + `, + "image-up": ` + + + `, + "message-circle-warning": ` + + `, + "route-off": ` + + + + + + `, + "scale": ` + + + + `, + "send-horizontal": ` + `, + "volleyball": ` + + + + + `, + "arrow-right-left": ` + + + `, + "bug": ` + + + + + + + + + + `, + "cloud-alert": ` + + `, + "combine": ` + + + + + `, + "dam": ` + + + + + + `, + "euro": ` + + `, + "file-warning": ` + + `, + "fold-vertical": ` + + + + + + + `, + "bell-plus": ` + + + `, + "book-text": ` + + `, + "copy-slash": ` + + `, + "folder-lock": ` + + `, + "laptop-minimal-check": ` + + `, + "globe-lock": ` + + + `, + "move-left": ` + `, + "message-circle-code": ` + + `, + "church": ` + + + + `, + "circle-fading-plus": ` + + + + + + `, + "hdmi-port": ` + `, + "folder-plus": ` + + `, + "monitor-down": ` + + + + `, + "rows-2": ` + `, + "satellite-dish": ` + + + `, + "square-m": ` + `, + "beaker": ` + + `, + "container": ` + + + + `, + "map-pin-check": ` + + `, + "arrow-up-right": ` + `, + "clock-6": ` + `, + "search-check": ` + + `, + "sparkles": ` + + + + `, + "touchpad-off": ` + + + + + `, + "unfold-horizontal": ` + + + + + + + `, + "wifi": ` + + + `, + "turtle": ` + + + `, + "album": ` + `, + "arrow-up-0-1": ` + + + + `, + "chevron-last": ` + `, + "indent-increase": ` + + + `, + "list-tree": ` + + + + `, + "align-horizontal-distribute-center": ` + + + + + `, + "align-horizontal-justify-center": ` + + `, + "bell": ` + `, + "heart-pulse": ` + `, + "plug-2": ` + + + + `, + "search": ` + `, + "badge-russian-ruble": ` + + `, + "folder-git-2": ` + + + `, + "hand-metal": ` + + + `, + "headset": ` + `, + "loader-pinwheel": ` + + + `, + "scissors-line-dashed": ` + + + + + + `, + "server-off": ` + + + + + `, + "annoyed": ` + + + `, + "book-key": ` + + + + `, + "chart-scatter": ` + + + + + `, + "laugh": ` + + + `, + "panels-left-bottom": ` + + `, + "receipt-cent": ` + + `, + "arrow-down-to-line": ` + + `, + "bone": ``, + "panels-right-bottom": ` + + `, + "signal-zero": ``, + "skull": ` + + + `, + "stretch-horizontal": ` + `, + "vegan": ` + + `, + "arrow-down-0-1": ` + + + + `, + "chef-hat": ` + `, + "mails": ` + + `, + "message-square-text": ` + + `, + "wind-arrow-down": ` + + + `, + "chevrons-down-up": ` + `, + "git-pull-request-create-arrow": ` + + + + + `, + "orbit": ` + + + + `, + "rss": ` + + `, + "share-2": ` + + + + `, + "smile-plus": ` + + + + + `, + "tent-tree": ` + + + + + + `, + "text": ` + + `, + "file-minus": ` + + `, + "files": ` + + `, + "gallery-vertical": ` + + `, + "panel-top-close": ` + + `, + "move-3d": ` + + + `, + "test-tube": ` + + `, + "undo-dot": ` + + `, + "workflow": ` + + `, + "keyboard-off": ` + + + + + + + + + `, +} diff --git a/server/web/templui/components/icon/icon_defs.go b/server/web/templui/components/icon/icon_defs.go new file mode 100644 index 0000000..098f952 --- /dev/null +++ b/server/web/templui/components/icon/icon_defs.go @@ -0,0 +1,1595 @@ +// templui component icon - version: main installed by templui v0.71.0 +package icon +// This file is auto generated +// Using Lucide icons version 0.507.0 +var ALargeSmall = Icon("a-large-small") +var Accessibility = Icon("accessibility") +var Antenna = Icon("antenna") +var Activity = Icon("activity") +var AirVent = Icon("air-vent") +var AlarmClockCheck = Icon("alarm-clock-check") +var AlarmClockMinus = Icon("alarm-clock-minus") +var AlarmClockOff = Icon("alarm-clock-off") +var Airplay = Icon("airplay") +var AtSign = Icon("at-sign") +var AlarmClockPlus = Icon("alarm-clock-plus") +var AlarmClock = Icon("alarm-clock") +var AlarmSmoke = Icon("alarm-smoke") +var Album = Icon("album") +var AlignCenterHorizontal = Icon("align-center-horizontal") +var AlignCenterVertical = Icon("align-center-vertical") +var AlignCenter = Icon("align-center") +var AlignEndHorizontal = Icon("align-end-horizontal") +var AlignEndVertical = Icon("align-end-vertical") +var AlignHorizontalDistributeCenter = Icon("align-horizontal-distribute-center") +var AlignHorizontalDistributeEnd = Icon("align-horizontal-distribute-end") +var AlignHorizontalDistributeStart = Icon("align-horizontal-distribute-start") +var AlignHorizontalJustifyCenter = Icon("align-horizontal-justify-center") +var AlignHorizontalJustifyEnd = Icon("align-horizontal-justify-end") +var AlignHorizontalJustifyStart = Icon("align-horizontal-justify-start") +var AlignHorizontalSpaceAround = Icon("align-horizontal-space-around") +var AlignHorizontalSpaceBetween = Icon("align-horizontal-space-between") +var AlignJustify = Icon("align-justify") +var AlignLeft = Icon("align-left") +var AlignRight = Icon("align-right") +var AlignStartVertical = Icon("align-start-vertical") +var AlignStartHorizontal = Icon("align-start-horizontal") +var AlignVerticalDistributeCenter = Icon("align-vertical-distribute-center") +var AlignVerticalDistributeEnd = Icon("align-vertical-distribute-end") +var AlignVerticalDistributeStart = Icon("align-vertical-distribute-start") +var AlignVerticalJustifyCenter = Icon("align-vertical-justify-center") +var AlignVerticalJustifyEnd = Icon("align-vertical-justify-end") +var AlignVerticalJustifyStart = Icon("align-vertical-justify-start") +var AlignVerticalSpaceAround = Icon("align-vertical-space-around") +var AlignVerticalSpaceBetween = Icon("align-vertical-space-between") +var Ambulance = Icon("ambulance") +var Ampersand = Icon("ampersand") +var Ampersands = Icon("ampersands") +var Amphora = Icon("amphora") +var Anchor = Icon("anchor") +var Angry = Icon("angry") +var Annoyed = Icon("annoyed") +var Anvil = Icon("anvil") +var Aperture = Icon("aperture") +var AppWindowMac = Icon("app-window-mac") +var AppWindow = Icon("app-window") +var Apple = Icon("apple") +var ArchiveRestore = Icon("archive-restore") +var ArchiveX = Icon("archive-x") +var Archive = Icon("archive") +var Armchair = Icon("armchair") +var ArrowBigDownDash = Icon("arrow-big-down-dash") +var ArrowBigDown = Icon("arrow-big-down") +var ArrowBigLeftDash = Icon("arrow-big-left-dash") +var ArrowBigLeft = Icon("arrow-big-left") +var ArrowBigRightDash = Icon("arrow-big-right-dash") +var ArrowBigRight = Icon("arrow-big-right") +var ArrowBigUpDash = Icon("arrow-big-up-dash") +var ArrowBigUp = Icon("arrow-big-up") +var ArrowDown01 = Icon("arrow-down-0-1") +var ArrowDown10 = Icon("arrow-down-1-0") +var ArrowDownAZ = Icon("arrow-down-a-z") +var ArrowDownFromLine = Icon("arrow-down-from-line") +var ArrowDownLeft = Icon("arrow-down-left") +var ArrowDownNarrowWide = Icon("arrow-down-narrow-wide") +var ArrowDownRight = Icon("arrow-down-right") +var ArrowDownToDot = Icon("arrow-down-to-dot") +var ArrowDownToLine = Icon("arrow-down-to-line") +var ArrowDownUp = Icon("arrow-down-up") +var ArrowDownWideNarrow = Icon("arrow-down-wide-narrow") +var ArrowDownZA = Icon("arrow-down-z-a") +var ArrowDown = Icon("arrow-down") +var ArrowLeftFromLine = Icon("arrow-left-from-line") +var ArrowLeftRight = Icon("arrow-left-right") +var ArrowLeftToLine = Icon("arrow-left-to-line") +var ArrowLeft = Icon("arrow-left") +var ArrowRightFromLine = Icon("arrow-right-from-line") +var ArrowRightLeft = Icon("arrow-right-left") +var ArrowRightToLine = Icon("arrow-right-to-line") +var ArrowRight = Icon("arrow-right") +var ArrowUp01 = Icon("arrow-up-0-1") +var ArrowUp10 = Icon("arrow-up-1-0") +var ArrowUpAZ = Icon("arrow-up-a-z") +var ArrowUpDown = Icon("arrow-up-down") +var ArrowUpFromDot = Icon("arrow-up-from-dot") +var ArrowUpFromLine = Icon("arrow-up-from-line") +var ArrowUpLeft = Icon("arrow-up-left") +var ArrowUpNarrowWide = Icon("arrow-up-narrow-wide") +var ArrowUpRight = Icon("arrow-up-right") +var ArrowUpToLine = Icon("arrow-up-to-line") +var ArrowUpWideNarrow = Icon("arrow-up-wide-narrow") +var ArrowUpZA = Icon("arrow-up-z-a") +var ArrowUp = Icon("arrow-up") +var ArrowsUpFromLine = Icon("arrows-up-from-line") +var Asterisk = Icon("asterisk") +var BellDot = Icon("bell-dot") +var Atom = Icon("atom") +var AudioLines = Icon("audio-lines") +var AudioWaveform = Icon("audio-waveform") +var Award = Icon("award") +var Axe = Icon("axe") +var Axis3d = Icon("axis-3d") +var Baby = Icon("baby") +var Backpack = Icon("backpack") +var BadgeAlert = Icon("badge-alert") +var BadgeCent = Icon("badge-cent") +var BadgeCheck = Icon("badge-check") +var BadgeDollarSign = Icon("badge-dollar-sign") +var BadgeEuro = Icon("badge-euro") +var BadgeHelp = Icon("badge-help") +var BadgeIndianRupee = Icon("badge-indian-rupee") +var BadgeInfo = Icon("badge-info") +var BadgeJapaneseYen = Icon("badge-japanese-yen") +var BadgeMinus = Icon("badge-minus") +var BadgePercent = Icon("badge-percent") +var BadgePlus = Icon("badge-plus") +var BadgePoundSterling = Icon("badge-pound-sterling") +var BadgeRussianRuble = Icon("badge-russian-ruble") +var BadgeSwissFranc = Icon("badge-swiss-franc") +var BadgeX = Icon("badge-x") +var BookmarkMinus = Icon("bookmark-minus") +var AArrowDown = Icon("a-arrow-down") +var Bone = Icon("bone") +var Badge = Icon("badge") +var BookA = Icon("book-a") +var BookAudio = Icon("book-audio") +var BookCheck = Icon("book-check") +var BookCopy = Icon("book-copy") +var BookDashed = Icon("book-dashed") +var BookDown = Icon("book-down") +var BookHeadphones = Icon("book-headphones") +var BookHeart = Icon("book-heart") +var BookImage = Icon("book-image") +var BookKey = Icon("book-key") +var BookLock = Icon("book-lock") +var BookMarked = Icon("book-marked") +var BookMinus = Icon("book-minus") +var BookOpenCheck = Icon("book-open-check") +var BookOpenText = Icon("book-open-text") +var BookOpen = Icon("book-open") +var AArrowUp = Icon("a-arrow-up") +var Bomb = Icon("bomb") +var BellElectric = Icon("bell-electric") +var BellMinus = Icon("bell-minus") +var BellOff = Icon("bell-off") +var BugPlay = Icon("bug-play") +var BrainCog = Icon("brain-cog") +var Brain = Icon("brain") +var BrickWallFire = Icon("brick-wall-fire") +var BrickWall = Icon("brick-wall") +var BriefcaseBusiness = Icon("briefcase-business") +var BaggageClaim = Icon("baggage-claim") +var Ban = Icon("ban") +var Banana = Icon("banana") +var Bandage = Icon("bandage") +var BanknoteArrowDown = Icon("banknote-arrow-down") +var BanknoteArrowUp = Icon("banknote-arrow-up") +var BanknoteX = Icon("banknote-x") +var Banknote = Icon("banknote") +var Barcode = Icon("barcode") +var Baseline = Icon("baseline") +var BookUp = Icon("book-up") +var BriefcaseConveyorBelt = Icon("briefcase-conveyor-belt") +var BookUser = Icon("book-user") +var BookPlus = Icon("book-plus") +var BookX = Icon("book-x") +var Book = Icon("book") +var BookmarkCheck = Icon("bookmark-check") +var BriefcaseMedical = Icon("briefcase-medical") +var BellPlus = Icon("bell-plus") +var CalendarSearch = Icon("calendar-search") +var Bug = Icon("bug") +var Building2 = Icon("building-2") +var Building = Icon("building") +var BusFront = Icon("bus-front") +var Bus = Icon("bus") +var CableCar = Icon("cable-car") +var Cable = Icon("cable") +var CakeSlice = Icon("cake-slice") +var Cake = Icon("cake") +var Calculator = Icon("calculator") +var Calendar1 = Icon("calendar-1") +var CalendarArrowDown = Icon("calendar-arrow-down") +var CalendarArrowUp = Icon("calendar-arrow-up") +var CalendarCheck2 = Icon("calendar-check-2") +var CalendarCheck = Icon("calendar-check") +var Bath = Icon("bath") +var BookText = Icon("book-text") +var BookType = Icon("book-type") +var BookUp2 = Icon("book-up-2") +var BatteryCharging = Icon("battery-charging") +var BatteryFull = Icon("battery-full") +var BatteryLow = Icon("battery-low") +var BatteryMedium = Icon("battery-medium") +var BrushCleaning = Icon("brush-cleaning") +var BatteryPlus = Icon("battery-plus") +var Briefcase = Icon("briefcase") +var BringToFront = Icon("bring-to-front") +var Box = Icon("box") +var Brush = Icon("brush") +var Bubbles = Icon("bubbles") +var BugOff = Icon("bug-off") +var Bird = Icon("bird") +var Bell = Icon("bell") +var BetweenHorizontalEnd = Icon("between-horizontal-end") +var BetweenHorizontalStart = Icon("between-horizontal-start") +var BetweenVerticalEnd = Icon("between-vertical-end") +var BetweenVerticalStart = Icon("between-vertical-start") +var BotOff = Icon("bot-off") +var BookmarkPlus = Icon("bookmark-plus") +var BookmarkX = Icon("bookmark-x") +var Bookmark = Icon("bookmark") +var BoomBox = Icon("boom-box") +var BotMessageSquare = Icon("bot-message-square") +var BluetoothConnected = Icon("bluetooth-connected") +var Bitcoin = Icon("bitcoin") +var Blend = Icon("blend") +var Blinds = Icon("blinds") +var Blocks = Icon("blocks") +var Bluetooth = Icon("bluetooth") +var BluetoothOff = Icon("bluetooth-off") +var BluetoothSearching = Icon("bluetooth-searching") +var BowArrow = Icon("bow-arrow") +var Binary = Icon("binary") +var Bike = Icon("bike") +var Braces = Icon("braces") +var Boxes = Icon("boxes") +var BedDouble = Icon("bed-double") +var Battery = Icon("battery") +var Beaker = Icon("beaker") +var BeanOff = Icon("bean-off") +var Bean = Icon("bean") +var Beef = Icon("beef") +var BedSingle = Icon("bed-single") +var Bed = Icon("bed") +var BicepsFlexed = Icon("biceps-flexed") +var CalendarMinus2 = Icon("calendar-minus-2") +var CalendarCog = Icon("calendar-cog") +var CalendarDays = Icon("calendar-days") +var CalendarFold = Icon("calendar-fold") +var CalendarHeart = Icon("calendar-heart") +var BeerOff = Icon("beer-off") +var Bold = Icon("bold") +var Binoculars = Icon("binoculars") +var Brackets = Icon("brackets") +var Beer = Icon("beer") +var CalendarPlus2 = Icon("calendar-plus-2") +var CalendarMinus = Icon("calendar-minus") +var CalendarOff = Icon("calendar-off") +var CalendarPlus = Icon("calendar-plus") +var Biohazard = Icon("biohazard") +var Bolt = Icon("bolt") +var CalendarRange = Icon("calendar-range") +var CalendarClock = Icon("calendar-clock") +var BrainCircuit = Icon("brain-circuit") +var Bot = Icon("bot") +var BellRing = Icon("bell-ring") +var BatteryWarning = Icon("battery-warning") +var CalendarSync = Icon("calendar-sync") +var CalendarX2 = Icon("calendar-x-2") +var Cannabis = Icon("cannabis") +var CalendarX = Icon("calendar-x") +var Carrot = Icon("carrot") +var CaptionsOff = Icon("captions-off") +var Captions = Icon("captions") +var CarFront = Icon("car-front") +var CarTaxiFront = Icon("car-taxi-front") +var Car = Icon("car") +var Caravan = Icon("caravan") +var Cat = Icon("cat") +var CaseLower = Icon("case-lower") +var CaseSensitive = Icon("case-sensitive") +var CaseUpper = Icon("case-upper") +var CassetteTape = Icon("cassette-tape") +var Cast = Icon("cast") +var Castle = Icon("castle") +var ChartBar = Icon("chart-bar") +var Cctv = Icon("cctv") +var ChartArea = Icon("chart-area") +var ChartBarBig = Icon("chart-bar-big") +var ChartBarDecreasing = Icon("chart-bar-decreasing") +var ChartBarIncreasing = Icon("chart-bar-increasing") +var ChartBarStacked = Icon("chart-bar-stacked") +var ChartColumnIncreasing = Icon("chart-column-increasing") +var ChartColumnDecreasing = Icon("chart-column-decreasing") +var ChartNoAxesColumnDecreasing = Icon("chart-no-axes-column-decreasing") +var ChartColumnStacked = Icon("chart-column-stacked") +var ChartColumn = Icon("chart-column") +var ChartGantt = Icon("chart-gantt") +var ChartLine = Icon("chart-line") +var ChartNetwork = Icon("chart-network") +var ChartScatter = Icon("chart-scatter") +var ChartNoAxesColumnIncreasing = Icon("chart-no-axes-column-increasing") +var ChartNoAxesColumn = Icon("chart-no-axes-column") +var ChartNoAxesCombined = Icon("chart-no-axes-combined") +var ChartNoAxesGantt = Icon("chart-no-axes-gantt") +var ChartPie = Icon("chart-pie") +var CandyCane = Icon("candy-cane") +var Camera = Icon("camera") +var ChartColumnBig = Icon("chart-column-big") +var ChartCandlestick = Icon("chart-candlestick") +var CandyOff = Icon("candy-off") +var ChevronDown = Icon("chevron-down") +var Cherry = Icon("cherry") +var CameraOff = Icon("camera-off") +var CheckCheck = Icon("check-check") +var ChartSpline = Icon("chart-spline") +var Check = Icon("check") +var ChevronLast = Icon("chevron-last") +var Candy = Icon("candy") +var Calendar = Icon("calendar") +var ChevronUp = Icon("chevron-up") +var ChevronLeft = Icon("chevron-left") +var ChevronRight = Icon("chevron-right") +var ChevronsDown = Icon("chevrons-down") +var ChevronsDownUp = Icon("chevrons-down-up") +var CircleArrowOutDownLeft = Icon("circle-arrow-out-down-left") +var ChevronsLeft = Icon("chevrons-left") +var ChevronsRightLeft = Icon("chevrons-right-left") +var ChevronsRight = Icon("chevrons-right") +var ChevronsUpDown = Icon("chevrons-up-down") +var ChevronsUp = Icon("chevrons-up") +var Chrome = Icon("chrome") +var Church = Icon("church") +var CigaretteOff = Icon("cigarette-off") +var Cigarette = Icon("cigarette") +var CircleAlert = Icon("circle-alert") +var CircleArrowDown = Icon("circle-arrow-down") +var CircleArrowLeft = Icon("circle-arrow-left") +var ChevronsLeftRightEllipsis = Icon("chevrons-left-right-ellipsis") +var CircleSlash = Icon("circle-slash") +var CircleArrowOutDownRight = Icon("circle-arrow-out-down-right") +var CircleArrowOutUpLeft = Icon("circle-arrow-out-up-left") +var CircleArrowOutUpRight = Icon("circle-arrow-out-up-right") +var CircleArrowRight = Icon("circle-arrow-right") +var CircleArrowUp = Icon("circle-arrow-up") +var CircleCheckBig = Icon("circle-check-big") +var CircleCheck = Icon("circle-check") +var CircleChevronDown = Icon("circle-chevron-down") +var CircleChevronLeft = Icon("circle-chevron-left") +var CircleChevronRight = Icon("circle-chevron-right") +var CircleChevronUp = Icon("circle-chevron-up") +var CircleDashed = Icon("circle-dashed") +var CircleDivide = Icon("circle-divide") +var CircleDollarSign = Icon("circle-dollar-sign") +var CircleDotDashed = Icon("circle-dot-dashed") +var CircleDot = Icon("circle-dot") +var CircleEqual = Icon("circle-equal") +var CircleEllipsis = Icon("circle-ellipsis") +var CircleFadingArrowUp = Icon("circle-fading-arrow-up") +var CircleFadingPlus = Icon("circle-fading-plus") +var CircleGauge = Icon("circle-gauge") +var CircleHelp = Icon("circle-help") +var CircleMinus = Icon("circle-minus") +var CircleOff = Icon("circle-off") +var ChevronsLeftRight = Icon("chevrons-left-right") +var CirclePlay = Icon("circle-play") +var CircleParking = Icon("circle-parking") +var CirclePause = Icon("circle-pause") +var CirclePercent = Icon("circle-percent") +var Clock7 = Icon("clock-7") +var CircleSmall = Icon("circle-small") +var CircleStop = Icon("circle-stop") +var CircleUserRound = Icon("circle-user-round") +var CircleUser = Icon("circle-user") +var CircleX = Icon("circle-x") +var Circle = Icon("circle") +var CircuitBoard = Icon("circuit-board") +var Citrus = Icon("citrus") +var Clapperboard = Icon("clapperboard") +var ClipboardCheck = Icon("clipboard-check") +var ClipboardCopy = Icon("clipboard-copy") +var ClipboardList = Icon("clipboard-list") +var ClipboardMinus = Icon("clipboard-minus") +var CircleSlash2 = Icon("circle-slash-2") +var Clock10 = Icon("clock-10") +var Clock11 = Icon("clock-11") +var Clock12 = Icon("clock-12") +var Clock2 = Icon("clock-2") +var Clock3 = Icon("clock-3") +var Clock4 = Icon("clock-4") +var Clock5 = Icon("clock-5") +var Clock6 = Icon("clock-6") +var ClockPlus = Icon("clock-plus") +var Clock8 = Icon("clock-8") +var Clock9 = Icon("clock-9") +var ClockAlert = Icon("clock-alert") +var ClockArrowDown = Icon("clock-arrow-down") +var ClockArrowUp = Icon("clock-arrow-up") +var ClockFading = Icon("clock-fading") +var CloudDownload = Icon("cloud-download") +var Clock = Icon("clock") +var CloudAlert = Icon("cloud-alert") +var CloudCog = Icon("cloud-cog") +var Cloudy = Icon("cloudy") +var CircleParkingOff = Icon("circle-parking-off") +var CloudFog = Icon("cloud-fog") +var CloudDrizzle = Icon("cloud-drizzle") +var CirclePlus = Icon("circle-plus") +var Coffee = Icon("coffee") +var Clover = Icon("clover") +var Club = Icon("club") +var CodeXml = Icon("code-xml") +var Code = Icon("code") +var Codepen = Icon("codepen") +var Codesandbox = Icon("codesandbox") +var ClipboardPlus = Icon("clipboard-plus") +var CloudMoonRain = Icon("cloud-moon-rain") +var CloudMoon = Icon("cloud-moon") +var CloudOff = Icon("cloud-off") +var CloudRainWind = Icon("cloud-rain-wind") +var CloudRain = Icon("cloud-rain") +var CloudSnow = Icon("cloud-snow") +var CloudSunRain = Icon("cloud-sun-rain") +var CloudSun = Icon("cloud-sun") +var CloudUpload = Icon("cloud-upload") +var Cloud = Icon("cloud") +var ClipboardPenLine = Icon("clipboard-pen-line") +var ClipboardPen = Icon("clipboard-pen") +var CloudHail = Icon("cloud-hail") +var Cookie = Icon("cookie") +var ClipboardPaste = Icon("clipboard-paste") +var ClipboardX = Icon("clipboard-x") +var ClipboardType = Icon("clipboard-type") +var Component = Icon("component") +var Coins = Icon("coins") +var Columns2 = Icon("columns-2") +var Columns3Cog = Icon("columns-3-cog") +var Columns3 = Icon("columns-3") +var Columns4 = Icon("columns-4") +var Combine = Icon("combine") +var Command = Icon("command") +var Compass = Icon("compass") +var Clipboard = Icon("clipboard") +var CupSoda = Icon("cup-soda") +var CookingPot = Icon("cooking-pot") +var CopyCheck = Icon("copy-check") +var CopyMinus = Icon("copy-minus") +var CopyPlus = Icon("copy-plus") +var CopySlash = Icon("copy-slash") +var CopyX = Icon("copy-x") +var Copy = Icon("copy") +var Copyleft = Icon("copyleft") +var Copyright = Icon("copyright") +var CornerDownLeft = Icon("corner-down-left") +var CornerDownRight = Icon("corner-down-right") +var CornerLeftDown = Icon("corner-left-down") +var CornerLeftUp = Icon("corner-left-up") +var CornerRightDown = Icon("corner-right-down") +var CornerRightUp = Icon("corner-right-up") +var CornerUpLeft = Icon("corner-up-left") +var CornerUpRight = Icon("corner-up-right") +var Cpu = Icon("cpu") +var CreativeCommons = Icon("creative-commons") +var CreditCard = Icon("credit-card") +var Croissant = Icon("croissant") +var Crop = Icon("crop") +var Cross = Icon("cross") +var Cog = Icon("cog") +var Computer = Icon("computer") +var ConciergeBell = Icon("concierge-bell") +var Cone = Icon("cone") +var Construction = Icon("construction") +var ContactRound = Icon("contact-round") +var Contact = Icon("contact") +var Container = Icon("container") +var Contrast = Icon("contrast") +var Crown = Icon("crown") +var Cuboid = Icon("cuboid") +var Egg = Icon("egg") +var Currency = Icon("currency") +var Cylinder = Icon("cylinder") +var Dam = Icon("dam") +var DatabaseBackup = Icon("database-backup") +var DatabaseZap = Icon("database-zap") +var Database = Icon("database") +var DecimalsArrowLeft = Icon("decimals-arrow-left") +var DecimalsArrowRight = Icon("decimals-arrow-right") +var Delete = Icon("delete") +var Dessert = Icon("dessert") +var Diameter = Icon("diameter") +var DiamondMinus = Icon("diamond-minus") +var DiamondPercent = Icon("diamond-percent") +var DiamondPlus = Icon("diamond-plus") +var Diamond = Icon("diamond") +var Dice1 = Icon("dice-1") +var Dice2 = Icon("dice-2") +var Dice3 = Icon("dice-3") +var Dice4 = Icon("dice-4") +var Dice5 = Icon("dice-5") +var Dice6 = Icon("dice-6") +var Dices = Icon("dices") +var Diff = Icon("diff") +var Disc2 = Icon("disc-2") +var Disc3 = Icon("disc-3") +var DiscAlbum = Icon("disc-album") +var Disc = Icon("disc") +var Divide = Icon("divide") +var DnaOff = Icon("dna-off") +var ChefHat = Icon("chef-hat") +var Drill = Icon("drill") +var Dock = Icon("dock") +var Dog = Icon("dog") +var DollarSign = Icon("dollar-sign") +var Donut = Icon("donut") +var DoorClosedLocked = Icon("door-closed-locked") +var DoorClosed = Icon("door-closed") +var Dna = Icon("dna") +var DoorOpen = Icon("door-open") +var Dot = Icon("dot") +var Download = Icon("download") +var DraftingCompass = Icon("drafting-compass") +var Drama = Icon("drama") +var Dribbble = Icon("dribbble") +var DropletOff = Icon("droplet-off") +var EarOff = Icon("ear-off") +var Ear = Icon("ear") +var EarthLock = Icon("earth-lock") +var Earth = Icon("earth") +var Eclipse = Icon("eclipse") +var EggFried = Icon("egg-fried") +var EggOff = Icon("egg-off") +var Drum = Icon("drum") +var Droplets = Icon("droplets") +var Drumstick = Icon("drumstick") +var Crosshair = Icon("crosshair") +var FileOutput = Icon("file-output") +var FileBox = Icon("file-box") +var FileBadge = Icon("file-badge") +var FileChartColumnIncreasing = Icon("file-chart-column-increasing") +var FileChartColumn = Icon("file-chart-column") +var FileChartLine = Icon("file-chart-line") +var FileChartPie = Icon("file-chart-pie") +var FileCheck2 = Icon("file-check-2") +var FileCheck = Icon("file-check") +var FileClock = Icon("file-clock") +var FileCode2 = Icon("file-code-2") +var FileCode = Icon("file-code") +var FileCog = Icon("file-cog") +var FileDiff = Icon("file-diff") +var FileDigit = Icon("file-digit") +var FileDown = Icon("file-down") +var FileHeart = Icon("file-heart") +var FileImage = Icon("file-image") +var FileInput = Icon("file-input") +var FileJson2 = Icon("file-json-2") +var FileJson = Icon("file-json") +var FileKey2 = Icon("file-key-2") +var FileKey = Icon("file-key") +var FileLock2 = Icon("file-lock-2") +var FileLock = Icon("file-lock") +var FileMinus2 = Icon("file-minus-2") +var FileMinus = Icon("file-minus") +var FileMusic = Icon("file-music") +var Facebook = Icon("facebook") +var Ellipsis = Icon("ellipsis") +var EqualApproximately = Icon("equal-approximately") +var EqualNot = Icon("equal-not") +var Equal = Icon("equal") +var Eraser = Icon("eraser") +var EthernetPort = Icon("ethernet-port") +var Euro = Icon("euro") +var Expand = Icon("expand") +var ExternalLink = Icon("external-link") +var EyeClosed = Icon("eye-closed") +var EyeOff = Icon("eye-off") +var Eye = Icon("eye") +var FerrisWheel = Icon("ferris-wheel") +var Factory = Icon("factory") +var Fan = Icon("fan") +var FastForward = Icon("fast-forward") +var Feather = Icon("feather") +var Fence = Icon("fence") +var Dumbbell = Icon("dumbbell") +var FolderDown = Icon("folder-down") +var FilePenLine = Icon("file-pen-line") +var FilePen = Icon("file-pen") +var FilePlus2 = Icon("file-plus-2") +var FilePlus = Icon("file-plus") +var FileQuestion = Icon("file-question") +var FileScan = Icon("file-scan") +var FileSearch2 = Icon("file-search-2") +var FileSearch = Icon("file-search") +var FileSliders = Icon("file-sliders") +var FileSpreadsheet = Icon("file-spreadsheet") +var FileStack = Icon("file-stack") +var FileSymlink = Icon("file-symlink") +var FileTerminal = Icon("file-terminal") +var Droplet = Icon("droplet") +var Flag = Icon("flag") +var FileType2 = Icon("file-type-2") +var FileType = Icon("file-type") +var FileUp = Icon("file-up") +var FileUser = Icon("file-user") +var FileVideo2 = Icon("file-video-2") +var FileVideo = Icon("file-video") +var FileVolume2 = Icon("file-volume-2") +var FileVolume = Icon("file-volume") +var FileText = Icon("file-text") +var FlameKindling = Icon("flame-kindling") +var Flame = Icon("flame") +var FlashlightOff = Icon("flashlight-off") +var FileWarning = Icon("file-warning") +var Flashlight = Icon("flashlight") +var FlaskConicalOff = Icon("flask-conical-off") +var FlaskConical = Icon("flask-conical") +var FlaskRound = Icon("flask-round") +var FlipHorizontal2 = Icon("flip-horizontal-2") +var FlipHorizontal = Icon("flip-horizontal") +var FlipVertical2 = Icon("flip-vertical-2") +var FlipVertical = Icon("flip-vertical") +var Flower2 = Icon("flower-2") +var Flower = Icon("flower") +var Focus = Icon("focus") +var FoldHorizontal = Icon("fold-horizontal") +var FoldVertical = Icon("fold-vertical") +var FolderArchive = Icon("folder-archive") +var FolderCheck = Icon("folder-check") +var FolderClock = Icon("folder-clock") +var EllipsisVertical = Icon("ellipsis-vertical") +var Figma = Icon("figma") +var FileArchive = Icon("file-archive") +var FileAudio2 = Icon("file-audio-2") +var FileAudio = Icon("file-audio") +var FileAxis3d = Icon("file-axis-3d") +var FileBadge2 = Icon("file-badge-2") +var FileX2 = Icon("file-x-2") +var FishOff = Icon("fish-off") +var FishSymbol = Icon("fish-symbol") +var Fish = Icon("fish") +var FlagOff = Icon("flag-off") +var FlagTriangleLeft = Icon("flag-triangle-left") +var FlagTriangleRight = Icon("flag-triangle-right") +var Files = Icon("files") +var FileX = Icon("file-x") +var File = Icon("file") +var Film = Icon("film") +var Fingerprint = Icon("fingerprint") +var FolderCog = Icon("folder-cog") +var FolderCode = Icon("folder-code") +var Grid3x3 = Icon("grid-3x3") +var FolderGit2 = Icon("folder-git-2") +var FolderGit = Icon("folder-git") +var FolderHeart = Icon("folder-heart") +var FolderInput = Icon("folder-input") +var FolderKanban = Icon("folder-kanban") +var FolderKey = Icon("folder-key") +var FolderLock = Icon("folder-lock") +var FireExtinguisher = Icon("fire-extinguisher") +var FolderDot = Icon("folder-dot") +var History = Icon("history") +var GripHorizontal = Icon("grip-horizontal") +var GripVertical = Icon("grip-vertical") +var Grip = Icon("grip") +var Group = Icon("group") +var Guitar = Icon("guitar") +var FolderMinus = Icon("folder-minus") +var Ham = Icon("ham") +var Hamburger = Icon("hamburger") +var Hammer = Icon("hammer") +var HandCoins = Icon("hand-coins") +var HandHeart = Icon("hand-heart") +var HandHelping = Icon("hand-helping") +var HandMetal = Icon("hand-metal") +var FolderOpenDot = Icon("folder-open-dot") +var HandPlatter = Icon("hand-platter") +var FolderOpen = Icon("folder-open") +var Hand = Icon("hand") +var Handshake = Icon("handshake") +var HardDriveDownload = Icon("hard-drive-download") +var HardDriveUpload = Icon("hard-drive-upload") +var HardDrive = Icon("hard-drive") +var HardHat = Icon("hard-hat") +var Hash = Icon("hash") +var Haze = Icon("haze") +var HdmiPort = Icon("hdmi-port") +var FolderOutput = Icon("folder-output") +var Heading1 = Icon("heading-1") +var FolderPen = Icon("folder-pen") +var FolderPlus = Icon("folder-plus") +var FolderRoot = Icon("folder-root") +var FolderSearch2 = Icon("folder-search-2") +var FolderSearch = Icon("folder-search") +var Heading2 = Icon("heading-2") +var Heading3 = Icon("heading-3") +var Heading4 = Icon("heading-4") +var Heading5 = Icon("heading-5") +var Heading6 = Icon("heading-6") +var Heading = Icon("heading") +var HeadphoneOff = Icon("headphone-off") +var Headphones = Icon("headphones") +var Headset = Icon("headset") +var HeartCrack = Icon("heart-crack") +var HeartHandshake = Icon("heart-handshake") +var HeartMinus = Icon("heart-minus") +var HeartOff = Icon("heart-off") +var HeartPlus = Icon("heart-plus") +var HeartPulse = Icon("heart-pulse") +var Heart = Icon("heart") +var FolderClosed = Icon("folder-closed") +var CirclePower = Icon("circle-power") +var Hexagon = Icon("hexagon") +var Keyboard = Icon("keyboard") +var HopOff = Icon("hop-off") +var Hop = Icon("hop") +var Hospital = Icon("hospital") +var Hotel = Icon("hotel") +var FolderSymlink = Icon("folder-symlink") +var FolderSync = Icon("folder-sync") +var FolderTree = Icon("folder-tree") +var FolderUp = Icon("folder-up") +var FolderX = Icon("folder-x") +var Folder = Icon("folder") +var Folders = Icon("folders") +var Footprints = Icon("footprints") +var Forklift = Icon("forklift") +var Forward = Icon("forward") +var Frame = Icon("frame") +var Framer = Icon("framer") +var Frown = Icon("frown") +var Fuel = Icon("fuel") +var Fullscreen = Icon("fullscreen") +var FunnelPlus = Icon("funnel-plus") +var FunnelX = Icon("funnel-x") +var Funnel = Icon("funnel") +var GalleryHorizontalEnd = Icon("gallery-horizontal-end") +var GalleryHorizontal = Icon("gallery-horizontal") +var GalleryThumbnails = Icon("gallery-thumbnails") +var GalleryVerticalEnd = Icon("gallery-vertical-end") +var GalleryVertical = Icon("gallery-vertical") +var Gamepad2 = Icon("gamepad-2") +var Gamepad = Icon("gamepad") +var Gauge = Icon("gauge") +var Gavel = Icon("gavel") +var Gem = Icon("gem") +var Ghost = Icon("ghost") +var Gift = Icon("gift") +var GitBranchPlus = Icon("git-branch-plus") +var GitBranch = Icon("git-branch") +var GitCommitHorizontal = Icon("git-commit-horizontal") +var GitCommitVertical = Icon("git-commit-vertical") +var GitCompareArrows = Icon("git-compare-arrows") +var GitCompare = Icon("git-compare") +var GitFork = Icon("git-fork") +var GitGraph = Icon("git-graph") +var GitMerge = Icon("git-merge") +var GitPullRequestArrow = Icon("git-pull-request-arrow") +var GitPullRequestClosed = Icon("git-pull-request-closed") +var GitPullRequestCreateArrow = Icon("git-pull-request-create-arrow") +var GitPullRequestCreate = Icon("git-pull-request-create") +var GitPullRequestDraft = Icon("git-pull-request-draft") +var GitPullRequest = Icon("git-pull-request") +var Github = Icon("github") +var Gitlab = Icon("gitlab") +var GlassWater = Icon("glass-water") +var Glasses = Icon("glasses") +var GlobeLock = Icon("globe-lock") +var Globe = Icon("globe") +var Goal = Icon("goal") +var Grab = Icon("grab") +var GraduationCap = Icon("graduation-cap") +var Grape = Icon("grape") +var Grid2x2Check = Icon("grid-2x2-check") +var Grid2x2Plus = Icon("grid-2x2-plus") +var Grid2x2X = Icon("grid-2x2-x") +var Grid2x2 = Icon("grid-2x2") +var Inbox = Icon("inbox") +var HousePlug = Icon("house-plug") +var HousePlus = Icon("house-plus") +var HouseWifi = Icon("house-wifi") +var House = Icon("house") +var IceCreamBowl = Icon("ice-cream-bowl") +var IceCreamCone = Icon("ice-cream-cone") +var IdCard = Icon("id-card") +var Hourglass = Icon("hourglass") +var IndentDecrease = Icon("indent-decrease") +var IndentIncrease = Icon("indent-increase") +var IndianRupee = Icon("indian-rupee") +var Infinity = Icon("infinity") +var Info = Icon("info") +var InspectionPanel = Icon("inspection-panel") +var Instagram = Icon("instagram") +var Italic = Icon("italic") +var IterationCcw = Icon("iteration-ccw") +var IterationCw = Icon("iteration-cw") +var JapaneseYen = Icon("japanese-yen") +var Joystick = Icon("joystick") +var Kanban = Icon("kanban") +var KeyRound = Icon("key-round") +var KeySquare = Icon("key-square") +var Key = Icon("key") +var KeyboardMusic = Icon("keyboard-music") +var KeyboardOff = Icon("keyboard-off") +var ImageDown = Icon("image-down") +var ImageUpscale = Icon("image-upscale") +var Image = Icon("image") +var Images = Icon("images") +var Import = Icon("import") +var ImageOff = Icon("image-off") +var ImageMinus = Icon("image-minus") +var Mailbox = Icon("mailbox") +var LampCeiling = Icon("lamp-ceiling") +var ImageUp = Icon("image-up") +var ImagePlay = Icon("image-play") +var ImagePlus = Icon("image-plus") +var ListEnd = Icon("list-end") +var LampFloor = Icon("lamp-floor") +var LampWallDown = Icon("lamp-wall-down") +var LampWallUp = Icon("lamp-wall-up") +var Lamp = Icon("lamp") +var LandPlot = Icon("land-plot") +var Landmark = Icon("landmark") +var Languages = Icon("languages") +var LaptopMinimalCheck = Icon("laptop-minimal-check") +var LaptopMinimal = Icon("laptop-minimal") +var Laptop = Icon("laptop") +var LassoSelect = Icon("lasso-select") +var LampDesk = Icon("lamp-desk") +var ListFilterPlus = Icon("list-filter-plus") +var ListFilter = Icon("list-filter") +var ListMinus = Icon("list-minus") +var ListMusic = Icon("list-music") +var ListOrdered = Icon("list-ordered") +var ListPlus = Icon("list-plus") +var ListRestart = Icon("list-restart") +var ListStart = Icon("list-start") +var ListTodo = Icon("list-todo") +var ListTree = Icon("list-tree") +var ListVideo = Icon("list-video") +var ListX = Icon("list-x") +var List = Icon("list") +var LoaderCircle = Icon("loader-circle") +var LoaderPinwheel = Icon("loader-pinwheel") +var Loader = Icon("loader") +var LocateFixed = Icon("locate-fixed") +var LocateOff = Icon("locate-off") +var Locate = Icon("locate") +var Lasso = Icon("lasso") +var Laugh = Icon("laugh") +var Layers2 = Icon("layers-2") +var Layers = Icon("layers") +var LayoutDashboard = Icon("layout-dashboard") +var LayoutGrid = Icon("layout-grid") +var LayoutList = Icon("layout-list") +var LayoutPanelLeft = Icon("layout-panel-left") +var LayoutPanelTop = Icon("layout-panel-top") +var LayoutTemplate = Icon("layout-template") +var Leaf = Icon("leaf") +var LeafyGreen = Icon("leafy-green") +var Lectern = Icon("lectern") +var LetterText = Icon("letter-text") +var LibraryBig = Icon("library-big") +var LocationEdit = Icon("location-edit") +var LockKeyholeOpen = Icon("lock-keyhole-open") +var LockKeyhole = Icon("lock-keyhole") +var LockOpen = Icon("lock-open") +var Lock = Icon("lock") +var LogIn = Icon("log-in") +var LogOut = Icon("log-out") +var Logs = Icon("logs") +var Lollipop = Icon("lollipop") +var Luggage = Icon("luggage") +var Magnet = Icon("magnet") +var MailCheck = Icon("mail-check") +var MailMinus = Icon("mail-minus") +var MailOpen = Icon("mail-open") +var MailPlus = Icon("mail-plus") +var MailQuestion = Icon("mail-question") +var Library = Icon("library") +var LifeBuoy = Icon("life-buoy") +var Ligature = Icon("ligature") +var LightbulbOff = Icon("lightbulb-off") +var Lightbulb = Icon("lightbulb") +var Link2Off = Icon("link-2-off") +var Link2 = Icon("link-2") +var Link = Icon("link") +var Linkedin = Icon("linkedin") +var ListCheck = Icon("list-check") +var ListChecks = Icon("list-checks") +var ListCollapse = Icon("list-collapse") +var MailX = Icon("mail-x") +var MailWarning = Icon("mail-warning") +var Mail = Icon("mail") +var MoveLeft = Icon("move-left") +var MailSearch = Icon("mail-search") +var PanelBottomDashed = Icon("panel-bottom-dashed") +var MoveRight = Icon("move-right") +var MoveUpLeft = Icon("move-up-left") +var MoveUpRight = Icon("move-up-right") +var MoveUp = Icon("move-up") +var MoveVertical = Icon("move-vertical") +var Move = Icon("move") +var Music2 = Icon("music-2") +var Music3 = Icon("music-3") +var Music4 = Icon("music-4") +var Music = Icon("music") +var Navigation2Off = Icon("navigation-2-off") +var Mails = Icon("mails") +var MapPinCheckInside = Icon("map-pin-check-inside") +var MapPinCheck = Icon("map-pin-check") +var MapPinHouse = Icon("map-pin-house") +var MapPinMinusInside = Icon("map-pin-minus-inside") +var MapPinMinus = Icon("map-pin-minus") +var MapPinOff = Icon("map-pin-off") +var MapPinPlusInside = Icon("map-pin-plus-inside") +var MapPinPlus = Icon("map-pin-plus") +var MapPinXInside = Icon("map-pin-x-inside") +var MapPinX = Icon("map-pin-x") +var MapPin = Icon("map-pin") +var MapPinned = Icon("map-pinned") +var MapPlus = Icon("map-plus") +var Map = Icon("map") +var MarsStroke = Icon("mars-stroke") +var Mars = Icon("mars") +var Martini = Icon("martini") +var Maximize2 = Icon("maximize-2") +var Maximize = Icon("maximize") +var Medal = Icon("medal") +var MegaphoneOff = Icon("megaphone-off") +var Megaphone = Icon("megaphone") +var Meh = Icon("meh") +var MemoryStick = Icon("memory-stick") +var Menu = Icon("menu") +var Merge = Icon("merge") +var MessageCircleCode = Icon("message-circle-code") +var MessageCircleDashed = Icon("message-circle-dashed") +var MessageCircleHeart = Icon("message-circle-heart") +var MessageCircleMore = Icon("message-circle-more") +var MessageCircleOff = Icon("message-circle-off") +var MessageCirclePlus = Icon("message-circle-plus") +var MessageCircleQuestion = Icon("message-circle-question") +var MessageCircleReply = Icon("message-circle-reply") +var MessageCircleWarning = Icon("message-circle-warning") +var MessageCircleX = Icon("message-circle-x") +var MessageCircle = Icon("message-circle") +var MessageSquareCode = Icon("message-square-code") +var MessageSquareDashed = Icon("message-square-dashed") +var MessageSquareDiff = Icon("message-square-diff") +var MessageSquareDot = Icon("message-square-dot") +var MessageSquareHeart = Icon("message-square-heart") +var MessageSquareLock = Icon("message-square-lock") +var MessageSquareMore = Icon("message-square-more") +var MessageSquareOff = Icon("message-square-off") +var MessageSquarePlus = Icon("message-square-plus") +var MessageSquareQuote = Icon("message-square-quote") +var MessageSquareReply = Icon("message-square-reply") +var MessageSquareShare = Icon("message-square-share") +var MessageSquareText = Icon("message-square-text") +var MessageSquareWarning = Icon("message-square-warning") +var MessageSquareX = Icon("message-square-x") +var MessageSquare = Icon("message-square") +var MessagesSquare = Icon("messages-square") +var MicOff = Icon("mic-off") +var MicVocal = Icon("mic-vocal") +var Navigation2 = Icon("navigation-2") +var NavigationOff = Icon("navigation-off") +var Navigation = Icon("navigation") +var Network = Icon("network") +var Newspaper = Icon("newspaper") +var Nfc = Icon("nfc") +var NonBinary = Icon("non-binary") +var NotebookPen = Icon("notebook-pen") +var NotebookTabs = Icon("notebook-tabs") +var NotebookText = Icon("notebook-text") +var Notebook = Icon("notebook") +var NotepadTextDashed = Icon("notepad-text-dashed") +var NotepadText = Icon("notepad-text") +var NutOff = Icon("nut-off") +var Nut = Icon("nut") +var OctagonAlert = Icon("octagon-alert") +var OctagonMinus = Icon("octagon-minus") +var OctagonPause = Icon("octagon-pause") +var OctagonX = Icon("octagon-x") +var Octagon = Icon("octagon") +var Omega = Icon("omega") +var Option = Icon("option") +var Orbit = Icon("orbit") +var Origami = Icon("origami") +var Package2 = Icon("package-2") +var PackageCheck = Icon("package-check") +var PackageMinus = Icon("package-minus") +var PackageOpen = Icon("package-open") +var PackagePlus = Icon("package-plus") +var PackageSearch = Icon("package-search") +var PackageX = Icon("package-x") +var Package = Icon("package") +var PaintBucket = Icon("paint-bucket") +var PaintRoller = Icon("paint-roller") +var PaintbrushVertical = Icon("paintbrush-vertical") +var Paintbrush = Icon("paintbrush") +var Palette = Icon("palette") +var Panda = Icon("panda") +var PanelBottomClose = Icon("panel-bottom-close") +var Mic = Icon("mic") +var Pointer = Icon("pointer") +var PanelBottomOpen = Icon("panel-bottom-open") +var PanelBottom = Icon("panel-bottom") +var PanelLeftClose = Icon("panel-left-close") +var PanelLeftDashed = Icon("panel-left-dashed") +var PanelLeftOpen = Icon("panel-left-open") +var PanelLeft = Icon("panel-left") +var PanelRightClose = Icon("panel-right-close") +var PanelRightDashed = Icon("panel-right-dashed") +var PanelRightOpen = Icon("panel-right-open") +var PanelRight = Icon("panel-right") +var PanelTopClose = Icon("panel-top-close") +var PanelTopDashed = Icon("panel-top-dashed") +var PanelTopOpen = Icon("panel-top-open") +var PanelTop = Icon("panel-top") +var PanelsLeftBottom = Icon("panels-left-bottom") +var PanelsRightBottom = Icon("panels-right-bottom") +var PanelsTopLeft = Icon("panels-top-left") +var Paperclip = Icon("paperclip") +var Parentheses = Icon("parentheses") +var ParkingMeter = Icon("parking-meter") +var PartyPopper = Icon("party-popper") +var Pause = Icon("pause") +var PawPrint = Icon("paw-print") +var PcCase = Icon("pc-case") +var PenLine = Icon("pen-line") +var PenOff = Icon("pen-off") +var PenTool = Icon("pen-tool") +var Pen = Icon("pen") +var Highlighter = Icon("highlighter") +var PilcrowLeft = Icon("pilcrow-left") +var PencilOff = Icon("pencil-off") +var PencilRuler = Icon("pencil-ruler") +var Pencil = Icon("pencil") +var Pentagon = Icon("pentagon") +var Microchip = Icon("microchip") +var Microscope = Icon("microscope") +var Microwave = Icon("microwave") +var Milestone = Icon("milestone") +var MilkOff = Icon("milk-off") +var Milk = Icon("milk") +var Minimize2 = Icon("minimize-2") +var Minimize = Icon("minimize") +var Minus = Icon("minus") +var MonitorCheck = Icon("monitor-check") +var MonitorCog = Icon("monitor-cog") +var MonitorDot = Icon("monitor-dot") +var MonitorDown = Icon("monitor-down") +var MonitorOff = Icon("monitor-off") +var MonitorPause = Icon("monitor-pause") +var MonitorPlay = Icon("monitor-play") +var MonitorSmartphone = Icon("monitor-smartphone") +var MonitorSpeaker = Icon("monitor-speaker") +var Percent = Icon("percent") +var PersonStanding = Icon("person-standing") +var PhilippinePeso = Icon("philippine-peso") +var PhoneCall = Icon("phone-call") +var PhoneForwarded = Icon("phone-forwarded") +var PhoneIncoming = Icon("phone-incoming") +var PhoneMissed = Icon("phone-missed") +var PhoneOff = Icon("phone-off") +var PhoneOutgoing = Icon("phone-outgoing") +var Phone = Icon("phone") +var Pi = Icon("pi") +var Piano = Icon("piano") +var Pickaxe = Icon("pickaxe") +var PictureInPicture2 = Icon("picture-in-picture-2") +var PictureInPicture = Icon("picture-in-picture") +var PiggyBank = Icon("piggy-bank") +var PlaneTakeoff = Icon("plane-takeoff") +var PilcrowRight = Icon("pilcrow-right") +var Pilcrow = Icon("pilcrow") +var PillBottle = Icon("pill-bottle") +var Pill = Icon("pill") +var PinOff = Icon("pin-off") +var Pin = Icon("pin") +var Pipette = Icon("pipette") +var Pizza = Icon("pizza") +var PlaneLanding = Icon("plane-landing") +var RotateCcwKey = Icon("rotate-ccw-key") +var Popcorn = Icon("popcorn") +var Popsicle = Icon("popsicle") +var MonitorStop = Icon("monitor-stop") +var PoundSterling = Icon("pound-sterling") +var PowerOff = Icon("power-off") +var Power = Icon("power") +var Presentation = Icon("presentation") +var PrinterCheck = Icon("printer-check") +var MonitorUp = Icon("monitor-up") +var Printer = Icon("printer") +var MonitorX = Icon("monitor-x") +var Monitor = Icon("monitor") +var MoonStar = Icon("moon-star") +var Moon = Icon("moon") +var MountainSnow = Icon("mountain-snow") +var Mountain = Icon("mountain") +var MouseOff = Icon("mouse-off") +var MousePointer2 = Icon("mouse-pointer-2") +var Projector = Icon("projector") +var MousePointerBan = Icon("mouse-pointer-ban") +var MousePointerClick = Icon("mouse-pointer-click") +var MousePointer = Icon("mouse-pointer") +var Mouse = Icon("mouse") +var Move3d = Icon("move-3d") +var MoveDiagonal2 = Icon("move-diagonal-2") +var MoveDiagonal = Icon("move-diagonal") +var MoveDownLeft = Icon("move-down-left") +var MoveDownRight = Icon("move-down-right") +var MoveDown = Icon("move-down") +var MoveHorizontal = Icon("move-horizontal") +var RectangleGoggles = Icon("rectangle-goggles") +var Puzzle = Icon("puzzle") +var Pyramid = Icon("pyramid") +var QrCode = Icon("qr-code") +var Quote = Icon("quote") +var Rabbit = Icon("rabbit") +var Radar = Icon("radar") +var Radiation = Icon("radiation") +var Radical = Icon("radical") +var RadioReceiver = Icon("radio-receiver") +var RadioTower = Icon("radio-tower") +var Radio = Icon("radio") +var Radius = Icon("radius") +var RailSymbol = Icon("rail-symbol") +var Rainbow = Icon("rainbow") +var Rat = Icon("rat") +var Ratio = Icon("ratio") +var ReceiptCent = Icon("receipt-cent") +var ReceiptEuro = Icon("receipt-euro") +var ReceiptIndianRupee = Icon("receipt-indian-rupee") +var ReceiptJapaneseYen = Icon("receipt-japanese-yen") +var ReceiptPoundSterling = Icon("receipt-pound-sterling") +var ReceiptRussianRuble = Icon("receipt-russian-ruble") +var ReceiptSwissFranc = Icon("receipt-swiss-franc") +var ReceiptText = Icon("receipt-text") +var Receipt = Icon("receipt") +var RectangleEllipsis = Icon("rectangle-ellipsis") +var RemoveFormatting = Icon("remove-formatting") +var CloudLightning = Icon("cloud-lightning") +var Reply = Icon("reply") +var Repeat1 = Icon("repeat-1") +var Proportions = Icon("proportions") +var ChevronFirst = Icon("chevron-first") +var Plug = Icon("plug") +var Plane = Icon("plane") +var Play = Icon("play") +var Plug2 = Icon("plug-2") +var PlugZap = Icon("plug-zap") +var Shell = Icon("shell") +var RotateCcwSquare = Icon("rotate-ccw-square") +var RotateCcw = Icon("rotate-ccw") +var RotateCwSquare = Icon("rotate-cw-square") +var RotateCw = Icon("rotate-cw") +var RouteOff = Icon("route-off") +var Route = Icon("route") +var Router = Icon("router") +var Rows2 = Icon("rows-2") +var Rows3 = Icon("rows-3") +var Rows4 = Icon("rows-4") +var Rss = Icon("rss") +var RulerDimensionLine = Icon("ruler-dimension-line") +var Ruler = Icon("ruler") +var RussianRuble = Icon("russian-ruble") +var Sailboat = Icon("sailboat") +var Salad = Icon("salad") +var Sandwich = Icon("sandwich") +var SatelliteDish = Icon("satellite-dish") +var Satellite = Icon("satellite") +var SaudiRiyal = Icon("saudi-riyal") +var SaveAll = Icon("save-all") +var SaveOff = Icon("save-off") +var Save = Icon("save") +var Scale3d = Icon("scale-3d") +var Scale = Icon("scale") +var Scaling = Icon("scaling") +var ScanBarcode = Icon("scan-barcode") +var ScanEye = Icon("scan-eye") +var ScanFace = Icon("scan-face") +var ScanHeart = Icon("scan-heart") +var ScanLine = Icon("scan-line") +var ScanQrCode = Icon("scan-qr-code") +var ScanSearch = Icon("scan-search") +var ScanText = Icon("scan-text") +var Scan = Icon("scan") +var School = Icon("school") +var ScissorsLineDashed = Icon("scissors-line-dashed") +var Scissors = Icon("scissors") +var ScreenShareOff = Icon("screen-share-off") +var ScreenShare = Icon("screen-share") +var ScrollText = Icon("scroll-text") +var Scroll = Icon("scroll") +var SearchCheck = Icon("search-check") +var SearchCode = Icon("search-code") +var SearchSlash = Icon("search-slash") +var SearchX = Icon("search-x") +var Search = Icon("search") +var Section = Icon("section") +var SendHorizontal = Icon("send-horizontal") +var SendToBack = Icon("send-to-back") +var Send = Icon("send") +var SeparatorHorizontal = Icon("separator-horizontal") +var SeparatorVertical = Icon("separator-vertical") +var ServerCog = Icon("server-cog") +var ServerCrash = Icon("server-crash") +var ServerOff = Icon("server-off") +var Server = Icon("server") +var Settings2 = Icon("settings-2") +var Settings = Icon("settings") +var Shapes = Icon("shapes") +var Share2 = Icon("share-2") +var Share = Icon("share") +var Sheet = Icon("sheet") +var Clock1 = Icon("clock-1") +var RefreshCcwDot = Icon("refresh-ccw-dot") +var RectangleVertical = Icon("rectangle-vertical") +var Recycle = Icon("recycle") +var Redo2 = Icon("redo-2") +var RedoDot = Icon("redo-dot") +var Redo = Icon("redo") +var SquareArrowOutUpLeft = Icon("square-arrow-out-up-left") +var ShieldAlert = Icon("shield-alert") +var ShieldBan = Icon("shield-ban") +var ShieldCheck = Icon("shield-check") +var ShieldEllipsis = Icon("shield-ellipsis") +var ShieldHalf = Icon("shield-half") +var ShieldMinus = Icon("shield-minus") +var ShieldOff = Icon("shield-off") +var ShieldPlus = Icon("shield-plus") +var ShieldQuestion = Icon("shield-question") +var ShieldUser = Icon("shield-user") +var ShieldX = Icon("shield-x") +var Shield = Icon("shield") +var ShipWheel = Icon("ship-wheel") +var Ship = Icon("ship") +var Shirt = Icon("shirt") +var ShoppingBag = Icon("shopping-bag") +var ShoppingBasket = Icon("shopping-basket") +var ShoppingCart = Icon("shopping-cart") +var Shovel = Icon("shovel") +var ShowerHead = Icon("shower-head") +var Shredder = Icon("shredder") +var Shrimp = Icon("shrimp") +var Shrink = Icon("shrink") +var Shrub = Icon("shrub") +var Shuffle = Icon("shuffle") +var Sigma = Icon("sigma") +var SignalHigh = Icon("signal-high") +var SignalLow = Icon("signal-low") +var SignalMedium = Icon("signal-medium") +var SignalZero = Icon("signal-zero") +var Signal = Icon("signal") +var Signature = Icon("signature") +var SignpostBig = Icon("signpost-big") +var Signpost = Icon("signpost") +var Siren = Icon("siren") +var SkipBack = Icon("skip-back") +var SkipForward = Icon("skip-forward") +var Skull = Icon("skull") +var Slack = Icon("slack") +var Slash = Icon("slash") +var Slice = Icon("slice") +var SlidersHorizontal = Icon("sliders-horizontal") +var SlidersVertical = Icon("sliders-vertical") +var SmartphoneCharging = Icon("smartphone-charging") +var SmartphoneNfc = Icon("smartphone-nfc") +var Smartphone = Icon("smartphone") +var SmilePlus = Icon("smile-plus") +var Smile = Icon("smile") +var Snail = Icon("snail") +var Snowflake = Icon("snowflake") +var SoapDispenserDroplet = Icon("soap-dispenser-droplet") +var Sofa = Icon("sofa") +var Soup = Icon("soup") +var Space = Icon("space") +var Spade = Icon("spade") +var Sparkle = Icon("sparkle") +var Sparkles = Icon("sparkles") +var Speaker = Icon("speaker") +var Speech = Icon("speech") +var SpellCheck2 = Icon("spell-check-2") +var SpellCheck = Icon("spell-check") +var SplinePointer = Icon("spline-pointer") +var Spline = Icon("spline") +var Split = Icon("split") +var SprayCan = Icon("spray-can") +var Sprout = Icon("sprout") +var ReplaceAll = Icon("replace-all") +var Repeat = Icon("repeat") +var RefreshCw = Icon("refresh-cw") +var RefreshCcw = Icon("refresh-ccw") +var RefreshCwOff = Icon("refresh-cw-off") +var Replace = Icon("replace") +var SquareArrowDown = Icon("square-arrow-down") +var SquareArrowDownLeft = Icon("square-arrow-down-left") +var SquareArrowDownRight = Icon("square-arrow-down-right") +var Refrigerator = Icon("refrigerator") +var SquareArrowOutDownLeft = Icon("square-arrow-out-down-left") +var SquareArrowLeft = Icon("square-arrow-left") +var SunMedium = Icon("sun-medium") +var SquareActivity = Icon("square-activity") +var SquareArrowOutDownRight = Icon("square-arrow-out-down-right") +var ReplyAll = Icon("reply-all") +var TextCursorInput = Icon("text-cursor-input") +var SunMoon = Icon("sun-moon") +var SunSnow = Icon("sun-snow") +var Sun = Icon("sun") +var Sunrise = Icon("sunrise") +var Sunset = Icon("sunset") +var Superscript = Icon("superscript") +var SwatchBook = Icon("swatch-book") +var SwissFranc = Icon("swiss-franc") +var SwitchCamera = Icon("switch-camera") +var Sword = Icon("sword") +var Swords = Icon("swords") +var Syringe = Icon("syringe") +var Table2 = Icon("table-2") +var TableCellsMerge = Icon("table-cells-merge") +var TableCellsSplit = Icon("table-cells-split") +var TableColumnsSplit = Icon("table-columns-split") +var TableOfContents = Icon("table-of-contents") +var TableProperties = Icon("table-properties") +var TableRowsSplit = Icon("table-rows-split") +var Table = Icon("table") +var TabletSmartphone = Icon("tablet-smartphone") +var Tablet = Icon("tablet") +var Tablets = Icon("tablets") +var Tag = Icon("tag") +var Tags = Icon("tags") +var Tally1 = Icon("tally-1") +var Tally2 = Icon("tally-2") +var Tally3 = Icon("tally-3") +var Tally4 = Icon("tally-4") +var Tally5 = Icon("tally-5") +var Tangent = Icon("tangent") +var Target = Icon("target") +var Telescope = Icon("telescope") +var TentTree = Icon("tent-tree") +var Tent = Icon("tent") +var Terminal = Icon("terminal") +var TestTubeDiagonal = Icon("test-tube-diagonal") +var TestTube = Icon("test-tube") +var TestTubes = Icon("test-tubes") +var Pocket = Icon("pocket") +var Plus = Icon("plus") +var PocketKnife = Icon("pocket-knife") +var TrainFront = Icon("train-front") +var TextCursor = Icon("text-cursor") +var TextQuote = Icon("text-quote") +var TextSearch = Icon("text-search") +var SquareArrowOutUpRight = Icon("square-arrow-out-up-right") +var SquareArrowRight = Icon("square-arrow-right") +var SquareArrowUpLeft = Icon("square-arrow-up-left") +var SquareArrowUpRight = Icon("square-arrow-up-right") +var SquareArrowUp = Icon("square-arrow-up") +var SquareAsterisk = Icon("square-asterisk") +var SquareBottomDashedScissors = Icon("square-bottom-dashed-scissors") +var SquareChartGantt = Icon("square-chart-gantt") +var SquareCheckBig = Icon("square-check-big") +var SquareCheck = Icon("square-check") +var SquareChevronDown = Icon("square-chevron-down") +var SquareChevronLeft = Icon("square-chevron-left") +var SquareChevronRight = Icon("square-chevron-right") +var SquareChevronUp = Icon("square-chevron-up") +var SquareCode = Icon("square-code") +var SquareDashedBottomCode = Icon("square-dashed-bottom-code") +var SquareDashedBottom = Icon("square-dashed-bottom") +var SquareDashedKanban = Icon("square-dashed-kanban") +var SquareDashedMousePointer = Icon("square-dashed-mouse-pointer") +var TextSelect = Icon("text-select") +var Text = Icon("text") +var Theater = Icon("theater") +var ThermometerSnowflake = Icon("thermometer-snowflake") +var ThermometerSun = Icon("thermometer-sun") +var Thermometer = Icon("thermometer") +var ThumbsDown = Icon("thumbs-down") +var ThumbsUp = Icon("thumbs-up") +var TicketCheck = Icon("ticket-check") +var TicketMinus = Icon("ticket-minus") +var TicketPercent = Icon("ticket-percent") +var TicketPlus = Icon("ticket-plus") +var TicketSlash = Icon("ticket-slash") +var SquareDashed = Icon("square-dashed") +var SquareDivide = Icon("square-divide") +var SquareDot = Icon("square-dot") +var SquareEqual = Icon("square-equal") +var SquareFunction = Icon("square-function") +var SquareKanban = Icon("square-kanban") +var SquareLibrary = Icon("square-library") +var SquareM = Icon("square-m") +var SquareMenu = Icon("square-menu") +var SquareMinus = Icon("square-minus") +var SquareMousePointer = Icon("square-mouse-pointer") +var SquareParkingOff = Icon("square-parking-off") +var SquareParking = Icon("square-parking") +var SquarePen = Icon("square-pen") +var SquarePercent = Icon("square-percent") +var SquarePi = Icon("square-pi") +var SquarePilcrow = Icon("square-pilcrow") +var SquarePlay = Icon("square-play") +var SquarePlus = Icon("square-plus") +var SquarePower = Icon("square-power") +var SquareRadical = Icon("square-radical") +var SquareRoundCorner = Icon("square-round-corner") +var SquareScissors = Icon("square-scissors") +var SquareSigma = Icon("square-sigma") +var SquareSlash = Icon("square-slash") +var SquareSplitHorizontal = Icon("square-split-horizontal") +var SquareSplitVertical = Icon("square-split-vertical") +var SquareSquare = Icon("square-square") +var SquareStack = Icon("square-stack") +var SquareTerminal = Icon("square-terminal") +var SquareUserRound = Icon("square-user-round") +var SquareUser = Icon("square-user") +var SquareX = Icon("square-x") +var Square = Icon("square") +var SquaresExclude = Icon("squares-exclude") +var SquaresIntersect = Icon("squares-intersect") +var SquaresSubtract = Icon("squares-subtract") +var SquaresUnite = Icon("squares-unite") +var Squircle = Icon("squircle") +var Squirrel = Icon("squirrel") +var Stamp = Icon("stamp") +var StarHalf = Icon("star-half") +var StarOff = Icon("star-off") +var Star = Icon("star") +var StepBack = Icon("step-back") +var StepForward = Icon("step-forward") +var TicketX = Icon("ticket-x") +var Ticket = Icon("ticket") +var TicketsPlane = Icon("tickets-plane") +var Tickets = Icon("tickets") +var TimerOff = Icon("timer-off") +var TimerReset = Icon("timer-reset") +var Timer = Icon("timer") +var ToggleLeft = Icon("toggle-left") +var ToggleRight = Icon("toggle-right") +var Toilet = Icon("toilet") +var Tornado = Icon("tornado") +var Stethoscope = Icon("stethoscope") +var Sticker = Icon("sticker") +var StickyNote = Icon("sticky-note") +var Store = Icon("store") +var StretchHorizontal = Icon("stretch-horizontal") +var StretchVertical = Icon("stretch-vertical") +var Strikethrough = Icon("strikethrough") +var Subscript = Icon("subscript") +var SunDim = Icon("sun-dim") +var RockingChair = Icon("rocking-chair") +var Ribbon = Icon("ribbon") +var Rocket = Icon("rocket") +var Regex = Icon("regex") +var UserRoundCheck = Icon("user-round-check") +var TrainTrack = Icon("train-track") +var TramFront = Icon("tram-front") +var Transgender = Icon("transgender") +var Trash2 = Icon("trash-2") +var Trash = Icon("trash") +var TreeDeciduous = Icon("tree-deciduous") +var TreePalm = Icon("tree-palm") +var TreePine = Icon("tree-pine") +var Trees = Icon("trees") +var Trello = Icon("trello") +var TrendingDown = Icon("trending-down") +var TrendingUp = Icon("trending-up") +var TriangleAlert = Icon("triangle-alert") +var TrendingUpDown = Icon("trending-up-down") +var Torus = Icon("torus") +var TouchpadOff = Icon("touchpad-off") +var Touchpad = Icon("touchpad") +var TowerControl = Icon("tower-control") +var ToyBrick = Icon("toy-brick") +var Tractor = Icon("tractor") +var TrafficCone = Icon("traffic-cone") +var TrainFrontTunnel = Icon("train-front-tunnel") +var RollerCoaster = Icon("roller-coaster") +var Undo2 = Icon("undo-2") +var TriangleRight = Icon("triangle-right") +var Triangle = Icon("triangle") +var Trophy = Icon("trophy") +var TruckElectric = Icon("truck-electric") +var TriangleDashed = Icon("triangle-dashed") +var UndoDot = Icon("undo-dot") +var Undo = Icon("undo") +var UnfoldHorizontal = Icon("unfold-horizontal") +var UnfoldVertical = Icon("unfold-vertical") +var Ungroup = Icon("ungroup") +var University = Icon("university") +var Unlink2 = Icon("unlink-2") +var Unlink = Icon("unlink") +var Unplug = Icon("unplug") +var Upload = Icon("upload") +var Usb = Icon("usb") +var UserCheck = Icon("user-check") +var UserCog = Icon("user-cog") +var UserMinus = Icon("user-minus") +var UserPlus = Icon("user-plus") +var UserLock = Icon("user-lock") +var UserPen = Icon("user-pen") +var ZoomOut = Icon("zoom-out") +var UserRoundCog = Icon("user-round-cog") +var UserRoundMinus = Icon("user-round-minus") +var UserRoundPen = Icon("user-round-pen") +var UserRoundPlus = Icon("user-round-plus") +var UserRoundSearch = Icon("user-round-search") +var UserRoundX = Icon("user-round-x") +var UserRound = Icon("user-round") +var UserSearch = Icon("user-search") +var UserX = Icon("user-x") +var User = Icon("user") +var UsersRound = Icon("users-round") +var Users = Icon("users") +var UtensilsCrossed = Icon("utensils-crossed") +var Utensils = Icon("utensils") +var UtilityPole = Icon("utility-pole") +var Variable = Icon("variable") +var Vault = Icon("vault") +var Vegan = Icon("vegan") +var VenetianMask = Icon("venetian-mask") +var VenusAndMars = Icon("venus-and-mars") +var Venus = Icon("venus") +var VibrateOff = Icon("vibrate-off") +var Vibrate = Icon("vibrate") +var VideoOff = Icon("video-off") +var Video = Icon("video") +var Videotape = Icon("videotape") +var View = Icon("view") +var Voicemail = Icon("voicemail") +var Volleyball = Icon("volleyball") +var Volume1 = Icon("volume-1") +var Volume2 = Icon("volume-2") +var VolumeOff = Icon("volume-off") +var VolumeX = Icon("volume-x") +var Volume = Icon("volume") +var Vote = Icon("vote") +var WalletCards = Icon("wallet-cards") +var WalletMinimal = Icon("wallet-minimal") +var Wallet = Icon("wallet") +var Wallpaper = Icon("wallpaper") +var WandSparkles = Icon("wand-sparkles") +var Wand = Icon("wand") +var Warehouse = Icon("warehouse") +var WashingMachine = Icon("washing-machine") +var Watch = Icon("watch") +var WavesLadder = Icon("waves-ladder") +var Waves = Icon("waves") +var Waypoints = Icon("waypoints") +var Webcam = Icon("webcam") +var WebhookOff = Icon("webhook-off") +var Webhook = Icon("webhook") +var Weight = Icon("weight") +var WheatOff = Icon("wheat-off") +var Wheat = Icon("wheat") +var WholeWord = Icon("whole-word") +var WifiHigh = Icon("wifi-high") +var WifiLow = Icon("wifi-low") +var WifiOff = Icon("wifi-off") +var WifiPen = Icon("wifi-pen") +var WifiZero = Icon("wifi-zero") +var Wifi = Icon("wifi") +var WindArrowDown = Icon("wind-arrow-down") +var Wind = Icon("wind") +var WineOff = Icon("wine-off") +var Wine = Icon("wine") +var Workflow = Icon("workflow") +var Worm = Icon("worm") +var WrapText = Icon("wrap-text") +var Wrench = Icon("wrench") +var X = Icon("x") +var Youtube = Icon("youtube") +var ZapOff = Icon("zap-off") +var Zap = Icon("zap") +var ZoomIn = Icon("zoom-in") +var Podcast = Icon("podcast") +var Truck = Icon("truck") +var TypeOutline = Icon("type-outline") +var Type = Icon("type") +var UmbrellaOff = Icon("umbrella-off") +var Umbrella = Icon("umbrella") +var Underline = Icon("underline") +var TvMinimal = Icon("tv-minimal") +var Turtle = Icon("turtle") +var TvMinimalPlay = Icon("tv-minimal-play") +var Tv = Icon("tv") +var Twitch = Icon("twitch") +var PointerOff = Icon("pointer-off") +var Twitter = Icon("twitter") +var Rotate3d = Icon("rotate-3d") +var Repeat2 = Icon("repeat-2") +var Rewind = Icon("rewind") +var RectangleHorizontal = Icon("rectangle-horizontal") +var PencilLine = Icon("pencil-line") +var Heater = Icon("heater") diff --git a/server/web/templui/components/input/input.templ b/server/web/templui/components/input/input.templ new file mode 100644 index 0000000..eb329c7 --- /dev/null +++ b/server/web/templui/components/input/input.templ @@ -0,0 +1,165 @@ +// templui component input - version: main installed by templui v0.71.0 +package input + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Type string + +const ( + TypeText Type = "text" + TypePassword Type = "password" + TypeEmail Type = "email" + TypeNumber Type = "number" + TypeTel Type = "tel" + TypeURL Type = "url" + TypeSearch Type = "search" + TypeDate Type = "date" + TypeTime Type = "time" + TypeFile Type = "file" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Type Type + Placeholder string + Value string + Disabled bool + Readonly bool + Required bool + FileAccept string + HasError bool + NoTogglePassword bool +} + +templ Input(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Type == "" { + {{ p.Type = TypeText }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + if p.Type == TypePassword && !p.NoTogglePassword { + @Script() + } +
    + + if p.Type == TypePassword && !p.NoTogglePassword { + @button.Button(button.Props{ + Size: button.SizeIcon, + Variant: button.VariantGhost, + Class: "absolute right-0 top-1/2 -translate-y-1/2 opacity-50 cursor-pointer", + Attributes: templ.Attributes{"data-toggle-password": p.ID}, + }) { + + @icon.Eye(icon.Props{ + Size: 18, + }) + + + } + } +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/input/input_templ.go b/server/web/templui/components/input/input_templ.go new file mode 100644 index 0000000..09b0ed0 --- /dev/null +++ b/server/web/templui/components/input/input_templ.go @@ -0,0 +1,376 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component input - version: main installed by templui v0.71.0 + +package input + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Type string + +const ( + TypeText Type = "text" + TypePassword Type = "password" + TypeEmail Type = "email" + TypeNumber Type = "number" + TypeTel Type = "tel" + TypeURL Type = "url" + TypeSearch Type = "search" + TypeDate Type = "date" + TypeTime Type = "time" + TypeFile Type = "file" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Type Type + Placeholder string + Value string + Disabled bool + Readonly bool + Required bool + FileAccept string + HasError bool + NoTogglePassword bool +} + +func Input(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.Type == "" { + p.Type = TypeText + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Type == TypePassword && !p.NoTogglePassword { + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "peer flex h-10 w-full px-3 py-2", + "rounded-md border border-input bg-background text-sm ring-offset-background", + "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", + "placeholder:text-muted-foreground", + "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "disabled:cursor-not-allowed disabled:opacity-50", + utils.If(p.HasError, "border-destructive ring-destructive"), + utils.If(p.Type == TypePassword && !p.NoTogglePassword, "pr-8"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Type == TypePassword && !p.NoTogglePassword { + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Eye(icon.Props{ + Size: 18, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.EyeOff(icon.Props{ + Size: 18, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + Size: button.SizeIcon, + Variant: button.VariantGhost, + Class: "absolute right-0 top-1/2 -translate-y-1/2 opacity-50 cursor-pointer", + Attributes: templ.Attributes{"data-toggle-password": p.ID}, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/inputotp/input_otp.templ b/server/web/templui/components/inputotp/input_otp.templ new file mode 100644 index 0000000..509b63a --- /dev/null +++ b/server/web/templui/components/inputotp/input_otp.templ @@ -0,0 +1,388 @@ +// templui component inputotp - version: main installed by templui v0.71.0 +package inputotp + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value string + Required bool + Name string + HasError bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SlotProps struct { + ID string + Class string + Attributes templ.Attributes + Index int + Type string + Placeholder string + Disabled bool +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ InputOTP(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + + { children... } +
    +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Slot(props ...SlotProps) { + {{ var p SlotProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Type == "" { + {{ p.Type = "text" }} + } +
    + +
    +} + +templ Separator(props ...SeparatorProps) { + {{ var p SeparatorProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + - +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/inputotp/input_otp_templ.go b/server/web/templui/components/inputotp/input_otp_templ.go new file mode 100644 index 0000000..44d2674 --- /dev/null +++ b/server/web/templui/components/inputotp/input_otp_templ.go @@ -0,0 +1,630 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component inputotp - version: main installed by templui v0.71.0 + +package inputotp + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value string + Required bool + Name string + HasError bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SlotProps struct { + ID string + Class string + Attributes templ.Attributes + Index int + Type string + Placeholder string + Disabled bool +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func InputOTP(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "flex flex-row items-center gap-2 w-fit", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var9 = []any{ + utils.TwMerge( + "flex gap-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var8.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Slot(props ...SlotProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SlotProps + if len(props) > 0 { + p = props[0] + } + if p.Type == "" { + p.Type = "text" + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var14 = []any{ + utils.TwMerge( + "w-10 h-12 text-center", + "rounded-md border border-input bg-background text-sm", + "file:border-0 file:bg-transparent file:text-sm file:font-medium", + "placeholder:text-muted-foreground", + "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "disabled:cursor-not-allowed disabled:opacity-50", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Separator(props ...SeparatorProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SeparatorProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{ + utils.TwMerge( + "flex items-center text-muted-foreground text-xl", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "-") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var23 := templ.GetChildren(ctx) + if templ_7745c5c3_Var23 == nil { + templ_7745c5c3_Var23 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var24 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/label/label.templ b/server/web/templui/components/label/label.templ new file mode 100644 index 0000000..8514617 --- /dev/null +++ b/server/web/templui/components/label/label.templ @@ -0,0 +1,111 @@ +// templui component label - version: main installed by templui v0.71.0 +package label + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + For string + Error string +} + +templ Label(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/label/label_templ.go b/server/web/templui/components/label/label_templ.go new file mode 100644 index 0000000..ea39ced --- /dev/null +++ b/server/web/templui/components/label/label_templ.go @@ -0,0 +1,200 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component label - version: main installed by templui v0.71.0 + +package label + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + For string + Error string +} + +func Label(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "text-sm font-medium leading-none inline-block", + utils.If(len(p.Error) > 0, "text-destructive"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/modal/modal.templ b/server/web/templui/components/modal/modal.templ new file mode 100644 index 0000000..21c4472 --- /dev/null +++ b/server/web/templui/components/modal/modal.templ @@ -0,0 +1,362 @@ +// templui component modal - version: main installed by templui v0.71.0 +package modal + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + DisableClickAway bool + DisableESC bool +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Disabled bool + ModalID string // ID of the modal to trigger +} + +type CloseProps struct { + ID string + Class string + Attributes templ.Attributes + ModalID string // ID of the modal to close (optional, defaults to closest modal) +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type BodyProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Modal(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = "modal-" + utils.RandomID() }} + } + +} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Close(props ...CloseProps) { + {{ var p CloseProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    +

    + // Ensure title ID matches aria-labelledby + { children... } +

    +
    +} + +templ Body(props ...BodyProps) { + {{ var p BodyProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/modal/modal_templ.go b/server/web/templui/components/modal/modal_templ.go new file mode 100644 index 0000000..1514b52 --- /dev/null +++ b/server/web/templui/components/modal/modal_templ.go @@ -0,0 +1,784 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component modal - version: main installed by templui v0.71.0 + +package modal + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + DisableClickAway bool + DisableESC bool +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Disabled bool + ModalID string // ID of the modal to trigger +} + +type CloseProps struct { + ID string + Class string + Attributes templ.Attributes + ModalID string // ID of the modal to close (optional, defaults to closest modal) +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type BodyProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Modal(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = "modal-" + utils.RandomID() + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "modal-content relative bg-background rounded-lg border text-left overflow-hidden shadow-xl transform transition-all sm:my-8 w-full scale-95 opacity-0", // Base classes + transition start + "duration-300 ease-out", // Enter duration + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + utils.IfElse(p.Disabled, "cursor-not-allowed opacity-50", "cursor-pointer"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Close(props ...CloseProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p CloseProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var15 = []any{utils.TwMerge("cursor-pointer", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var14.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4 text-lg leading-6 font-medium text-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Body(props ...BodyProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var24 := templ.GetChildren(ctx) + if templ_7745c5c3_Var24 == nil { + templ_7745c5c3_Var24 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p BodyProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var25 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var25...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var24.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var28 := templ.GetChildren(ctx) + if templ_7745c5c3_Var28 == nil { + templ_7745c5c3_Var28 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var29 = []any{utils.TwMerge("px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var29...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var28.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var32 := templ.GetChildren(ctx) + if templ_7745c5c3_Var32 == nil { + templ_7745c5c3_Var32 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var33 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var33), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/pagination/pagination.templ b/server/web/templui/components/pagination/pagination.templ new file mode 100644 index 0000000..d60c47b --- /dev/null +++ b/server/web/templui/components/pagination/pagination.templ @@ -0,0 +1,277 @@ +// templui component pagination - version: main installed by templui v0.71.0 +package pagination + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LinkProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + IsActive bool + Disabled bool + HxGet string + HxTarget string + HxSwap string +} + +type PreviousProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + Disabled bool + Label string + HxGet string + HxTarget string + HxSwap string +} + +type NextProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + Disabled bool + Label string + HxGet string + HxTarget string + HxSwap string +} + +templ Pagination(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
      + { children... } +
    +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
  • + { children... } +
  • +} + +templ Link(props ...LinkProps) { + {{ var p LinkProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Disabled { + @button.Button(button.Props{ + ID: p.ID, + Disabled: true, + Size: button.SizeIcon, + Variant: button.VariantGhost, + Class: p.Class, + Attributes: p.Attributes, + }) { + { children... } + } + } else if p.HxGet != "" { + @button.Button(button.Props{ + ID: p.ID, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Size: button.SizeIcon, + Variant: button.Variant(buttonVariant(p.IsActive)), + Class: p.Class, + Attributes: p.Attributes, + }) { + { children... } + } + } else { + @button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + Size: button.SizeIcon, + Variant: button.Variant(buttonVariant(p.IsActive)), + Class: p.Class, + Attributes: p.Attributes, + }) { + { children... } + } + } +} + +templ Previous(props ...PreviousProps) { + {{ var p PreviousProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + @button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Disabled: p.Disabled, + Variant: button.VariantGhost, + Class: utils.TwMerge("gap-1", p.Class), + Attributes: p.Attributes, + }) { + @icon.ChevronLeft(icon.Props{Size: 16}) + if p.Label != "" { + { p.Label } + } + } +} + +templ Next(props ...NextProps) { + {{ var p NextProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + @button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Disabled: p.Disabled, + Variant: button.VariantGhost, + Class: utils.TwMerge("gap-1", p.Class), + Attributes: p.Attributes, + }) { + if p.Label != "" { + { p.Label } + } + @icon.ChevronRight(icon.Props{Size: 16}) + } +} + +templ Ellipsis() { + @icon.Ellipsis(icon.Props{Size: 16}) +} + +func CreatePagination(currentPage, totalPages, maxVisible int) struct { + CurrentPage int + TotalPages int + Pages []int + HasPrevious bool + HasNext bool +} { + if currentPage < 1 { + currentPage = 1 + } + if totalPages < 1 { + totalPages = 1 + } + if currentPage > totalPages { + currentPage = totalPages + } + if maxVisible < 1 { + maxVisible = 5 + } + + start, end := calculateVisibleRange(currentPage, totalPages, maxVisible) + pages := make([]int, 0, end-start+1) + for i := start; i <= end; i++ { + pages = append(pages, i) + } + + return struct { + CurrentPage int + TotalPages int + Pages []int + HasPrevious bool + HasNext bool + }{ + CurrentPage: currentPage, + TotalPages: totalPages, + Pages: pages, + HasPrevious: currentPage > 1, + HasNext: currentPage < totalPages, + } +} + +func calculateVisibleRange(currentPage, totalPages, maxVisible int) (int, int) { + if totalPages <= maxVisible { + return 1, totalPages + } + + half := maxVisible / 2 + start := currentPage - half + end := currentPage + half + + if start < 1 { + end += (1 - start) + start = 1 + } + + if end > totalPages { + start -= (end - totalPages) + if start < 1 { + start = 1 + } + end = totalPages + } + + return start, end +} + +func buttonVariant(isActive bool) button.Variant { + if isActive { + return button.VariantOutline + } + return button.VariantGhost +} diff --git a/server/web/templui/components/pagination/pagination_templ.go b/server/web/templui/components/pagination/pagination_templ.go new file mode 100644 index 0000000..49ff213 --- /dev/null +++ b/server/web/templui/components/pagination/pagination_templ.go @@ -0,0 +1,695 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component pagination - version: main installed by templui v0.71.0 + +package pagination + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LinkProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + IsActive bool + Disabled bool + HxGet string + HxTarget string + HxSwap string +} + +type PreviousProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + Disabled bool + Label string + HxGet string + HxTarget string + HxSwap string +} + +type NextProps struct { + ID string + Class string + Attributes templ.Attributes + Href string + Disabled bool + Label string + HxGet string + HxTarget string + HxSwap string +} + +func Pagination(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("flex flex-wrap justify-center", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Link(props ...LinkProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LinkProps + if len(props) > 0 { + p = props[0] + } + if p.Disabled { + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Disabled: true, + Size: button.SizeIcon, + Variant: button.VariantGhost, + Class: p.Class, + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if p.HxGet != "" { + templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Size: button.SizeIcon, + Variant: button.Variant(buttonVariant(p.IsActive)), + Class: p.Class, + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + Size: button.SizeIcon, + Variant: button.Variant(buttonVariant(p.IsActive)), + Class: p.Class, + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func Previous(props ...PreviousProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p PreviousProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Var14 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = icon.ChevronLeft(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Label != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 174, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Disabled: p.Disabled, + Variant: button.VariantGhost, + Class: utils.TwMerge("gap-1", p.Class), + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Next(props ...NextProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p NextProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Var17 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + if p.Label != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var18 string + templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 196, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronRight(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Href: p.Href, + HxGet: p.HxGet, + HxTarget: p.HxTarget, + HxSwap: p.HxSwap, + Disabled: p.Disabled, + Variant: button.VariantGhost, + Class: utils.TwMerge("gap-1", p.Class), + Attributes: p.Attributes, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var17), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Ellipsis() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = icon.Ellipsis(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func CreatePagination(currentPage, totalPages, maxVisible int) struct { + CurrentPage int + TotalPages int + Pages []int + HasPrevious bool + HasNext bool +} { + if currentPage < 1 { + currentPage = 1 + } + if totalPages < 1 { + totalPages = 1 + } + if currentPage > totalPages { + currentPage = totalPages + } + if maxVisible < 1 { + maxVisible = 5 + } + + start, end := calculateVisibleRange(currentPage, totalPages, maxVisible) + pages := make([]int, 0, end-start+1) + for i := start; i <= end; i++ { + pages = append(pages, i) + } + + return struct { + CurrentPage int + TotalPages int + Pages []int + HasPrevious bool + HasNext bool + }{ + CurrentPage: currentPage, + TotalPages: totalPages, + Pages: pages, + HasPrevious: currentPage > 1, + HasNext: currentPage < totalPages, + } +} + +func calculateVisibleRange(currentPage, totalPages, maxVisible int) (int, int) { + if totalPages <= maxVisible { + return 1, totalPages + } + + half := maxVisible / 2 + start := currentPage - half + end := currentPage + half + + if start < 1 { + end += (1 - start) + start = 1 + } + + if end > totalPages { + start -= (end - totalPages) + if start < 1 { + start = 1 + } + end = totalPages + } + + return start, end +} + +func buttonVariant(isActive bool) button.Variant { + if isActive { + return button.VariantOutline + } + return button.VariantGhost +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/popover/floating_ui_core.templ b/server/web/templui/components/popover/floating_ui_core.templ new file mode 100644 index 0000000..67743b8 --- /dev/null +++ b/server/web/templui/components/popover/floating_ui_core.templ @@ -0,0 +1,865 @@ +// templui component popover - version: main installed by templui v0.71.0 +package popover + +// https://cdn.jsdelivr.net/npm/@floating-ui/core@1.7.0 +templ FloatingUICore() { + +} diff --git a/server/web/templui/components/popover/floating_ui_core_templ.go b/server/web/templui/components/popover/floating_ui_core_templ.go new file mode 100644 index 0000000..c4e46fc --- /dev/null +++ b/server/web/templui/components/popover/floating_ui_core_templ.go @@ -0,0 +1,56 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component popover - version: main installed by templui v0.71.0 + +package popover + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +// https://cdn.jsdelivr.net/npm/@floating-ui/core@1.7.0 +func FloatingUICore() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/popover/floating_ui_dom.templ b/server/web/templui/components/popover/floating_ui_dom.templ new file mode 100644 index 0000000..c2b7d05 --- /dev/null +++ b/server/web/templui/components/popover/floating_ui_dom.templ @@ -0,0 +1,606 @@ +// templui component popover - version: main installed by templui v0.71.0 +package popover + +// https://cdn.jsdelivr.net/npm/@floating-ui/dom@1.7.0 +templ FloatingUIDom() { + +} diff --git a/server/web/templui/components/popover/floating_ui_dom_templ.go b/server/web/templui/components/popover/floating_ui_dom_templ.go new file mode 100644 index 0000000..94a6369 --- /dev/null +++ b/server/web/templui/components/popover/floating_ui_dom_templ.go @@ -0,0 +1,56 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component popover - version: main installed by templui v0.71.0 + +package popover + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +// https://cdn.jsdelivr.net/npm/@floating-ui/dom@1.7.0 +func FloatingUIDom() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/popover/popover.templ b/server/web/templui/components/popover/popover.templ new file mode 100644 index 0000000..04c7c99 --- /dev/null +++ b/server/web/templui/components/popover/popover.templ @@ -0,0 +1,489 @@ +// templui component popover - version: main installed by templui v0.71.0 +package popover + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Placement string + +const ( + PlacementTop Placement = "top" + PlacementTopStart Placement = "top-start" + PlacementTopEnd Placement = "top-end" + PlacementRight Placement = "right" + PlacementRightStart Placement = "right-start" + PlacementRightEnd Placement = "right-end" + PlacementBottom Placement = "bottom" + PlacementBottomStart Placement = "bottom-start" + PlacementBottomEnd Placement = "bottom-end" + PlacementLeft Placement = "left" + PlacementLeftStart Placement = "left-start" + PlacementLeftEnd Placement = "left-end" +) + +type TriggerType string + +const ( + TriggerTypeHover TriggerType = "hover" + TriggerTypeClick TriggerType = "click" +) + +type Props struct { + Class string +} + +type TriggerProps struct { + ID string + For string + TriggerType TriggerType +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Placement Placement + Offset int + DisableClickAway bool + DisableESC bool + ShowArrow bool + HoverDelay int + HoverOutDelay int + MatchWidth bool +} + +templ Popover(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.TriggerType == "" { + {{ p.TriggerType = TriggerTypeClick }} + } + + { children... } + +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Placement == "" { + {{ p.Placement = PlacementBottom }} + } + if p.Offset == 0 { + if p.ShowArrow { + {{ p.Offset = 8 }} + } else { + {{ p.Offset = 4 }} + } + } + +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + @FloatingUICore() + @FloatingUIDom() + + } +} diff --git a/server/web/templui/components/popover/popover_templ.go b/server/web/templui/components/popover/popover_templ.go new file mode 100644 index 0000000..7ffb128 --- /dev/null +++ b/server/web/templui/components/popover/popover_templ.go @@ -0,0 +1,513 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component popover - version: main installed by templui v0.71.0 + +package popover + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Placement string + +const ( + PlacementTop Placement = "top" + PlacementTopStart Placement = "top-start" + PlacementTopEnd Placement = "top-end" + PlacementRight Placement = "right" + PlacementRightStart Placement = "right-start" + PlacementRightEnd Placement = "right-end" + PlacementBottom Placement = "bottom" + PlacementBottomStart Placement = "bottom-start" + PlacementBottomEnd Placement = "bottom-end" + PlacementLeft Placement = "left" + PlacementLeftStart Placement = "left-start" + PlacementLeftEnd Placement = "left-end" +) + +type TriggerType string + +const ( + TriggerTypeHover TriggerType = "hover" + TriggerTypeClick TriggerType = "click" +) + +type Props struct { + Class string +} + +type TriggerProps struct { + ID string + For string + TriggerType TriggerType +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Placement Placement + Offset int + DisableClickAway bool + DisableESC bool + ShowArrow bool + HoverDelay int + HoverOutDelay int + MatchWidth bool +} + +func Popover(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{p.Class} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + if p.TriggerType == "" { + p.TriggerType = TriggerTypeClick + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var4.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + if p.Placement == "" { + p.Placement = PlacementBottom + } + if p.Offset == 0 { + if p.ShowArrow { + p.Offset = 8 + } else { + p.Offset = 4 + } + } + var templ_7745c5c3_Var9 = []any{utils.TwMerge( + "bg-background rounded-lg border text-sm shadow-lg pointer-events-auto absolute z-[9999] hidden top-0 left-0", + p.Class, + )} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var8.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.ShowArrow { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var20 := templ.GetChildren(ctx) + if templ_7745c5c3_Var20 == nil { + templ_7745c5c3_Var20 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var21 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = FloatingUICore().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = FloatingUIDom().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/progress/progress.templ b/server/web/templui/components/progress/progress.templ new file mode 100644 index 0000000..07de32f --- /dev/null +++ b/server/web/templui/components/progress/progress.templ @@ -0,0 +1,190 @@ +// templui component progress - version: main installed by templui v0.71.0 +package progress + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Size string +type Variant string + +const ( + SizeSm Size = "sm" + SizeLg Size = "lg" +) + +const ( + VariantDefault Variant = "default" + VariantSuccess Variant = "success" + VariantDanger Variant = "danger" + VariantWarning Variant = "warning" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Max int + Value int + Label string + ShowValue bool + Size Size + Variant Variant + BarClass string + HxGet string + HxTrigger string + HxTarget string + HxSwap string +} + +templ Progress(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } +
    + if p.Label != "" || p.ShowValue { +
    + if p.Label != "" { + { p.Label } + } + if p.ShowValue { + + { fmt.Sprintf("%d%%", percentage(p.Value, p)) } + + } +
    + } +
    +
    +
    +
    +} + +func maxValue(max int) int { + if max <= 0 { + return 100 + } + return max +} + +func percentage(value int, props Props) int { + max := maxValue(props.Max) + if value < 0 { + value = 0 + } + if value > max { + value = max + } + return (value * 100) / max +} + +func sizeClasses(size Size) string { + switch size { + case SizeSm: + return "h-1" + case SizeLg: + return "h-4" + default: + return "h-2.5" + } +} + +func variantClasses(variant Variant) string { + switch variant { + case VariantSuccess: + return "bg-green-500" + case VariantDanger: + return "bg-destructive" + case VariantWarning: + return "bg-yellow-500" + default: + return "bg-primary" + } +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/progress/progress_templ.go b/server/web/templui/components/progress/progress_templ.go new file mode 100644 index 0000000..d3a09b5 --- /dev/null +++ b/server/web/templui/components/progress/progress_templ.go @@ -0,0 +1,420 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component progress - version: main installed by templui v0.71.0 + +package progress + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Size string +type Variant string + +const ( + SizeSm Size = "sm" + SizeLg Size = "lg" +) + +const ( + VariantDefault Variant = "default" + VariantSuccess Variant = "success" + VariantDanger Variant = "danger" + VariantWarning Variant = "warning" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Max int + Value int + Label string + ShowValue bool + Size Size + Variant Variant + BarClass string + HxGet string + HxTrigger string + HxTarget string + HxSwap string +} + +func Progress(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("w-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Label != "" || p.ShowValue { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Label != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 74, Col: 48} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if p.ShowValue { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d%%", percentage(p.Value, p))) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 78, Col: 51} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 = []any{ + utils.TwMerge( + "h-full rounded-full transition-all", + sizeClasses(p.Size), + variantClasses(p.Variant), + p.BarClass, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func maxValue(max int) int { + if max <= 0 { + return 100 + } + return max +} + +func percentage(value int, props Props) int { + max := maxValue(props.Max) + if value < 0 { + value = 0 + } + if value > max { + value = max + } + return (value * 100) / max +} + +func sizeClasses(size Size) string { + switch size { + case SizeSm: + return "h-1" + case SizeLg: + return "h-4" + default: + return "h-2.5" + } +} + +func variantClasses(variant Variant) string { + switch variant { + case VariantSuccess: + return "bg-green-500" + case VariantDanger: + return "bg-destructive" + case VariantWarning: + return "bg-yellow-500" + default: + return "bg-primary" + } +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/radio/radio.templ b/server/web/templui/components/radio/radio.templ new file mode 100644 index 0000000..8fe571e --- /dev/null +++ b/server/web/templui/components/radio/radio.templ @@ -0,0 +1,54 @@ +// templui component radio - version: main installed by templui v0.71.0 +package radio + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Disabled bool + Required bool + Checked bool +} + +templ Radio(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + +} diff --git a/server/web/templui/components/radio/radio_templ.go b/server/web/templui/components/radio/radio_templ.go new file mode 100644 index 0000000..058c9ea --- /dev/null +++ b/server/web/templui/components/radio/radio_templ.go @@ -0,0 +1,179 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component radio - version: main installed by templui v0.71.0 + +package radio + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Disabled bool + Required bool + Checked bool +} + +func Radio(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative h-4 w-4", + "before:absolute before:left-1/2 before:top-1/2", + "before:h-1.5 before:w-1.5 before:-translate-x-1/2 before:-translate-y-1/2", + "appearance-none rounded-full", + "border-2 border-primary", + "before:content[''] before:rounded-full before:bg-background", + "checked:border-primary checked:bg-primary", + "checked:before:visible", + "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", + "focus-visible:ring-offset-2 focus-visible:ring-offset-background", + "disabled:cursor-not-allowed", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/radiocard/radio_card.templ b/server/web/templui/components/radiocard/radio_card.templ new file mode 100644 index 0000000..6336047 --- /dev/null +++ b/server/web/templui/components/radiocard/radio_card.templ @@ -0,0 +1,135 @@ +// templui component radiocard - version: main installed by templui v0.71.0 +package radiocard + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Checked bool + Disabled bool + Required bool +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ RadioCard(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } +
    + + +
    +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

    + { children... } +

    +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} diff --git a/server/web/templui/components/radiocard/radio_card_templ.go b/server/web/templui/components/radiocard/radio_card_templ.go new file mode 100644 index 0000000..4463e9a --- /dev/null +++ b/server/web/templui/components/radiocard/radio_card_templ.go @@ -0,0 +1,530 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component radiocard - version: main installed by templui v0.71.0 + +package radiocard + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Checked bool + Disabled bool + Required bool +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func RadioCard(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative", + utils.If(p.Disabled, "opacity-60"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 = []any{ + utils.TwMerge( + "block w-full rounded-lg border overflow-hidden h-full", + "bg-card text-card-foreground p-4 flex flex-col", + "cursor-pointer", + "hover:border-primary/50", + "peer-checked:ring-1 peer-checked:ring-primary peer-checked:border-primary", + utils.If(p.Disabled, "cursor-not-allowed"), + "transition-all duration-200", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{utils.TwMerge("flex items-center justify-between mb-2", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{utils.TwMerge("mt-auto pt-4 w-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/rating/rating.templ b/server/web/templui/components/rating/rating.templ new file mode 100644 index 0000000..84e2afe --- /dev/null +++ b/server/web/templui/components/rating/rating.templ @@ -0,0 +1,426 @@ +// templui component rating - version: main installed by templui v0.71.0 +package rating + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Style string + +const ( + StyleStar Style = "star" + StyleHeart Style = "heart" + StyleEmoji Style = "emoji" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value float64 + ReadOnly bool + Precision float64 + Name string + OnlyInteger bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value int + Style Style +} + +templ Rating(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ p.setDefaults() }} +
    + { children... } + if p.Name != "" { + + } +
    +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ p.setDefaults() }} +
    +
    + @ratingIcon(p.Style, false, float64(p.Value)) +
    +
    + @ratingIcon(p.Style, true, float64(p.Value)) +
    +
    +} + +func colorClass(style Style) string { + switch style { + case StyleHeart: + return "text-destructive" + case StyleEmoji: + return "text-yellow-500" + default: + return "text-yellow-400" + } +} + +func ratingIcon(style Style, filled bool, value float64) templ.Component { + if style == StyleEmoji { + if filled { + switch { + case value <= 1: + return icon.Angry() + case value <= 2: + return icon.Frown() + case value <= 3: + return icon.Meh() + case value <= 4: + return icon.Smile() + default: + return icon.Laugh() + } + } + return icon.Meh() + } + iconProps := icon.Props{} + if filled { + iconProps.Fill = "currentColor" + } + switch style { + case StyleHeart: + return icon.Heart(iconProps) + default: + return icon.Star(iconProps) + } +} + +func (p *ItemProps) setDefaults() { + if p.Style == "" { + p.Style = StyleStar + } +} + +func (p *Props) setDefaults() { + if p.Precision <= 0 { + p.Precision = 1.0 + } +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/rating/rating_templ.go b/server/web/templui/components/rating/rating_templ.go new file mode 100644 index 0000000..49a8486 --- /dev/null +++ b/server/web/templui/components/rating/rating_templ.go @@ -0,0 +1,585 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component rating - version: main installed by templui v0.71.0 + +package rating + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Style string + +const ( + StyleStar Style = "star" + StyleHeart Style = "heart" + StyleEmoji Style = "emoji" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value float64 + ReadOnly bool + Precision float64 + Name string + OnlyInteger bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value int + Style Style +} + +func Rating(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + p.setDefaults() + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "flex flex-col items-start gap-1", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Name != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var13 = []any{utils.TwMerge("flex flex-row items-center gap-1", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var12.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + p.setDefaults() + var templ_7745c5c3_Var17 = []any{ + utils.TwMerge( + "relative", + colorClass(p.Style), + "transition-opacity", + "cursor-pointer", // Default cursor + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var17...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ratingIcon(p.Style, false, float64(p.Value)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ratingIcon(p.Style, true, float64(p.Value)).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func colorClass(style Style) string { + switch style { + case StyleHeart: + return "text-destructive" + case StyleEmoji: + return "text-yellow-500" + default: + return "text-yellow-400" + } +} + +func ratingIcon(style Style, filled bool, value float64) templ.Component { + if style == StyleEmoji { + if filled { + switch { + case value <= 1: + return icon.Angry() + case value <= 2: + return icon.Frown() + case value <= 3: + return icon.Meh() + case value <= 4: + return icon.Smile() + default: + return icon.Laugh() + } + } + return icon.Meh() + } + iconProps := icon.Props{} + if filled { + iconProps.Fill = "currentColor" + } + switch style { + case StyleHeart: + return icon.Heart(iconProps) + default: + return icon.Star(iconProps) + } +} + +func (p *ItemProps) setDefaults() { + if p.Style == "" { + p.Style = StyleStar + } +} + +func (p *Props) setDefaults() { + if p.Precision <= 0 { + p.Precision = 1.0 + } +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var21 := templ.GetChildren(ctx) + if templ_7745c5c3_Var21 == nil { + templ_7745c5c3_Var21 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var22 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var22), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/selectbox/select_box.templ b/server/web/templui/components/selectbox/select_box.templ new file mode 100644 index 0000000..0105ac9 --- /dev/null +++ b/server/web/templui/components/selectbox/select_box.templ @@ -0,0 +1,419 @@ +// templui component selectbox - version: main installed by templui v0.71.0 +package selectbox + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type contextKey string + +var contentIDKey contextKey = "contentID" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Required bool + Disabled bool + HasError bool +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + Placeholder string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + Selected bool + Disabled bool +} + +templ SelectBox(props ...Props) { + @Script() + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + wrapperID := p.ID + if wrapperID == "" { + wrapperID = utils.RandomID() + } + contentID := fmt.Sprintf("%s-content", wrapperID) + ctx = context.WithValue(ctx, contentIDKey, contentID) + }} +
    + @popover.Popover() { + { children... } + } +
    +} + +templ Trigger(props ...TriggerProps) { + {{ + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + }} + @popover.Trigger(popover.TriggerProps{ + For: contentID, + TriggerType: popover.TriggerTypeClick, + }) { + @button.Button(button.Props{ + ID: p.ID, + Type: "button", + Variant: button.VariantOutline, + Class: utils.TwMerge( + "w-full select-trigger flex items-center justify-between focus:ring-2 focus:ring-offset-2", + utils.If(p.HasError, "border-destructive ring-destructive"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes( + templ.Attributes{ + "data-content-id": contentID, + "tabindex": "0", + "required": strconv.FormatBool(p.Required), + }, + p.Attributes, + ), + }) { + + { children... } + + @icon.ChevronDown(icon.Props{ + Size: 16, + Class: "text-muted-foreground", + }) + + } + } +} + +templ Value(props ...ValueProps) { + {{ var p ValueProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + if p.Placeholder != "" { + { p.Placeholder } + } + { children... } + +} + +templ Content(props ...ContentProps) { + {{ + var p ContentProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + }} + @popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + MatchWidth: true, + Class: utils.TwMerge( + "p-1 select-content z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", + "min-w-[var(--popover-trigger-width)] w-[var(--popover-trigger-width)]", + p.Class, + ), + Attributes: utils.MergeAttributes( + templ.Attributes{ + "role": "listbox", + "tabindex": "-1", + }, + p.Attributes, + ), + }) { + { children... } + } +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Label(props ...LabelProps) { + {{ var p LabelProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + + { children... } + + + @icon.Check(icon.Props{Size: 16}) + +
    +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/selectbox/select_box_templ.go b/server/web/templui/components/selectbox/select_box_templ.go new file mode 100644 index 0000000..55c2a3c --- /dev/null +++ b/server/web/templui/components/selectbox/select_box_templ.go @@ -0,0 +1,918 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component selectbox - version: main installed by templui v0.71.0 + +package selectbox + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type contextKey string + +var contentIDKey contextKey = "contentID" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Required bool + Disabled bool + HasError bool +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + Placeholder string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + Selected bool + Disabled bool +} + +func SelectBox(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + + var p Props + if len(props) > 0 { + p = props[0] + } + wrapperID := p.ID + if wrapperID == "" { + wrapperID = utils.RandomID() + } + contentID := fmt.Sprintf("%s-content", wrapperID) + ctx = context.WithValue(ctx, contentIDKey, contentID) + var templ_7745c5c3_Var2 = []any{utils.TwMerge("select-container w-full relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Popover().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronDown(icon.Props{ + Size: 16, + Class: "text-muted-foreground", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Type: "button", + Variant: button.VariantOutline, + Class: utils.TwMerge( + "w-full select-trigger flex items-center justify-between focus:ring-2 focus:ring-offset-2", + utils.If(p.HasError, "border-destructive ring-destructive"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes( + templ.Attributes{ + "data-content-id": contentID, + "tabindex": "0", + "required": strconv.FormatBool(p.Required), + }, + p.Attributes, + ), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ + For: contentID, + TriggerType: popover.TriggerTypeClick, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Value(props ...ValueProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ValueProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var11 = []any{utils.TwMerge("block truncate select-value text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var11...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Placeholder != "" { + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/selectbox/select_box.templ`, Line: 158, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templ_7745c5c3_Var10.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p ContentProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + MatchWidth: true, + Class: utils.TwMerge( + "p-1 select-content z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", + "min-w-[var(--popover-trigger-width)] w-[var(--popover-trigger-width)]", + p.Class, + ), + Attributes: utils.MergeAttributes( + templ.Attributes{ + "role": "listbox", + "tabindex": "-1", + }, + p.Attributes, + ), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var18 = []any{utils.TwMerge("p-1", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Label(props ...LabelProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var21 := templ.GetChildren(ctx) + if templ_7745c5c3_Var21 == nil { + templ_7745c5c3_Var21 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LabelProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var22 = []any{utils.TwMerge("px-2 py-1.5 text-sm font-medium", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var22...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var21.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var25 := templ.GetChildren(ctx) + if templ_7745c5c3_Var25 == nil { + templ_7745c5c3_Var25 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var26 = []any{ + utils.TwMerge( + "select-item relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm font-light outline-none", + "hover:bg-accent hover:text-accent-foreground", + "focus:bg-accent focus:text-accent-foreground", + utils.If(p.Selected, "bg-accent text-accent-foreground"), + utils.If(p.Disabled, "pointer-events-none opacity-50"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var26...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var25.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var32 = []any{ + utils.TwMerge( + "select-check absolute right-2 flex h-3.5 w-3.5 items-center justify-center", + utils.IfElse(p.Selected, "opacity-100", "opacity-0"), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var32...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Check(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var34 := templ.GetChildren(ctx) + if templ_7745c5c3_Var34 == nil { + templ_7745c5c3_Var34 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var35 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var35), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/separator/separator.templ b/server/web/templui/components/separator/separator.templ new file mode 100644 index 0000000..f1a66d3 --- /dev/null +++ b/server/web/templui/components/separator/separator.templ @@ -0,0 +1,97 @@ +// templui component separator - version: main installed by templui v0.71.0 +package separator + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Orientation string +type Decoration string + +const ( + OrientationHorizontal Orientation = "horizontal" + OrientationVertical Orientation = "vertical" +) + +const ( + DecorationDashed Decoration = "dashed" + DecorationDotted Decoration = "dotted" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Orientation Orientation + Decoration Decoration +} + +templ Separator(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Orientation == "" { + {{ p.Orientation = OrientationHorizontal }} + } + if p.Orientation == OrientationHorizontal { + + } else { + + } +} + +func decorationClasses(decoration Decoration) string { + switch decoration { + case DecorationDashed: + return "border-dashed" + case DecorationDotted: + return "border-dotted" + default: + return "" + } +} diff --git a/server/web/templui/components/separator/separator_templ.go b/server/web/templui/components/separator/separator_templ.go new file mode 100644 index 0000000..65cb042 --- /dev/null +++ b/server/web/templui/components/separator/separator_templ.go @@ -0,0 +1,258 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component separator - version: main installed by templui v0.71.0 + +package separator + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Orientation string +type Decoration string + +const ( + OrientationHorizontal Orientation = "horizontal" + OrientationVertical Orientation = "vertical" +) + +const ( + DecorationDashed Decoration = "dashed" + DecorationDotted Decoration = "dotted" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Orientation Orientation + Decoration Decoration +} + +func Separator(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.Orientation == "" { + p.Orientation = OrientationHorizontal + } + if p.Orientation == OrientationHorizontal { + var templ_7745c5c3_Var2 = []any{utils.TwMerge("shrink-0 w-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 = []any{ + utils.TwMerge( + "absolute w-full border-t h-[1px]", + decorationClasses(p.Decoration), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var7 = []any{utils.TwMerge("shrink-0 h-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 = []any{ + utils.TwMerge( + "absolute h-full border-l w-[1px]", + decorationClasses(p.Decoration), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func decorationClasses(decoration Decoration) string { + switch decoration { + case DecorationDashed: + return "border-dashed" + case DecorationDotted: + return "border-dotted" + default: + return "" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/skeleton/skeleton.templ b/server/web/templui/components/skeleton/skeleton.templ new file mode 100644 index 0000000..02f4e27 --- /dev/null +++ b/server/web/templui/components/skeleton/skeleton.templ @@ -0,0 +1,29 @@ +// templui component skeleton - version: main installed by templui v0.71.0 +package skeleton + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Skeleton(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    +} diff --git a/server/web/templui/components/skeleton/skeleton_templ.go b/server/web/templui/components/skeleton/skeleton_templ.go new file mode 100644 index 0000000..ad1a1c2 --- /dev/null +++ b/server/web/templui/components/skeleton/skeleton_templ.go @@ -0,0 +1,108 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component skeleton - version: main installed by templui v0.71.0 + +package skeleton + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +func Skeleton(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "animate-pulse rounded bg-muted", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/slider/slider.templ b/server/web/templui/components/slider/slider.templ new file mode 100644 index 0000000..a381b6a --- /dev/null +++ b/server/web/templui/components/slider/slider.templ @@ -0,0 +1,168 @@ +// templui component slider - version: main installed by templui v0.71.0 +package slider + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type InputProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Min int + Max int + Step int + Value int + Disabled bool +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + For string // Corresponds to the ID of the Slider Input +} + +templ Slider(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + { children... } +
    +} + +templ Input(props ...InputProps) { + {{ var p InputProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + +} + +templ Value(props ...ValueProps) { + {{ var p ValueProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.For == "" { + Error: SliderValue missing 'For' attribute. + } + + + +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/slider/slider_templ.go b/server/web/templui/components/slider/slider_templ.go new file mode 100644 index 0000000..228baf2 --- /dev/null +++ b/server/web/templui/components/slider/slider_templ.go @@ -0,0 +1,493 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component slider - version: main installed by templui v0.71.0 + +package slider + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type InputProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Min int + Max int + Step int + Value int + Disabled bool +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + For string // Corresponds to the ID of the Slider Input +} + +func Slider(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("w-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Input(props ...InputProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p InputProps + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var6 = []any{ + utils.TwMerge( + "w-full h-2 rounded-full bg-secondary appearance-none cursor-pointer", + "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4", + "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary", + "[&::-webkit-slider-thumb]:hover:bg-primary/90", + "[&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:border-0", + "[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary", + "[&::-moz-range-thumb]:hover:bg-primary/90", + "disabled:opacity-50 disabled:cursor-not-allowed", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Value(props ...ValueProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ValueProps + if len(props) > 0 { + p = props[0] + } + if p.For == "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "Error: SliderValue missing 'For' attribute. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + var templ_7745c5c3_Var15 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var20 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var20), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/spinner/spinner.templ b/server/web/templui/components/spinner/spinner.templ new file mode 100644 index 0000000..41a86a7 --- /dev/null +++ b/server/web/templui/components/spinner/spinner.templ @@ -0,0 +1,83 @@ +// templui component spinner - version: main installed by templui v0.71.0 +package spinner + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Size string + +const ( + SizeSm Size = "sm" + SizeMd Size = "md" + SizeLg Size = "lg" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Size Size + Color string +} + +templ Spinner(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    +
    +
    +} + +func sizeClass(size Size) string { + switch size { + case SizeSm: + return "w-6 h-6" + case SizeLg: + return "w-12 h-12" + default: + return "w-8 h-8" + } +} + +func borderSizeClass(size Size) string { + switch size { + case SizeSm: + return "border-[3px]" + case SizeLg: + return "border-[5px]" + default: + return "border-4" + } +} diff --git a/server/web/templui/components/spinner/spinner_templ.go b/server/web/templui/components/spinner/spinner_templ.go new file mode 100644 index 0000000..94782c3 --- /dev/null +++ b/server/web/templui/components/spinner/spinner_templ.go @@ -0,0 +1,178 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component spinner - version: main installed by templui v0.71.0 + +package spinner + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Size string + +const ( + SizeSm Size = "sm" + SizeMd Size = "md" + SizeLg Size = "lg" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Size Size + Color string +} + +func Spinner(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "inline-flex flex-col items-center justify-center", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 = []any{ + utils.TwMerge( + "animate-spin rounded-full", + sizeClass(p.Size), + borderSizeClass(p.Size), + utils.IfElse( + p.Color == "", + "border-primary border-b-transparent", + "border-current border-b-transparent", + ), + utils.IfElse( + p.Color != "", + p.Color, + "", + ), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func sizeClass(size Size) string { + switch size { + case SizeSm: + return "w-6 h-6" + case SizeLg: + return "w-12 h-12" + default: + return "w-8 h-8" + } +} + +func borderSizeClass(size Size) string { + switch size { + case SizeSm: + return "border-[3px]" + case SizeLg: + return "border-[5px]" + default: + return "border-4" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/table/table.templ b/server/web/templui/components/table/table.templ new file mode 100644 index 0000000..35081fd --- /dev/null +++ b/server/web/templui/components/table/table.templ @@ -0,0 +1,201 @@ +// templui component table - version: main installed by templui v0.71.0 +package table + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type BodyProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type RowProps struct { + ID string + Class string + Attributes templ.Attributes + Selected bool +} + +type HeadProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CellProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CaptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ Table(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
    + + { children... } +
    +
    +} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Body(props ...BodyProps) { + {{ var p BodyProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + tr]:last:border-b-0", p.Class) } + { p.Attributes... } + > + { children... } + +} + +templ Row(props ...RowProps) { + {{ var p RowProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Head(props ...HeadProps) { + {{ var p HeadProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + [role=checkbox]]:translate-y-[2px]", + p.Class, + ), + } + { p.Attributes... } + > + { children... } + +} + +templ Cell(props ...CellProps) { + {{ var p CellProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + [role=checkbox]]:translate-y-[2px]", + p.Class, + ), + } + { p.Attributes... } + > + { children... } + +} + +templ Caption(props ...CaptionProps) { + {{ var p CaptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} diff --git a/server/web/templui/components/table/table_templ.go b/server/web/templui/components/table/table_templ.go new file mode 100644 index 0000000..da08bcd --- /dev/null +++ b/server/web/templui/components/table/table_templ.go @@ -0,0 +1,806 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component table - version: main installed by templui v0.71.0 + +package table + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type BodyProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type RowProps struct { + ID string + Class string + Attributes templ.Attributes + Selected bool +} + +type HeadProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CellProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type CaptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func Table(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("w-full caption-bottom text-sm", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var6 = []any{utils.TwMerge("[&_tr]:border-b", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Body(props ...BodyProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p BodyProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{utils.TwMerge("[&_tr:last-child]:border-0", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var13 := templ.GetChildren(ctx) + if templ_7745c5c3_Var13 == nil { + templ_7745c5c3_Var13 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var14 = []any{utils.TwMerge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Row(props ...RowProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p RowProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var18 = []any{ + utils.TwMerge( + "border-b transition-colors hover:bg-muted/50", + utils.If(p.Selected, "data-[state=selected]:bg-muted"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Head(props ...HeadProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var21 := templ.GetChildren(ctx) + if templ_7745c5c3_Var21 == nil { + templ_7745c5c3_Var21 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeadProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var22 = []any{ + utils.TwMerge( + "h-10 px-2 text-left align-middle font-medium text-muted-foreground", + "[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var22...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var21.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Cell(props ...CellProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var25 := templ.GetChildren(ctx) + if templ_7745c5c3_Var25 == nil { + templ_7745c5c3_Var25 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p CellProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var26 = []any{ + utils.TwMerge( + "p-2 align-middle", + "[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var26...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var25.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Caption(props ...CaptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var29 := templ.GetChildren(ctx) + if templ_7745c5c3_Var29 == nil { + templ_7745c5c3_Var29 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p CaptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var30 = []any{utils.TwMerge("mt-4 text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var30...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var29.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/tabs/tabs.templ b/server/web/templui/components/tabs/tabs.templ new file mode 100644 index 0000000..2cbd49b --- /dev/null +++ b/server/web/templui/components/tabs/tabs.templ @@ -0,0 +1,249 @@ +// templui component tabs - version: main installed by templui v0.71.0 +package tabs + +import ( + "context" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ListProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + IsActive bool + TabsID string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + IsActive bool + TabsID string +} + +templ Tabs(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ tabsID := p.ID }} + if tabsID == "" { + {{ tabsID = utils.RandomID() }} + } +
    + {{ ctx = context.WithValue(ctx, "tabsId", tabsID) }} + { children... } +
    +} + +templ List(props ...ListProps) { + {{ var p ListProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ tabsID := IDFromContext(ctx) }} +
    + { children... } +
    +
    +
    +
    +} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ tabsID := p.TabsID }} + if tabsID == "" { + {{ tabsID = IDFromContext(ctx) }} + } + if p.Value == "" { + Error: Tab Trigger missing required 'Value' attribute. + } + +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + {{ tabsID := p.TabsID }} + if tabsID == "" { + {{ tabsID = IDFromContext(ctx) }} + } + if p.Value == "" { + Error: Tab Content missing required 'Value' attribute. + return templ.NopComponent + } +
    + { children... } +
    +} + +func IDFromContext(ctx context.Context) string { + if tabsID, ok := ctx.Value("tabsId").(string); ok { + return tabsID + } + return "" +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/tabs/tabs_templ.go b/server/web/templui/components/tabs/tabs_templ.go new file mode 100644 index 0000000..3acccb8 --- /dev/null +++ b/server/web/templui/components/tabs/tabs_templ.go @@ -0,0 +1,627 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component tabs - version: main installed by templui v0.71.0 + +package tabs + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "context" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type ListProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + IsActive bool + TabsID string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + IsActive bool + TabsID string +} + +func Tabs(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + tabsID := p.ID + if tabsID == "" { + tabsID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge("relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + ctx = context.WithValue(ctx, "tabsId", tabsID) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func List(props ...ListProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ListProps + if len(props) > 0 { + p = props[0] + } + tabsID := IDFromContext(ctx) + var templ_7745c5c3_Var7 = []any{ + utils.TwMerge( + "relative flex items-center justify-center h-10 p-1 rounded-lg select-none bg-muted text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + tabsID := p.TabsID + if tabsID == "" { + tabsID = IDFromContext(ctx) + } + if p.Value == "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "Error: Tab Trigger missing required 'Value' attribute. ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + var templ_7745c5c3_Var12 = []any{ + utils.TwMerge( + "relative z-20 flex-1 inline-flex items-center justify-center h-8 px-3 text-sm font-medium transition-all rounded-md cursor-pointer whitespace-nowrap hover:text-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + tabsID := p.TabsID + if tabsID == "" { + tabsID = IDFromContext(ctx) + } + if p.Value == "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "Error: Tab Content missing required 'Value' attribute. return templ.NopComponent") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + var templ_7745c5c3_Var19 = []any{ + utils.TwMerge( + "relative", + utils.If(!p.IsActive, "hidden"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var18.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func IDFromContext(ctx context.Context) string { + if tabsID, ok := ctx.Value("tabsId").(string); ok { + return tabsID + } + return "" +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var25 := templ.GetChildren(ctx) + if templ_7745c5c3_Var25 == nil { + templ_7745c5c3_Var25 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var26 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/textarea/textarea.templ b/server/web/templui/components/textarea/textarea.templ new file mode 100644 index 0000000..672444e --- /dev/null +++ b/server/web/templui/components/textarea/textarea.templ @@ -0,0 +1,115 @@ +// templui component textarea - version: main installed by templui v0.71.0 +package textarea + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Placeholder string + Rows int + AutoResize bool + Disabled bool + Required bool +} + +templ Textarea(props ...Props) { + @Script() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/textarea/textarea_templ.go b/server/web/templui/components/textarea/textarea_templ.go new file mode 100644 index 0000000..ce2b36b --- /dev/null +++ b/server/web/templui/components/textarea/textarea_templ.go @@ -0,0 +1,277 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component textarea - version: main installed by templui v0.71.0 + +package textarea + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Placeholder string + Rows int + AutoResize bool + Disabled bool + Required bool +} + +func Textarea(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "flex w-full px-3 py-2", + "min-h-[80px]", // Default min-height (adjust if needed) + "rounded-md border border-input bg-background text-sm", + "ring-offset-background", + "placeholder:text-muted-foreground", + "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", + "disabled:cursor-not-allowed disabled:opacity-50", + // Add overflow-hidden only if auto-resizing to prevent scrollbar flicker + utils.If(p.AutoResize, "overflow-hidden resize-none"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/toast/toast.templ b/server/web/templui/components/toast/toast.templ new file mode 100644 index 0000000..84d3b68 --- /dev/null +++ b/server/web/templui/components/toast/toast.templ @@ -0,0 +1,331 @@ +// templui component toast - version: main installed by templui v0.71.0 +package toast + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Variant string +type Position string + +const ( + VariantDefault Variant = "default" + VariantSuccess Variant = "success" + VariantError Variant = "error" + VariantWarning Variant = "warning" + VariantInfo Variant = "info" +) + +const ( + PositionTopRight Position = "top-right" + PositionTopLeft Position = "top-left" + PositionTopCenter Position = "top-center" + PositionBottomRight Position = "bottom-right" + PositionBottomLeft Position = "bottom-left" + PositionBottomCenter Position = "bottom-center" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Title string + Description string + Variant Variant + Position Position + Duration int + Dismissible bool + ShowIndicator bool + Icon bool +} + +templ Toast(props ...Props) { + @Script() + @ToastCSS() + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + {{ p = p.defaults() }} + {{ isTop := p.Position == PositionTopRight || p.Position == PositionTopLeft || p.Position == PositionTopCenter }} + {{ isBottom := p.Position == PositionBottomRight || p.Position == PositionBottomLeft || p.Position == PositionBottomCenter }} +
    +
    + if p.ShowIndicator { + @indicator(p) + } + if p.Icon { + @toastIcon(p) + } + + @title(p) + @description(p) + + if p.Dismissible { + @dismissButton() + } +
    +
    +} + +templ indicator(p Props) { +
    +
    +
    +} + +templ toastIcon(p Props) { + if p.Variant == VariantSuccess { + @icon.CircleCheck(icon.Props{Size: 22, Class: "text-green-500 mr-3 flex-shrink-0"}) + } else if p.Variant == VariantError { + @icon.CircleX(icon.Props{Size: 22, Class: "text-red-500 mr-3 flex-shrink-0"}) + } else if p.Variant == VariantWarning { + @icon.TriangleAlert(icon.Props{Size: 22, Class: "text-yellow-500 mr-3 flex-shrink-0"}) + } else if p.Variant == VariantInfo { + @icon.Info(icon.Props{Size: 22, Class: "text-blue-500 mr-3 flex-shrink-0"}) + } +} + +templ title(p Props) { + if p.Title != "" { +

    { p.Title }

    + } +} + +templ description(p Props) { + if p.Description != "" { +

    { p.Description }

    + } +} + +templ dismissButton() { + @button.Button(button.Props{ + Size: button.SizeIcon, + Variant: button.VariantGhost, + Attributes: templ.Attributes{ + "aria-label": "Close", + "data-toast-dismiss": "", + "type": "button", + }, + }) { + @icon.X(icon.Props{ + Size: 18, + Class: "opacity-75 hover:opacity-100", + }) + } +} + +func (p Props) defaults() Props { + if p.Variant == "" { + p.Variant = VariantDefault + } + if p.Position == "" { + p.Position = PositionBottomRight + } + if p.Duration == 0 { + p.Duration = 3000 + } + return p +} + +func typeClass(t Variant) string { + switch t { + case VariantDefault: + return "bg-gray-500" + case VariantSuccess: + return "bg-green-500" + case VariantError: + return "bg-red-500" + case VariantWarning: + return "bg-yellow-500" + case VariantInfo: + return "bg-blue-500" + default: + return "" + } +} + +var cssHandle = templ.NewOnceHandle() + +templ ToastCSS() { + @cssHandle.Once() { + + } +} + +var handle = templ.NewOnceHandle() + +templ Script() { + @handle.Once() { + + } +} diff --git a/server/web/templui/components/toast/toast_templ.go b/server/web/templui/components/toast/toast_templ.go new file mode 100644 index 0000000..d2b22f5 --- /dev/null +++ b/server/web/templui/components/toast/toast_templ.go @@ -0,0 +1,603 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component toast - version: main installed by templui v0.71.0 + +package toast + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Variant string +type Position string + +const ( + VariantDefault Variant = "default" + VariantSuccess Variant = "success" + VariantError Variant = "error" + VariantWarning Variant = "warning" + VariantInfo Variant = "info" +) + +const ( + PositionTopRight Position = "top-right" + PositionTopLeft Position = "top-left" + PositionTopCenter Position = "top-center" + PositionBottomRight Position = "bottom-right" + PositionBottomLeft Position = "bottom-left" + PositionBottomCenter Position = "bottom-center" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Title string + Description string + Variant Variant + Position Position + Duration int + Dismissible bool + ShowIndicator bool + Icon bool +} + +func Toast(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ToastCSS().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + p = p.defaults() + isTop := p.Position == PositionTopRight || p.Position == PositionTopLeft || p.Position == PositionTopCenter + isBottom := p.Position == PositionBottomRight || p.Position == PositionBottomLeft || p.Position == PositionBottomCenter + var templ_7745c5c3_Var2 = []any{utils.TwMerge( + "z-50 fixed pointer-events-auto p-4", + "opacity-0 transform transition-all duration-300 ease-out", + utils.If(isTop, "top-0"), + utils.If(isBottom, "bottom-0"), + utils.If(isTop, "translate-y-4"), + utils.If(isBottom, "-translate-y-4"), + utils.If(p.Position == PositionTopRight || p.Position == PositionBottomRight, "right-0"), + utils.If(p.Position == PositionTopLeft || p.Position == PositionBottomLeft, "left-0"), + utils.If(p.Position == PositionTopCenter || p.Position == PositionBottomCenter, "left-1/2 -translate-x-1/2"), + "w-full md:max-w-[420px]", + p.Class, + )} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.ShowIndicator { + templ_7745c5c3_Err = indicator(p).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if p.Icon { + templ_7745c5c3_Err = toastIcon(p).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = title(p).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = description(p).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Dismissible { + templ_7745c5c3_Err = dismissButton().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func indicator(p Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 = []any{utils.TwMerge( + "absolute inset-0", + typeClass(p.Variant), + )} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func toastIcon(p Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if p.Variant == VariantSuccess { + templ_7745c5c3_Err = icon.CircleCheck(icon.Props{Size: 22, Class: "text-green-500 mr-3 flex-shrink-0"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if p.Variant == VariantError { + templ_7745c5c3_Err = icon.CircleX(icon.Props{Size: 22, Class: "text-red-500 mr-3 flex-shrink-0"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if p.Variant == VariantWarning { + templ_7745c5c3_Err = icon.TriangleAlert(icon.Props{Size: 22, Class: "text-yellow-500 mr-3 flex-shrink-0"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else if p.Variant == VariantInfo { + templ_7745c5c3_Err = icon.Info(icon.Props{Size: 22, Class: "text-blue-500 mr-3 flex-shrink-0"}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func title(p Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if p.Title != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 121, Col: 53} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func description(p Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if p.Description != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.Description) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 127, Col: 52} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "

    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + return nil + }) +} + +func dismissButton() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var15 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = icon.X(icon.Props{ + Size: 18, + Class: "opacity-75 hover:opacity-100", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + Size: button.SizeIcon, + Variant: button.VariantGhost, + Attributes: templ.Attributes{ + "aria-label": "Close", + "data-toast-dismiss": "", + "type": "button", + }, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var15), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func (p Props) defaults() Props { + if p.Variant == "" { + p.Variant = VariantDefault + } + if p.Position == "" { + p.Position = PositionBottomRight + } + if p.Duration == 0 { + p.Duration = 3000 + } + return p +} + +func typeClass(t Variant) string { + switch t { + case VariantDefault: + return "bg-gray-500" + case VariantSuccess: + return "bg-green-500" + case VariantError: + return "bg-red-500" + case VariantWarning: + return "bg-yellow-500" + case VariantInfo: + return "bg-blue-500" + default: + return "" + } +} + +var cssHandle = templ.NewOnceHandle() + +func ToastCSS() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var17 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = cssHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var17), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var handle = templ.NewOnceHandle() + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var20 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var20), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/toggle/toggle.templ b/server/web/templui/components/toggle/toggle.templ new file mode 100644 index 0000000..addb034 --- /dev/null +++ b/server/web/templui/components/toggle/toggle.templ @@ -0,0 +1,63 @@ +// templui component toggle - version: main installed by templui v0.71.0 +package toggle + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Disabled bool + Checked bool +} + +templ Toggle(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + +} diff --git a/server/web/templui/components/toggle/toggle_templ.go b/server/web/templui/components/toggle/toggle_templ.go new file mode 100644 index 0000000..7780cc0 --- /dev/null +++ b/server/web/templui/components/toggle/toggle_templ.go @@ -0,0 +1,204 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component toggle - version: main installed by templui v0.71.0 + +package toggle + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Disabled bool + Checked bool +} + +func Toggle(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{utils.TwMerge( + "inline-flex cursor-pointer items-center gap-2", + utils.If(p.Disabled, "cursor-not-allowed"), + )} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/tooltip/tooltip.templ b/server/web/templui/components/tooltip/tooltip.templ new file mode 100644 index 0000000..dc580c7 --- /dev/null +++ b/server/web/templui/components/tooltip/tooltip.templ @@ -0,0 +1,93 @@ +// templui component tooltip - version: main installed by templui v0.71.0 +package tooltip + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Position string + +const ( + PositionTop Position = "top" + PositionRight Position = "right" + PositionBottom Position = "bottom" + PositionLeft Position = "left" +) + +// Map tooltip positions to popover positions +func mapTooltipPositionToPopover(position Position) popover.Placement { + switch position { + case PositionTop: + return popover.PlacementTop + case PositionRight: + return popover.PlacementRight + case PositionBottom: + return popover.PlacementBottom + case PositionLeft: + return popover.PlacementLeft + default: + return popover.PlacementTop + } +} + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + For string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + ShowArrow bool + Position Position + HoverDelay int + HoverOutDelay int +} + +templ Tooltip(props ...Props) { + @popover.Popover() { + { children... } + } +} + +templ Trigger(props ...TriggerProps) { + {{ var p TriggerProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + @popover.Trigger(popover.TriggerProps{ + ID: p.ID, + TriggerType: popover.TriggerTypeHover, + For: p.For, + }) { + { children... } + } +} + +templ Content(props ...ContentProps) { + {{ var p ContentProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + @popover.Content(popover.ContentProps{ + ID: p.ID, + Class: utils.TwMerge("px-4 py-1 bg-foreground text-background border-foreground", p.Class), + Attributes: p.Attributes, + Placement: mapTooltipPositionToPopover(p.Position), + ShowArrow: p.ShowArrow, + HoverDelay: p.HoverDelay, + HoverOutDelay: p.HoverOutDelay, + }) { + { children... } + } +} diff --git a/server/web/templui/components/tooltip/tooltip_templ.go b/server/web/templui/components/tooltip/tooltip_templ.go new file mode 100644 index 0000000..cad9fef --- /dev/null +++ b/server/web/templui/components/tooltip/tooltip_templ.go @@ -0,0 +1,227 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component tooltip - version: main installed by templui v0.71.0 + +package tooltip + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Position string + +const ( + PositionTop Position = "top" + PositionRight Position = "right" + PositionBottom Position = "bottom" + PositionLeft Position = "left" +) + +// Map tooltip positions to popover positions +func mapTooltipPositionToPopover(position Position) popover.Placement { + switch position { + case PositionTop: + return popover.PlacementTop + case PositionRight: + return popover.PlacementRight + case PositionBottom: + return popover.PlacementBottom + case PositionLeft: + return popover.PlacementLeft + default: + return popover.PlacementTop + } +} + +type Props struct { + ID string + Class string + Attributes templ.Attributes +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + For string +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + ShowArrow bool + Position Position + HoverDelay int + HoverOutDelay int +} + +func Tooltip(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Popover().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ + ID: p.ID, + TriggerType: popover.TriggerTypeHover, + For: p.For, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ContentProps + if len(props) > 0 { + p = props[0] + } + templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: p.ID, + Class: utils.TwMerge("px-4 py-1 bg-foreground text-background border-foreground", p.Class), + Attributes: p.Attributes, + Placement: mapTooltipPositionToPopover(p.Position), + ShowArrow: p.ShowArrow, + HoverDelay: p.HoverDelay, + HoverOutDelay: p.HoverOutDelay, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/utils/templui.go b/server/web/templui/utils/templui.go new file mode 100644 index 0000000..3f7c7a9 --- /dev/null +++ b/server/web/templui/utils/templui.go @@ -0,0 +1,55 @@ +// templui util templui.go - version: main installed by templui v0.71.0 +package utils + +import ( + "fmt" + + "crypto/rand" + + "github.com/a-h/templ" + + twmerge "github.com/Oudwins/tailwind-merge-go" +) + +// TwMerge combines Tailwind classes and resolves conflicts. +// Example: "bg-red-500 hover:bg-blue-500", "bg-green-500" → "hover:bg-blue-500 bg-green-500" +func TwMerge(classes ...string) string { + return twmerge.Merge(classes...) +} + +// TwIf returns value if condition is true, otherwise an empty value of type T. +// Example: true, "bg-red-500" → "bg-red-500" +func If[T comparable](condition bool, value T) T { + var empty T + if condition { + return value + } + return empty +} + +// TwIfElse returns trueValue if condition is true, otherwise falseValue. +// Example: true, "bg-red-500", "bg-gray-300" → "bg-red-500" +func IfElse[T any](condition bool, trueValue T, falseValue T) T { + if condition { + return trueValue + } + return falseValue +} + +// MergeAttributes combines multiple Attributes into one. +// Example: MergeAttributes(attr1, attr2) → combined attributes +func MergeAttributes(attrs ...templ.Attributes) templ.Attributes { + merged := templ.Attributes{} + for _, attr := range attrs { + for k, v := range attr { + merged[k] = v + } + } + return merged +} + +// RandomID generates a random ID string. +// Example: RandomID() → "id-1a2b3c" +func RandomID() string { + return fmt.Sprintf("id-%s", rand.Text()) +} diff --git a/sqlc.yaml b/sqlc.yaml new file mode 100644 index 0000000..06e31c4 --- /dev/null +++ b/sqlc.yaml @@ -0,0 +1,18 @@ +version: "2" +sql: + - engine: "postgresql" + schema: + - "server/internal/database/schema.sql" + queries: + - "server/internal/database/queries-files.sql" + - "server/internal/database/queries-processing_jobs.sql" + database: + managed: false + uri: "postgresql://scanfile:${PG_PASSWORD}@localhost:5432/scanfile" + gen: + go: + package: "sqlc" + out: "server/internal/sqlc" + sql_package: "pgx/v5" + sql_driver: "github.com/jackc/pgx/v5" + diff --git a/tmp/build-errors.log b/tmp/build-errors.log index 85b94dd..0c95a68 100644 --- a/tmp/build-errors.log +++ b/tmp/build-errors.log @@ -1 +1 @@ -exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 1exit status 1exit status 1 \ No newline at end of file +exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1 \ No newline at end of file