flowbite-svelte 0.15.11 → 0.15.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.15.12](https://github.com/themesberg/flowbite-svelte/compare/v0.15.11...v0.15.12) (2022-05-05)
6
+
7
+
8
+ ### Features
9
+
10
+ * add RadioItem and RadioInline for colors, inline, helper text ([9fc2812](https://github.com/themesberg/flowbite-svelte/commit/9fc281268f8008023e5a8d501893b8761ba8a5ef))
11
+
5
12
  ### [0.15.11](https://github.com/themesberg/flowbite-svelte/compare/v0.15.10...v0.15.11) (2022-05-03)
6
13
 
7
14
 
@@ -0,0 +1,5 @@
1
+ <script></script>
2
+
3
+ <div class="flex">
4
+ <slot />
5
+ </div>
@@ -0,0 +1,16 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {};
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {
8
+ default: {};
9
+ };
10
+ };
11
+ export declare type RadioInlineProps = typeof __propDef.props;
12
+ export declare type RadioInlineEvents = typeof __propDef.events;
13
+ export declare type RadioInlineSlots = typeof __propDef.slots;
14
+ export default class RadioInline extends SvelteComponentTyped<RadioInlineProps, RadioInlineEvents, RadioInlineSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,56 @@
1
+ <script>export let divClass = 'flex items-center mr-4';
2
+ export let inputClass = 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600';
3
+ export let labelClass = 'block ml-2 text-sm font-medium text-gray-900 dark:text-gray-300';
4
+ export let name = '';
5
+ export let options;
6
+ export let divHelperClass = 'flex items-center h-5';
7
+ export let labelHelperClass = 'font-medium text-gray-900 dark:text-gray-300';
8
+ export let helperClass = 'text-xs font-normal text-gray-500 dark:text-gray-300';
9
+ export let color = 'blue';
10
+ if (color === 'red') {
11
+ inputClass = 'w-4 h-4 text-red-600 bg-gray-100 border-gray-300 focus:ring-red-500 dark:focus:ring-red-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
12
+ }
13
+ else if (color === 'green') {
14
+ inputClass = 'w-4 h-4 text-green-600 bg-gray-100 border-gray-300 focus:ring-green-500 dark:focus:ring-green-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
15
+ }
16
+ else if (color === 'purple') {
17
+ inputClass = 'w-4 h-4 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 dark:focus:ring-purple-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
18
+ }
19
+ else if (color === 'teal') {
20
+ inputClass = 'w-4 h-4 text-teal-600 bg-gray-100 border-gray-300 focus:ring-teal-500 dark:focus:ring-teal-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
21
+ }
22
+ else if (color === 'yellow') {
23
+ inputClass = 'w-4 h-4 text-yellow-400 bg-gray-100 border-gray-300 focus:ring-yellow-500 dark:focus:ring-yellow-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
24
+ }
25
+ else if (color === 'orange') {
26
+ inputClass = 'w-4 h-4 text-orange-500 bg-gray-100 border-gray-300 focus:ring-orange-500 dark:focus:ring-orange-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
27
+ }
28
+ else {
29
+ inputClass = 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600';
30
+ }
31
+ export let helper;
32
+ export let id;
33
+ export let value;
34
+ export let label;
35
+ </script>
36
+
37
+ {#if helper}
38
+ <div class="flex">
39
+ <div class={divHelperClass}>
40
+ <input {id} type="radio" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {...$$restProps} />
41
+ </div>
42
+ <div class="ml-2 text-sm">
43
+ <label for={id} class={labelHelperClass}>
44
+ {@html label}
45
+ </label>
46
+ <p id="{id}-helper-radio-text" class={helperClass}>{helper}</p>
47
+ </div>
48
+ </div>
49
+ {:else}
50
+ <div class={divClass}>
51
+ <input {id} type="radio" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {...$$restProps} />
52
+ <label for={id} class={labelClass}>
53
+ {@html label}
54
+ </label>
55
+ </div>
56
+ {/if}
@@ -0,0 +1,30 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { RadioType, RadioColorType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ [x: string]: any;
6
+ divClass?: string;
7
+ inputClass?: string;
8
+ labelClass?: string;
9
+ name?: string;
10
+ options: RadioType[];
11
+ divHelperClass?: string;
12
+ labelHelperClass?: string;
13
+ helperClass?: string;
14
+ color?: RadioColorType;
15
+ helper: string;
16
+ id: string;
17
+ value: string;
18
+ label: string;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {};
24
+ };
25
+ export declare type RadioItemProps = typeof __propDef.props;
26
+ export declare type RadioItemEvents = typeof __propDef.events;
27
+ export declare type RadioItemSlots = typeof __propDef.slots;
28
+ export default class RadioItem extends SvelteComponentTyped<RadioItemProps, RadioItemEvents, RadioItemSlots> {
29
+ }
30
+ export {};
package/index.js CHANGED
@@ -62,7 +62,8 @@ export { default as Fileupload } from './forms/Fileupload.svelte'
62
62
  export { default as FloatingLabelInput } from './forms/FloatingLabelInput.svelte'
63
63
  export { default as Iconinput } from './forms/Iconinput.svelte'
64
64
  export { default as Input } from './forms/Input.svelte'
65
- export { default as Radio } from './forms/Radio.svelte'
65
+ export { default as RadioInline } from './forms/RadioInline.svelte'
66
+ export { default as RadioItem } from './forms/RadioItem.svelte'
66
67
  export { default as Range } from './forms/Range.svelte'
67
68
  export { default as SingleCheckbox } from './forms/SingleCheckbox.svelte'
68
69
  export { default as Search } from './forms/Search.svelte'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.15.11",
3
+ "version": "0.15.12",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "./package/index.js",
6
6
  "author": {
@@ -128,7 +128,8 @@
128
128
  "./forms/FloatingLabelInput.svelte": "./forms/FloatingLabelInput.svelte",
129
129
  "./forms/Iconinput.svelte": "./forms/Iconinput.svelte",
130
130
  "./forms/Input.svelte": "./forms/Input.svelte",
131
- "./forms/Radio.svelte": "./forms/Radio.svelte",
131
+ "./forms/RadioInline.svelte": "./forms/RadioInline.svelte",
132
+ "./forms/RadioItem.svelte": "./forms/RadioItem.svelte",
132
133
  "./forms/Range.svelte": "./forms/Range.svelte",
133
134
  "./forms/Search.svelte": "./forms/Search.svelte",
134
135
  "./forms/Select.svelte": "./forms/Select.svelte",
package/types.d.ts CHANGED
@@ -117,12 +117,16 @@ export interface PillTabType {
117
117
  selected: boolean;
118
118
  href: string;
119
119
  }
120
+ export declare type RadioColorType = 'blue' | 'red' | 'green' | 'purple' | 'teal' | 'yellow' | 'orange';
120
121
  export interface RadioType {
121
122
  id: string;
123
+ name: string;
122
124
  label: string | HTMLElement;
123
125
  value: string;
124
126
  checked?: boolean;
125
127
  disabled?: boolean;
128
+ helper?: string;
129
+ color?: RadioColorType;
126
130
  }
127
131
  export declare type SelectOptionType = {
128
132
  name: string;
@@ -1,16 +0,0 @@
1
- <script>export let divClass = 'flex items-center mb-4';
2
- export let inputClass = 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600';
3
- export let labelClass = 'block ml-2 text-sm font-medium text-gray-900 dark:text-gray-300';
4
- export let name = 'countries';
5
- export let options;
6
- </script>
7
-
8
- {#each options as option}
9
- <div class={divClass}>
10
- <input id={option.id} type="radio" {name} value={option.value} class={inputClass} aria-labelledby={option.id} aria-describedby={option.id} checked={option.checked} disabled={option.disabled} />
11
- <label for={option.id} class={labelClass}>
12
- {@html option.label}
13
- </label>
14
- <slot name="helper" />
15
- </div>
16
- {/each}
@@ -1,23 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { RadioType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- divClass?: string;
6
- inputClass?: string;
7
- labelClass?: string;
8
- name?: string;
9
- options: RadioType[];
10
- };
11
- events: {
12
- [evt: string]: CustomEvent<any>;
13
- };
14
- slots: {
15
- helper: {};
16
- };
17
- };
18
- export declare type RadioProps = typeof __propDef.props;
19
- export declare type RadioEvents = typeof __propDef.events;
20
- export declare type RadioSlots = typeof __propDef.slots;
21
- export default class Radio extends SvelteComponentTyped<RadioProps, RadioEvents, RadioSlots> {
22
- }
23
- export {};