Skip to content

Commit d098638

Browse files
committed
fix: add disabled to number-input, search-input, textarea, and timepicker
1 parent 3fbc66a commit d098638

File tree

11 files changed

+56
-4
lines changed

11 files changed

+56
-4
lines changed

src/lib/forms/phoneinput/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export const phoneInput = tv({
77
slots: {
88
div: "absolute inset-y-0 start-0 top-0 flex items-center ps-3.5 pointer-events-none",
99
svg: "w-4 h-4 text-gray-500 dark:text-gray-400",
10-
input: "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500",
10+
input: "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-50",
1111
span: "absolute start-0 bottom-3 text-gray-500 dark:text-gray-400",
12-
floatingInput: "block py-2.5 ps-6 pe-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-primary-500 focus:outline-none focus:ring-0 focus:border-primary-600 peer",
12+
floatingInput: "block py-2.5 ps-6 pe-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-primary-500 focus:outline-none focus:ring-0 focus:border-primary-600 peer disabled:cursor-not-allowed disabled:opacity-50",
1313
label: "absolute text-sm text-gray-500 dark:text-gray-400 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:start-6 peer-focus:start-0 peer-focus:text-primary-600 peer-focus:dark:text-primary-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto"
1414
},
1515
variants: {

src/lib/forms/search/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const search = tv({
1010
left: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none",
1111
icon: "text-gray-500 dark:text-gray-400",
1212
content: "absolute inset-y-0 end-0 flex items-center text-gray-500 dark:text-gray-400",
13-
input: "block w-full text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500",
13+
input: "block w-full text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 disabled:cursor-not-allowed disabled:opacity-50",
1414
close: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-black",
1515
svg: ""
1616
},

src/lib/forms/textarea/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const textarea = tv({
77
slots: {
88
div: "relative",
99
base: "block w-full text-sm border-0 px-0 bg-inherit dark:bg-inherit focus:outline-hidden focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50",
10-
wrapper: "text-sm rounded-lg bg-gray-50 dark:bg-gray-600 text-gray-900 dark:placeholder-gray-400 dark:text-white border border-gray-200 dark:border-gray-500",
10+
wrapper: "text-sm rounded-lg bg-gray-50 dark:bg-gray-600 text-gray-900 dark:placeholder-gray-400 dark:text-white border border-gray-200 dark:border-gray-500 disabled:cursor-not-allowed disabled:opacity-50",
1111
inner: "py-2 px-4 bg-white dark:bg-gray-800",
1212
header: "py-2 px-3 border-gray-200 dark:border-gray-500",
1313
footer: "py-2 px-3 border-gray-200 dark:border-gray-500",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts">
2+
import { PhoneInput, Input } from "flowbite-svelte";
3+
</script>
4+
5+
<form class="mx-auto max-w-sm space-y-2">
6+
<Input disabled type="number" id="number-input" aria-describedby="helper-text-explanation" placeholder="90210" required />
7+
8+
<PhoneInput classes={{input:"rounded-lg"}} placeholder="123-456-7890" disabled phoneType="countryCode" />
9+
</form>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script lang="ts">
2+
import { Search, Button } from "flowbite-svelte";
3+
</script>
4+
5+
<Search disabled>
6+
<Button disabled class="me-1">Search</Button>
7+
</Search>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts">
2+
import { Textarea } from "flowbite-svelte";
3+
</script>
4+
5+
<Textarea disabled id="textarea-id" placeholder="Your message" rows={4} name="message" class="w-full" />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts">
2+
import { Timepicker } from "flowbite-svelte";
3+
</script>
4+
5+
<Timepicker disabled />

src/routes/docs/forms/number-input.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Use this component to set a number value inside a form field by applying the typ
2424
{#include Default.svelte}
2525
```
2626

27+
## Disabled
28+
29+
```svelte example
30+
{#include Disabled.svelte}
31+
```
32+
2733
## ZIP code input
2834

2935
Use this example with an icon and helper text to set a ZIP code value inside a form field by also applying the pattern attribute to validate the input using a regular expression for a 5 digit number.

src/routes/docs/forms/search-input.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ You will also find more advanced search components on this page including dropdo
3131
{#include Default.svelte}
3232
```
3333

34+
## Disabled
35+
36+
```svelte example class="flex flex-col gap-4"
37+
{#include Disabled.svelte}
38+
```
39+
3440
## Search input with clearable
3541

3642
Use the simplest form of a search input component with an icon and a search button next to the text field.

src/routes/docs/forms/textarea.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ Get started with the default example of a textarea component below.
3131
{#include Default.svelte}
3232
```
3333

34+
## Disabled
35+
36+
Get started with the default example of a textarea component below.
37+
38+
```svelte example
39+
{#include Disabled.svelte}
40+
```
41+
3442
## Clearable
3543

3644
```svelte example

0 commit comments

Comments
 (0)