Skip to content

Commit

Permalink
fix: iframe examples because sitemap ssg config (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmimiex authored Aug 29, 2024
1 parent feadeb8 commit f0fc0a5
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/web/adapters/static/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default extendConfig(baseConfig, () => {
plugins: [
staticAdapter({
origin: 'https://flowbite-qwik.com',
sitemapOutFile: 'sitemap.xml',
exclude: ['/examples/*', '/docs'],
// sitemapOutFile: 'sitemap.xml',
// exclude: ['/examples', '/examples/*', '/docs'],
}),
],
}
Expand Down
52 changes: 52 additions & 0 deletions apps/web/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://flowbite-qwik.com/docs/components/drawer</loc></url>
<url><loc>https://flowbite-qwik.com/docs/customize/theme</loc></url>
<url><loc>https://flowbite-qwik.com/docs/typography/hr</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/jumbotron</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/toast</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/dropdown</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/footer</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/tooltip</loc></url>
<url><loc>https://flowbite-qwik.com/docs/customize/dark-mode</loc></url>
<url><loc>https://flowbite-qwik.com/docs/typography/link</loc></url>
<url><loc>https://flowbite-qwik.com/docs/typography/list</loc></url>
<url><loc>https://flowbite-qwik.com/docs/typography/heading</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/checkbox</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/accordion</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/date-picker</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/kbd</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/timeline</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/rating</loc></url>
<url><loc>https://flowbite-qwik.com/</loc></url>
<url><loc>https://flowbite-qwik.com/docs/typography/blockquote</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/table</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/avatar</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/carousel</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/modal</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/radio</loc></url>
<url><loc>https://flowbite-qwik.com/docs/getting-started/quickstart</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/breadcrumb</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/button</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/progress-bar</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/textarea</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/toggle</loc></url>
<url><loc>https://flowbite-qwik.com/docs/getting-started/license</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/badge</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/card</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/navbar</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/spinner</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/range</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/banner</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/button-group</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/pagination</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/sidebar</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/select</loc></url>
<url><loc>https://flowbite-qwik.com/docs/getting-started/introduction</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/alert</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/clipboard</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/list-group</loc></url>
<url><loc>https://flowbite-qwik.com/docs/components/tabs</loc></url>
<url><loc>https://flowbite-qwik.com/docs/forms/input</loc></url>
</urlset>
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flowbite-qwik",
"version": "0.36.0",
"version": "0.36.1",
"description": "Unofficial Qwik components built for Flowbite and Tailwind CSS",
"keywords": [
"design-system",
Expand Down
3 changes: 1 addition & 2 deletions packages/lib/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { QRL, Slot, component$, useComputed$, PropsOf, Signal, JSXChildren } from '@builder.io/qwik'
import { QRL, Slot, component$, useComputed$, PropsOf, JSXChildren } from '@builder.io/qwik'
import clsx from 'clsx'
import { useCheckboxClasses } from './composables/use-checkbox-classes'
import { twMerge } from 'tailwind-merge'
import { FlowbiteTheme } from '../FlowbiteThemable'

type CheckboxProps = Omit<PropsOf<'input'>, 'children'> & {
color?: FlowbiteTheme
'bind:checked'?: Signal<boolean | undefined>
onChange$?: QRL<(checked: boolean, value: string) => void>
children?: JSXChildren
}
Expand Down
25 changes: 22 additions & 3 deletions packages/lib/src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { JSXOutput, PropsOf, component$, useComputed$, useId, Signal } from '@builder.io/qwik'
import { JSXOutput, PropsOf, component$, useComputed$, useId, useVisibleTask$, useSignal } from '@builder.io/qwik'
import { InputSize, ValidationStatus, validationStatusMap } from './input-types'
import { twMerge } from 'tailwind-merge'
import { useInputClasses } from './composables/use-input-classes'

type InputProps = Omit<PropsOf<'input'>, 'size'> & {
label?: string
'bind:value'?: Signal<string | undefined>
size?: InputSize
validationStatus?: ValidationStatus
suffix?: JSXOutput
Expand All @@ -31,6 +30,14 @@ export const Input = component$<InputProps>(
useComputed$(() => validationStatus),
)

// FIXME : qwik issue when value is given without bind:value
const inputRef = useSignal<HTMLInputElement>()
useVisibleTask$(() => {
if (inputRef.value && !props['bind:value'] && props.value) {
inputRef.value.value = props.value as string
}
})

return (
<div class={classNames}>
{Boolean(label) && (
Expand All @@ -40,7 +47,19 @@ export const Input = component$<InputProps>(
)}
<div class="relative flex">
{Boolean(prefix) && <div class="pointer-events-none absolute inset-y-0 left-0 flex w-10 items-center overflow-hidden pl-3">{prefix}</div>}
<input {...props} bind:value={props['bind:value']} id={id} class={twMerge(inputClasses.value, prefix && 'pl-10', suffix && 'pr-11')} />
<input
{...props}
ref={inputRef}
id={id}
bind:value={props['bind:value']}
class={twMerge(inputClasses.value, prefix && 'pl-10', suffix && 'pr-11')}
// FIXME : qwik issue, error if onInput$ is not redefined with the "if"
onInput$={(_, elm) => {
if (props['bind:value']) {
props['bind:value'].value = elm.value
}
}}
/>
{Boolean(suffix) && <div class="absolute right-2.5 top-1/2 -translate-y-1/2">{suffix}</div>}
</div>
{Boolean(validationMessage) && <div class={validationWrapperClasses}>{validationMessage}</div>}
Expand Down

0 comments on commit f0fc0a5

Please sign in to comment.