Skip to content

Commit

Permalink
Merge pull request #37 from invopop/popui
Browse files Browse the repository at this point in the history
new folder structure for popui
  • Loading branch information
beliolfa authored Oct 11, 2024
2 parents a363ccb + 88a4afa commit f2a42de
Show file tree
Hide file tree
Showing 247 changed files with 383 additions and 374 deletions.
8 changes: 4 additions & 4 deletions src/gokit/.air.toml → .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ tmp_dir = "tmp"

[build]
args_bin = ["serve", "-p", "3000"]
bin = "./gokit"
cmd = "TEMPL_EXPERIMENT=rawgo templ generate && go build ./cmd/gokit"
bin = "./popui"
cmd = "TEMPL_EXPERIMENT=rawgo templ generate && go build ./go/cmd/popui"
delay = 1000
exclude_dir = ["tmp", "vendor", "testdata", "node_modules", "dist", "src/svelte", "src/web-components"]
exclude_file = ["gokit"]
exclude_dir = ["tmp", "vendor", "testdata", "node_modules", "dist", "svelte", "web-components", "html"]
exclude_file = ["popui"]
exclude_regex = ["_test.go", "_templ.go"]
exclude_unchanged = false
follow_symlink = false
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
/src/lib
/src/gokit/tmp
/src
/storybook-static
gokit
popui
/tmp
15 changes: 13 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/sveltekit'

const config: StorybookConfig = {
stories: ['../src/svelte/**/*.mdx', '../src/svelte/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../svelte/**/*.mdx', '../svelte/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
Expand All @@ -14,6 +14,17 @@ const config: StorybookConfig = {
docs: {
autodocs: 'tag'
},
staticDirs: ['../src/svelte/static']
staticDirs: ['../svelte/static'],
async viteFinal(config) {
const { mergeConfig } = await import('vite')

return mergeConfig(config, {
server: {
fs: {
allow: ['./svelte']
}
}
})
}
}
export default config
2 changes: 1 addition & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Preview } from '@storybook/svelte'
import 'inter-ui/inter.css'
import './variables.css'
import { install } from '@twind/core'
import twconfig from '../src/svelte/twind.config.js'
import twconfig from '../svelte/twind.config.js'
install(twconfig)

const preview: Preview = {
Expand Down
2 changes: 1 addition & 1 deletion src/gokit/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/invopop/ui-kit/src/gokit
module github.com/invopop/popui

go 1.22.3

Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions src/gokit/alpine/tags.templ → go/alpine/tags.templ
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package alpine

import (
"github.com/dchest/uniuri"
"github.com/invopop/ui-kit/src/gokit"
"github.com/invopop/ui-kit/src/gokit/classes"
"github.com/invopop/ui-kit/src/gokit/props"
popui "github.com/invopop/popui/go"
"github.com/invopop/popui/go/classes"
"github.com/invopop/popui/go/props"
)

templ Tags(p props.Tags) {
{{ id := uniuri.New() }}
<div class="flex flex-col gap-1">
if p.Label != "" {
@gokit.InputLabel(props.Label{ID: id}) {
@popui.InputLabel(props.Label{ID: id}) {
{ p.Label }
}
}
Expand All @@ -20,7 +20,7 @@ templ Tags(p props.Tags) {
<li class={ classes.Tag }>
<span x-text="tag"></span>
<button class={ classes.TagButton } data-tooltip="remove tag" @click={ p.Tags + `.splice(idx, 1); ` + p.OnRemove + `(tag)` }>
@gokit.CloseIcon()
@popui.CloseIcon()
</button>
</li>
</template>
Expand Down Expand Up @@ -48,14 +48,14 @@ templ Tags(p props.Tags) {
}` }
>
<div class="flex-1">
@gokit.InputText(props.InputText{ID: id, Attrs: templ.Attributes{
@popui.InputText(props.InputText{ID: id, Attrs: templ.Attributes{
"x-model": "tags_newTag",
"@keydown.enter": "tags_addTag",
":class": "{ '" + classes.InputTextError + "': tags_error }",
}, Error: props.Error{Attrs: templ.Attributes{"x-text": "tags_error"}}})
</div>
<div class="mt-0.5">
@gokit.Button(props.Button{Attrs: templ.Attributes{"@click": "tags_addTag"}}) {
@popui.Button(props.Button{Attrs: templ.Attributes{"@click": "tags_addTag"}}) {
Add
}
</div>
Expand Down
30 changes: 15 additions & 15 deletions src/gokit/alpine/tags_templ.go → go/alpine/tags_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gokit/avatar.templ → go/avatar.templ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gokit
package popui

import (
"github.com/invopop/ui-kit/src/gokit/classes"
"github.com/invopop/ui-kit/src/gokit/props"
"github.com/invopop/popui/go/classes"
"github.com/invopop/popui/go/props"
)

templ Avatar(p props.Avatar) {
Expand Down
8 changes: 4 additions & 4 deletions src/gokit/avatar_templ.go → go/avatar_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gokit/button.templ → go/button.templ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gokit
package popui

import (
"github.com/invopop/ui-kit/src/gokit/classes"
"github.com/invopop/ui-kit/src/gokit/props"
"github.com/invopop/popui/go/classes"
"github.com/invopop/popui/go/props"
)

templ Button(p props.Button) {
Expand Down
8 changes: 4 additions & 4 deletions src/gokit/button_templ.go → go/button_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/gokit/checkbox.templ → go/checkbox.templ
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gokit
package popui

import (
"github.com/invopop/ui-kit/src/gokit/classes"
"github.com/invopop/ui-kit/src/gokit/props"
"github.com/invopop/popui/go/classes"
"github.com/invopop/popui/go/props"
)

templ Checkbox(p props.Checkbox) {
Expand Down
Loading

0 comments on commit f2a42de

Please sign in to comment.